Appearance
date: 2026-07-09 tags: [context-optimization, tokens, system-prompt, settings, mcp] status: graduated graduated_to: .claude/skills/optimise-context/SKILL.md
Context-trimming that only audits repo docs misses the biggest always-on cost — the platform payload
Symptom — A "cut token cost" pass started where optimise-context pointed it: CLAUDE.md and the skill descriptions. Those were real but modest wins (~3k tokens/session). The largest always-on costs were nearly missed because the skill never named them: the Workflow tool definition (often the single heaviest line in the system prompt), MCP tool schemas (codegraph's ten tools), and Anthropic's bundled skill descriptions — none of it repo text.
Root cause — optimise-context only enumerated authored surfaces (CLAUDE.md, rules, skill/agent descriptions). The system prompt also always-on-loads tool definitions and bundled skills, which are platform-loaded, frequently larger than any doc, and cut via .claude/settings.json rather than by editing files. Two adjacent blind spots surfaced in the same pass: (1) some always-on repo text — the codegraph MCP doc — was valid only in local sessions, but the maintainer works ~99% in web containers, so it was dead weight that also misdirected the agent toward tools that don't exist there; (2) the skill listed SOUL.md as an always-on target, but SOUL is never loaded into a Claude Code session — it's the Tempo app's runtime cost via PersonalContext, a different budget and owner.
Fix — PR #925: removed codegraph end-to-end, set disableWorkflows + skillOverrides in .claude/settings.json, and trimmed the descriptions + CLAUDE.md. Then folded the lessons into .claude/skills/optimise-context/SKILL.md: a platform-payload lens (tool defs + bundled skills, cut via disableWorkflows / skillOverrides / bare-name permissions.deny), an environment-scope lens ("load-bearing where, and how often is the maintainer there?"), a correction splitting harness-always-on from app-runtime (SOUL.md/PersonalContext), a note that tool-definition size can only be estimated in-session and must be confirmed with the client's /context, and a reminder to doc-verify settings keys (they silently no-op if wrong).
Guard — optimise-context now carries both new lenses plus the harness-vs-app-runtime split, so the next context pass audits the platform payload and environment scope, not just docs. This hardened into the skill's standing procedure (hence status: graduated); the entry is kept as provenance.