Back to Library
Project ContextIntermediate
Feed Context Incrementally
For very large codebases, add files one by one per round-trip rather than dumping everything at once—this reduces noise and token waste.
context-managementincrementaltoken-efficiency
The Strategy
Dumping an entire codebase wastes tokens on irrelevant files. Asking Claude what it needs and providing files on demand produces more focused, accurate suggestions.
prompt.txt
// Round 1: Establish the goal
<task>
I need to add JWT refresh token rotation to my Express API.
Ask me for the files you need to see before suggesting changes.
</task>
// Round 2 (after Claude asks): Provide auth middleware
<file name="middleware/auth.ts">
[File contents here]
</file>
// Round 3: Provide the user model
<file name="models/User.ts">
[File contents here]
</file>You might also need
Project ContextIntermediate
Provide a Repo Map for Large Codebases
When your codebase is too large to paste, generate a file tree and include it as context so Claude understands your project structure.
repo-mapfile-treearchitecture
View snippet
Project ContextIntermediate
Reference Multiple Files in Context
Use named `<file>` tags to pass multiple files at once, making cross-file relationships explicit for Claude.
multi-filecontexttype-consistency
View snippet