From harness-anchor
Use when sessions run long, adding subagents, fetching large files, or planning context-heavy work. SELECT/WRITE/COMPRESS/ISOLATE discipline.
How this skill is triggered — by the user, by Claude, or both
Slash command
/harness-anchor:context-budget-disciplineThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Context is a finite resource. Every token competes for the model's attention. The "lost-in-the-middle" phenomenon is real — content buried in 50% of the window position is least attended.
Context is a finite resource. Every token competes for the model's attention. The "lost-in-the-middle" phenomenon is real — content buried in 50% of the window position is least attended.
This skill applies four operations to keep the budget sane.
SELECT load context just-in-time, not all-at-once
WRITE persist to disk; let the filesystem remember, not chat
COMPRESS summarize older turns when window fills
ISOLATE delegate so child work doesn't pollute parent context
Default behaviour: don't preemptively load files. Wait until they're needed.
Anything reusable across turns should live on disk:
feature_list.jsonprogress.md or docs/decisions/session-handoff.mdAnti-pattern: re-explaining the same plan/decision in every reply.
When context usage > 70% of model window, mid-session compaction can help. But per Anthropic Nov 2025:
"Compaction preserves continuity, but doesn't give the agent a clean slate. Context anxiety can still persist."
If compaction isn't enough → use /session-end to write a rich handoff, then suggest the user start a fresh context (context reset > compaction for long runs).
Subagents (/verify, cpp-build-doctor, etc.) run in fresh context. They:
If you delegate a noisy task, ask for a SUMMARY back, not a transcript.
| Tier | Budget | Source |
|---|---|---|
| Tier 1 (always loaded) | ~2000 tokens | SessionStart hook injection (capped) |
| System prompt + tools | Model-defined | Outside your control |
| Working context | Most of remaining window | Your edits + reads accumulate here |
When budget pressure rises:
/session-end if features are in flight.head -50, grep -A 5, line range in Read tool — over reading whole files.You can roughly estimate context use by:
When the user asks "how much room do we have?", be honest about the estimate.
For specific patterns (e.g., compaction algorithms, attention windowing, RAG indexing strategies) — invoke the docs-lookup skill. Pattern names evolve fast in this area; don't rely on memory.
Typical entry query: context engineering 2026 or <specific technique> llm.
using-harness-anchor — Tier 1 injection budget referencefeature-state-keeper — what to write to diskproject-indexing — TOC as compressed file indexCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub redtropig/harness-anchor --plugin harness-anchor