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/*.md files (architecture, code-style, commits, governance, rust)
- Skill catalogs (67+ skills in skills.yaml)
- Agent catalogs (17+ agent definitions)
.agents/guards/*.md governance 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 healthcheck should 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) vs CLAUDE.md (full, loaded on request). The sync engine generates the summary automatically.
- Rule file consolidation — instead of N separate
.claude/rules/*.md files, retort could bundle them into a single file during sync to reduce file-read overhead.
Context
Problem
When
chat.includeReferencedInstructions: trueis enabled, the client attaches the full customization surface every turn:.claude/rules/*.mdfiles (architecture, code-style, commits, governance, rust).agents/guards/*.mdgovernance filesIn mystira-workspace, this alone accounts for a significant portion of the ~120k token sessions.
Proposed Solutions
retort healthcheckshould estimate the per-turn instruction cost for an onboarded repo and warn when it exceeds a threshold (e.g., 15k tokens).CLAUDE.summary.md(compact, always loaded) vsCLAUDE.md(full, loaded on request). The sync engine generates the summary automatically..claude/rules/*.mdfiles, retort could bundle them into a single file during sync to reduce file-read overhead.Context
chat.includeReferencedInstructionscauses all of these to be injected every turn