-
Notifications
You must be signed in to change notification settings - Fork 0
Context budget: referenced instruction expansion is the largest token source #449
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
When chat.includeReferencedInstructions: true is enabled, the client attaches the full customization surface every turn:
- CLAUDE.md files (root, workspace, project — often 3+ levels deep)
.claude/rules/*.mdfiles (architecture, code-style, commits, governance, rust)- Skill catalogs (67+ skills in skills.yaml)
- Agent catalogs (17+ agent definitions)
.agents/guards/*.mdgovernance files
In mystira-workspace, this alone accounts for a significant portion of the ~120k token sessions.
Proposed Solutions
- Lazy instruction loading — retort sync engine should generate a compact index/summary rather than full agent/skill definitions. Full definitions loaded on-demand when a specific agent or skill is invoked.
- Instruction budget calculator —
retort healthcheckshould estimate the per-turn instruction cost for an onboarded repo and warn when it exceeds a threshold (e.g., 15k tokens). - Tiered CLAUDE.md — support a
CLAUDE.summary.md(compact, always loaded) vsCLAUDE.md(full, loaded on request). The sync engine generates the summary automatically. - Rule file consolidation — instead of N separate
.claude/rules/*.mdfiles, retort could bundle them into a single file during sync to reduce file-read overhead.
Context
- mystira-workspace has 5 rule files, 17 agents, 14 project-specific skills, 3 CLAUDE.md levels
- VS Code setting
chat.includeReferencedInstructionscauses all of these to be injected every turn - This is the Add orchestration engine, workflow commands, and comprehensive documentation #1 contributor to context bloat based on analysis
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request