context-budget-discipline

context-budget-discipline is a skill for Claude Code from Redtropig/harness-anchor. It costs 37 tokens per session (1,347 once invoked), scanned A, original, MIT.

A set of rules for managing the limited amount of project information an agent can keep in its working context.

In plain words
What is it for?
Use it to load only needed information, save reusable decisions to files, summarize older work, and isolate delegated tasks.
Why use it?
Long sessions, large files, and extra agents can bury important details or exceed the available context.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: mentions subagents; mentions Claude Code; mentions AGENTS.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the harness-anchor plugin — 14 skills, 9 commands, 5 agents, 5 hooks shipped together

Good fit Use it to load only needed information, save reusable decisions to files, summarize older work, and isolate delegated tasks.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Redtropig/harness-anchor
Claude Code
/plugin install harness-anchor

Made for: Claude Code.

Or install harness-anchor, the plugin that ships this one along with the rest of its 14 skills, 9 commands, 5 agents, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-budget-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/redtropig/harness-anchor/context-budget-discipline/github.svg)](https://agentmods.dev/skills/redtropig/harness-anchor/context-budget-discipline)
Your own site
<a href="https://agentmods.dev/skills/redtropig/harness-anchor/context-budget-discipline"><img src="https://agentmods.dev/badge/skills/redtropig/harness-anchor/context-budget-discipline/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-budget-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/redtropig/harness-anchor/context-budget-discipline"><img src="https://agentmods.dev/badge/skills/redtropig/harness-anchor/context-budget-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,347 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.01347
Opus 5 $0.00018 $0.00674
Sonnet 5 $0.00007 $0.00269
Haiku 4.5 $0.00004 $0.00135

Measured 12d ago against content hash aea683fb324e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

context-budget-discipline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/context-budget-discipline/SKILL.md · 122 lines

How it starts

The opening of the file, as written. The whole thing — 122 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context Budget Discipline

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.

The Four Operations

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

SELECT — pull, don't push

Default behaviour: don't preemptively load files. Wait until they're needed.

  • ❌ "Let me read all 30 .cpp files to understand the project."
  • ✅ "I'll consult PROJECT-TOC.md first, then read only the 2 files the task touches."

WRITE — disk is cheap, context is expensive

Anything reusable across turns should live on disk:

  • Active feature → feature_list.json
  • Decisions / rationale → progress.md or docs/decisions/
  • "What I just did" → session-handoff.md

Anti-pattern: re-explaining the same plan/decision in every reply.

COMPRESS — summarize old turns when window pressure rises

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."

Flush before you compress. Before compaction/reset — or when the PostToolUse watermark fires (T1 "Context is filling" = flush now; T2 "Context is heavily filled" = wrap up via /session-end + fresh session) — write chat-only durable memory to disk first: golden-rule stubs (capturing-golden-rules), feature status, a milestone progress.md entry. After a compaction, do NOT backfill memory from the summary: reconstruct from on-disk evidence (git diff, test output, progress.md) and state uncertainty where evidence is missing.

Read the full file on GitHub · 122 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 122 lines · 37 tokens per session scan A aea683fb324e

Subscribe to this mod's changes

context-budget-discipline is a skill published in the GitHub repository Redtropig/harness-anchor (13 stars, last pushed 1mo ago), licensed MIT. It adds 37 tokens to every session and 1,347 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.