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