Appearance
optimise-context
optimise-context
optimisewriteshands-on
Use this when: the always-on context is bloated
Problem it solves — Every always-on token is paid on every session and every AI call. This trims that footprint — duplication, verbosity, volatile data that busts the prompt cache — surfacing each cut for confirm, without ever cutting meaning to save bytes.
Used in workflows: Harness health Check
Optimise context (always-on footprint)
Tokens in the always-on layer compound — they're paid on every session and every AI call. This trims that footprint without losing meaning. On-demand docs matter far less; spend effort where it loads every time.
This skill is the trim/backstop end of static ↔ dynamic placement (glossary): the static-or-dynamic call should be made at add-time (default dynamic, justify static — context as code); this is where we catch what slipped into the always-on layer without earning its slot.
What's always-on (the targets)
CLAUDE.md— the authored portion loads every Claude Code session. (The<laravel-boost-guidelines>block is regenerated byboost:update— leave it; flag its size as a known cost, don't edit it.) Generated / tool-managed blocks in general — Boost, and any<!-- X_START -->…<!-- X_END -->marker block a tool refills (e.g. an MCP indexer) — can't be durably hand-trimmed: the tool restores them on its next run. Put any durable note above the markers, where regeneration can't reach.- Every skill's
description— the/menu lists them all, so each description is always-on. Bloated descriptions are a real, easily-missed cost. - Every agent's
description— they load into the Agent tool definition each session, same deal as skill descriptions. - Preloaded
skills:content — an agent'sskills:list injects each skill's full body into every dispatch of that agent (e.g.worktree-buildercarries all offyi-tempo-domain). A recurring per-dispatch cost: weigh the preload against the agent reading it on demand. .claude/rules/—code-quality.mdis always-on; path-scoped rules load whenever the working set matches.CONTEXT.md— heavy reference, but on-demand (not auto-loaded into a session), so it isn't an always-on cost itself; only the CLAUDE.md pointer to it is.- The platform payload — bigger than the docs, easily missed. The system prompt also always-on-loads tool definitions (every MCP server's tool schemas + built-in tools like the Workflow tool) and bundled / first-party skill descriptions (
dataviz,code-review, …). These are often larger than any doc — the Workflow tool alone is frequently the single heaviest line — and none of it is repo text, so the doc lenses miss it. Cut it via settings, not edits (see the platform-payload lens below).
Harness-always-on ≠ app-runtime — don't conflate them.
SOUL.mdis not loaded into a Claude Code session (it's not aCLAUDE.md; no hook injects it). It rides the Tempo app's runtime AI calls viaPersonalContext— a different token budget, a different owner (app code), trimmed by app work closer tooptimise-prompts. This skill's scope is the Claude Code session always-on layer: flag PersonalContext cost if you spot it, but don't chase it as a harness cut.
The lenses — this is the skill
The value is finding bytes that buy nothing — not flattening nuance. Measure first (rough line/token counts of the always-on set; show the heaviest), then apply the lenses below. Two measurement caveats: you can count repo text directly, but the platform payload (tool defs, bundled skills) isn't countable from inside a session — estimate it and confirm with the client's /context before/after; and when a fix is a settings key, verify the exact key against the docs first — a wrong or misspelt key silently no-ops (skillOverrides matches skill names exactly).
- Duplication — one doc restating another (e.g. a CLAUDE.md section paraphrasing
CONTEXT.md; PR #125 cut exactly this). - Verbosity — prose that a tighter line or a name would carry; what-comments; repeated preamble across skills.
- Over-long skill descriptions — trim to the trigger essentials (they all load); move detail into the skill body, which is on-demand. Hard ceiling:
description+when_to_useclip at 1,536 chars combined — past that it isn't just cost, it's lost routing (#393 sweeps the set). - Always-on → on-demand — content that doesn't need to load every time could live in a body/reference the agent reads only when relevant. For a skill whose real trigger is a file area,
paths:glob-scoping replaces a fat description doing that job in prose. - Removal test — for a CLAUDE.md / rule section, ask: if I delete this, does behaviour change structurally? If yes it's load-bearing control-plane — keep. If not, it's decoration — cut it or move it on-demand. The sharpest test for "does this earn its always-on slot?".
- Doc-set rationalise — zoom out from lines to whole docs: does each doc (or section) still earn its place, or can it be consolidated / simplified / removed? (This is how
HANDOVER.mdwas retired — unique bits moved to CONTEXT.md/CLAUDE.md, the rest deleted.) If you remove or rename a doc that another doc references, fix those references in the same edit.qa-philosophyhands you the redundant-doc candidates it spots while auditing accuracy; this lens decides their fate. - Cache-stability — never interpolate volatile / per-task data (today's date, the current branch, a task id, live counts) into the always-on CLAUDE.md base: a changing prefix busts the prompt cache on every turn, which costs far more than the bytes. Volatile content belongs in on-demand rules or session context, not the stable base. Flag any always-on text that changes between sessions.
- Platform payload — settings levers, not edits. Beyond authored text, audit what the platform loads always-on — tool definitions and bundled skills — and cut it via
.claude/settings.json:disableWorkflows(drops the Workflow tool, often the single biggest line),skillOverridesper bundled skill (off= gone;user-invocable-only= human keeps/accessbut it leaves the agent's payload;name-only= name kept, description dropped),disableBundledSkills(blanket — usually too coarse), andpermissions.denywith a bare tool name (removes the whole definition; a scoped deny likeBash(rm *)only blocks the call, leaving the def loaded). Keep a skill/tool ON when its value is an auto-trigger the agent must see (e.g. a model-facts guard) —offthere loses the behaviour, not just the bytes. - Environment scope — load-bearing where? Always-on content valid only in an environment the maintainer rarely uses is dead weight — and worse than neutral if it steers the agent toward tools that don't exist there. Codegraph was a local-only MCP: ~640 tokens of doc + ~10 tool schemas, ~99% wasted because the work is ~99% web, and it told the agent to reach for absent tools (PR #925 removed it). Ask where the work actually happens before spending an always-on slot on one environment.
- Glossary hygiene (
CONTEXT.md). A domain-glossary entry is a tight definition + an_Avoid_line; when one restates mechanism (how a term is stored, wired, or computed) it's duplicating the feature spec (docs/features/) or an ADR — trim the entry to the definition and link the spec, don't carry both. CONTEXT.md is on-demand, but it's read on nearly every code-exploration, so its bloat recurs. (The CONTEXT.md instance of the duplication lens; PR #923 added four entries that each restated their feature spec. The point-of-edit guard is the note in CONTEXT.md's header +grill-with-docs.)
Output — surface, then trim
A table: target · file:line · current cost (lines/≈tokens) · the trim · what's preserved. AskUserQuestion which to apply. Never trim unprompted — this is canonical, always-on context; and never cut meaning to save bytes (that's a regression, not an optimisation). Whole-doc removals go through the same confirm gate.
Where it sits
- The footprint + rationalise counterpart to
qa-philosophy(which fixes accuracy/drift).qa-philosophyreconciles what the docs say; this trims what they cost and prunes docs that no longer earn their place. - Distinct from
qa-skills(which decides which skills exist); this trims the text of what's already there — including toggling bundled skills' payload visibility viaskillOverrides(a footprint lever, not a curation decision). - In
check-everythingit belongs to Brain, running after the docs have been aligned (so it trims settled content).
How this gets triggered
Invoke directly — "cut context", "we're token-heavy", "trim the always-on load", "do we still need this doc?". Good cadence: after a stretch that grew CLAUDE.md / the rules / the skill set.