Skip to content

fix: remove @ prefix from doc references to reduce context bloat - #721

Closed
dcramer wants to merge 1 commit into
mainfrom
fix/claude-md-context-bloat
Closed

dcramer wants to merge 1 commit into
mainfrom
fix/claude-md-context-bloat

Conversation

@dcramer

@dcramer dcramer commented Jan 16, 2026

Copy link
Copy Markdown
Member

Summary

  • Removes @ prefix from all doc references in AGENTS.md to prevent automatic context expansion
  • The @docs/ syntax was causing Claude Code to pre-load all referenced files into every conversation (~22,000 tokens)
  • After this change, docs remain accessible on-demand via Read tool when needed

Impact

  • Before: ~22,700 tokens loaded per conversation
  • After: ~600 tokens (just AGENTS.md)
  • Savings: ~22,000 tokens per conversation

Test plan

  • Start a new Claude Code conversation in this repo
  • Verify only AGENTS.md content appears in context (not expanded docs)
  • Test on-demand doc reading: ask "What does docs/testing.md say about snapshot testing?"

🤖 Generated with Claude Code

The @docs/ syntax causes Claude Code to auto-expand referenced files
into every conversation's context, consuming ~22,000+ tokens per session.

By removing the @ prefix, docs are no longer pre-loaded but remain
accessible on-demand via the Read tool when needed.

- Before: ~22,700 tokens loaded per conversation
- After: ~600 tokens (just AGENTS.md)
- Savings: ~22,000 tokens per conversation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dcramer dcramer closed this Jan 16, 2026
@dcramer
dcramer deleted the fix/claude-md-context-bloat branch January 16, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant