Agent skill

Context Budget

by mohitagw15856 in mohitagw15856/pm-claude-skills

Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns…

MITAuto-check passedAgent Workflows

Install Context Budget

skills CLI
$ npx skills add mohitagw15856/pm-claude-skills --skill context-budget -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitagw15856/pm-claude-skills context-budget --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitagw15856/pm-claude-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/context-budget .claude/skills/context-budget && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
context-budget
GitHub stars
1.4k
Token cost
~1.5k tokens
SKILL.md length
794 words
Files
1
Skills in repo
1,348
Repo updated
First seen
Licence
MIT

At a glance

Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns…

  • Works in 5 steps: Everything resident rides every turn:… → Link beats load for reference material:… → Layout is a price decision — stable… → …
  • Asked my agent keeps blowing its context
  • SKILL.md covers What This Skill Produces, Required Inputs, Framework: The Budgeting Rules and Output Format, plus 7 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Context Budget is an agent skill from mohitagw15856/pm-claude-skills. Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns cost cents instead of dollars. Use when asked my agent keeps blowing its context, plan what to load into the session, why is every turn so expensive, or design the context for this workflow. Produces the load/link/fetch allocation, the cache-aware prefix layout, the per-turn cost shape, and the eviction rules for when…

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Context engineering. The repository describes itself as: 1255 professional Agent Skills for Claude, ChatGPT, Gemini, Cursor & Codex — PRDs, postmortems, leases, medical bills, layoffs, go-bags, new countries. Plain markdown, MIT, in… The licence is MIT.

When your agent uses it

  • Asked my agent keeps blowing its context
  • Plan what to load into the session
  • Why is every turn so expensive
  • Design the context for this workflow

Example prompts

  • “/context-budget”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Everything resident rides every turn: the first question for each candidate is not "is it useful?" but "is it useful per turn?" — a…
  2. Link beats load for reference material: an index costs ~3% of its territory (repo-map for code, a crushed schema for data, a table of…
  3. Layout is a price decision — stable first, volatile last: cached-prefix pricing (often ~10% of fresh input) only applies while the prefix…
  4. Crush at the gates: tool outputs and files pass through context-crusher before entering; output rides token-diet levels where the reader…
  5. Evict by plan, not by panic: decide now what goes first when the window fills — typically: crushed tool outputs (refetchable) → resolved…

What it can do on your machine

Read from SKILL.md and the folder at commit 1cbf1f0. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Context Budget loads about 1.5k tokens when it runs. Until then it costs about 139 tokens; SKILL.md has 794 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~139
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitagw15856/pm-claude-skills at commit 1cbf1f0, republished under its MIT licence (© mohitagw15856). 794 words, ~1,525 tokens.

Download SKILL.mdSave it as .claude/skills/context-budget/SKILL.md (or your agent's skills folder).
name
context-budget
description
Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns cost cents instead of dollars. Use when asked my agent keeps blowing its context, plan what to load into the session, why is every turn so expensive, or design the context for this workflow. Produces the load/link/fetch allocation, the cache-aware prefix layout, the per-turn cost shape, and the eviction rules for when the window fills anyway.

Context Budget Skill

A context window is a budget that gets re-spent every single turn — everything sitting in it rides every call, which is how a session that "only loaded a few files" ends up paying for them forty times. This skill plans the spend before the session: what earns a permanent seat (loaded once, up front, stable), what gets linked (a map or index, with the full thing fetch-on-demand), and what never enters at all. The quiet second half is cache-awareness: providers price cached prefix tokens at a fraction of fresh ones, but only if the prefix stays byte-identical — so the layout (stable things first, volatile things last) is itself a cost decision.

Not quite this? Use context-switch-budget when you mean your own attention and context switching across the week, not an LLM's context window.

What This Skill Produces

  • The allocation — every candidate piece of context sorted into load / link / fetch-on-demand / exclude, with reasons
  • The prefix layout — stable-first ordering that keeps provider caches hitting turn after turn
  • The per-turn cost shape — what a turn costs at the start, mid-session, and near the window limit (measure with token-cost)
  • The eviction rules — pre-decided: what gets summarized, crushed, or dropped when the window fills, and in what order

Required Inputs

Ask for these if not provided:

  • The workflow — what the session does, how many turns it typically runs, what it touches (files, APIs, documents)
  • The candidate context — everything someone wants loaded: instructions, docs, schemas, examples, history — the raw wishlist the budget disciplines
  • The volatility map — which pieces change mid-session (edited files, growing history) and which never do (instructions, schemas) — the cache layout keys off this
  • The window and the pricing — the model's context size, and whether the provider prices cached input differently (most majors do — verify the current terms)

Framework: The Budgeting Rules

  1. Everything resident rides every turn: the first question for each candidate is not "is it useful?" but "is it useful per turn?" — a 4,000-token style guide consulted once cost 4,000 tokens if fetched on demand, and 4,000 × N turns as a resident. Residency is for what most turns actually use.
  2. Link beats load for reference material: an index costs ~3% of its territory (repo-map for code, a crushed schema for data, a table of contents for docs) — load the index, fetch the section when a turn needs it. The escape hatch makes it safe; the ratio makes it policy.
  3. Layout is a price decision — stable first, volatile last: cached-prefix pricing (often ~10% of fresh input) only applies while the prefix stays byte-identical, so anything that changes — timestamps, growing history, edited files — belongs after everything that doesn't. One volatile line at position zero un-caches everything below it, every turn.
  4. Crush at the gates: tool outputs and files pass through context-crusher before entering; output rides token-diet levels where the reader allows. The budget's borders are where compression works — inside, the tokens are already spent.
  5. Evict by plan, not by panic: decide now what goes first when the window fills — typically: crushed tool outputs (refetchable) → resolved sub-task history (summarized to outcomes via session-handoff) → stale file snapshots (re-readable) — and never the instructions or the decisions log. Mid-crisis eviction always throws out the wrong thing; that's why the order is written while calm.
Show full SKILL.md (250 more words)Show less

Output Format

Context Budget: [workflow] — [window size], ~[N] turns expected

The Allocation

PieceSize (~tokens)VerdictWhy
[load / link (with its index) / fetch-on-demand / exclude]

The Prefix Layout

[Ordered: instructions → schemas/standing refs → the maps/indexes → (volatility line) → working state → history — with the cache note per section]

Per-Turn Cost Shape

[Turn 1 / mid-session / near-limit — the arithmetic, cache-adjusted where pricing is known]

Eviction Rules (pre-decided)

[The order, each with its recovery route: "crushed outputs first — refetchable via [command]"]

Quality Checks

  • Every resident piece justified per-turn, not per-session
  • Reference material is linked via an index with a fetch route, not loaded wholesale
  • The layout puts nothing volatile above anything stable
  • Compression happens at the borders (crusher in, diet out)
  • The eviction order exists before the window fills, with recovery routes

Anti-Patterns

  • Do not load what a link can carry — residency is the most expensive real estate in the system
  • Do not put a timestamp at the top of a cached prefix — one volatile byte re-prices everything under it
  • Do not treat the window limit as the budget — the budget is per-turn cost × turns; the limit is just the wall
  • Do not evict the decisions log — history compresses, decisions don't; losing them re-litigates the session
  • Do not design for turn one — sessions are priced by their shape over time, and turn one is the cheapest turn there is

Example Trigger Phrases

  • "My agent keeps blowing its context."
  • "Plan what to load into the session."
  • "Why is every turn so expensive?"
  • "Design the context for this workflow."

© mohitagw15856, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/context-budget of mohitagw15856/pm-claude-skills.

Open the folder on GitHubat commit 1cbf1f0

Compare with similar skills

Context Budget next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Context Budget compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Context Budget this skillmohitagw15856/pm-claude-skills1.4k—~1.5kAutomated safety check: PassMIT
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Picoclaw Skill Creatorsipeed/picoclaw30k—~4.4kAutomated safety check: PassMIT
ccc Semantic Code Searchcocoindex-io/cocoindex-code2.8k—~938Automated safety check: PassApache-2.0
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence

Similar skills

  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check: notes
  • Picoclaw Skill Creator

    sipeed/picoclaw

    Guidance for creating, updating and reviewing Picoclaw skills, from the SKILL.md structure to organizing bundled scripts, references and assets.

    30k GitHub stars~4.4k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • ccc Semantic Code Search

    cocoindex-io/cocoindex-code

    Semantic code search and index management with the ccc CLI: the agent initializes, indexes and queries the project by concept, filtering by language or path.

    2.8k GitHub stars~938 tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Token Optimizer

    alexgreensh/token-optimizer

    Audit a Claude Code or Codex setup for context-window waste, then fix it and measure the savings.

    2.5k GitHub stars~3.6k tokensUpdated 2 days ago
    Agent WorkflowsAuto-check passed

More from mohitagw15856/pm-claude-skills

All 1,348 skills in this repo
  • Car Tco

    mohitagw15856/pm-claude-skills

    Compare the total cost of car ownership across buy-new, buy-used, lease, and keep-your-current-car — depreciation, insurance, maintenance ramp, and fuel over a real horizon, not just the monthly…

    1.4k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Cs Health Scorecard

    mohitagw15856/pm-claude-skills

    Build a customer health scorecard for a specific account. An agent skill from mohitagw15856/pm-claude-skills.

    1.4k GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Exit Waterfall

    mohitagw15856/pm-claude-skills

    Compute who gets what at each exit price from a cap table — liquidation preferences, conversion points, and where the founders' share collapses.

    1.4k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Feature Prioritisation

    mohitagw15856/pm-claude-skills

    Apply prioritisation frameworks (RICE, MoSCoW, Kano, ICE, Opportunity Scoring) to rank features and backlog items.

    1.4k GitHub stars~2k tokensUpdated yesterday
    Auto-check passed
  • Fire Number

    mohitagw15856/pm-claude-skills

    Compute a financial-independence (FIRE) target and years-to-reach with every assumption labeled as an assumption — plus a sensitivity table instead of a single false-precision answer.

    1.4k GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Freelance Rate

    mohitagw15856/pm-claude-skills

    Derive a freelance day/hourly rate backwards from target income, honest billable utilization, overhead, and the self-employment tax premium — the arithmetic that proves a rate is not salary÷2000.

    1.4k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Context Budget

What does Context Budget do?

Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns…. Context Budget is an agent skill from mohitagw15856/pm-claude-skills. Plan a session's context window like the budget it is — what loads up front, what gets linked instead, what stays fetch-on-demand, and how to keep the stable prefix cache-friendly so repeated turns cost cents instead of dollars.

When should I use Context Budget?

Context Budget fits situations like: asked my agent keeps blowing its context; plan what to load into the session; why is every turn so expensive; design the context for this workflow.

How do I install Context Budget in Claude Code?

Run `npx skills add mohitagw15856/pm-claude-skills --skill context-budget -a claude-code`. Or copy the skill folder (skills/context-budget in mohitagw15856/pm-claude-skills) into .claude/skills/context-budget in your project. Claude Code loads it when a task matches its description.

How do I install Context Budget in Codex?

Run `npx skills add mohitagw15856/pm-claude-skills --skill context-budget -a codex`. Or copy the skill folder (skills/context-budget in mohitagw15856/pm-claude-skills) into .agents/skills/context-budget in your project. Codex loads it when a task matches its description.

Can I use Context Budget in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitagw15856/pm-claude-skills --skill context-budget -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/context-budget, .gemini/skills/context-budget, .github/skills/context-budget and .opencode/skills/context-budget in your project.

What does Context Budget need to run?

SKILL.md names no scripts, command-line tools or credentials: Context Budget is instructions for the agent only.

Does Context Budget access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Context Budget safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Context Budget use?

Context Budget is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Context Budget use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Context Budget?

Skills that share tags, products or a category with Context Budget: Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Picoclaw Skill Creator (sipeed/picoclaw, 30k stars) and ccc Semantic Code Search (cocoindex-io/cocoindex-code, 2.8k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Context Budget?

mohitagw15856 (a GitHub user) maintains it in mohitagw15856/pm-claude-skills, which has 1,434 GitHub stars. The repository holds 1,348 skills in this directory. The repository was last updated on October 9, 2026.

Source: mohitagw15856/pm-claude-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.