context-budget

context-budget is a skill for Claude Code, Codex from gongyijie85/dsh-ecc. It costs 65 tokens per session (1,338 once invoked), scanned A, a copy of context-budget, MIT.

An audit of how much of Claude Code's context window is used by agents, skills, MCP servers, and rules. The context window is the amount of information an agent can consider in one session.

In plain words
What is it for?
Use it to inventory component sizes, find duplicated or oversized files, and prioritize ways to reclaim context space.
Why use it?
It shows which loaded components consume space when sessions become slow, crowded, or less reliable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; mentions Claude Code.

Good fit Use it to inventory component sizes, find duplicated or oversized files, and prioritize ways to reclaim context space.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gongyijie85/dsh-ecc/context-budget
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gongyijie85/dsh-ecc --skill context-budget
Clone the repo
git clone --depth 1 https://github.com/gongyijie85/dsh-ecc

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/context-budget/github.svg)](https://agentmods.dev/skills/gongyijie85/dsh-ecc/context-budget)
Your own site
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/context-budget"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/context-budget/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/gongyijie85/dsh-ecc/context-budget"><img src="https://agentmods.dev/badge/skills/gongyijie85/dsh-ecc/context-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,338 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 89% copy Near-identical to another mod 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.00065 $0.01338
Opus 5 $0.00032 $0.00669
Sonnet 5 $0.00013 $0.00268
Haiku 4.5 $0.00006 $0.00134

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

Security

Grade A, and why

context-budget 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 9d 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.

Origin

This is a copy

89% identical to context-budget — 28 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/context-budget/SKILL.md · 137 lines

How it starts

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

Context Budget

Analyze token overhead across every loaded component in a Claude Code session and surface actionable optimizations to reclaim context space.

When to Use

  • Session performance feels sluggish or output quality is degrading
  • You've recently added many skills, agents, or MCP servers
  • You want to know how much context headroom you actually have
  • Planning to add more components and need to know if there's room
  • Running /context-budget command (this skill backs it)

How It Works

Phase 1: Inventory

Scan all component directories and estimate token consumption:

Agents (agents/*.md)

  • Count lines and tokens per file (words × 1.3)
  • Extract description frontmatter length
  • Flag: files >200 lines (heavy), description >30 words (bloated frontmatter)

Skills (skills/*/SKILL.md)

  • Count tokens per SKILL.md
  • Flag: files >400 lines
  • Check for duplicate copies in .agents/skills/ — skip identical copies to avoid double-counting

Rules (rules/**/*.md)

  • Count tokens per file
  • Flag: files >100 lines
  • Detect content overlap between rule files in the same language module

MCP Servers (.mcp.json or active MCP config)

  • Count configured servers and total tool count
  • Estimate schema overhead at ~500 tokens per tool
  • Flag: servers with >20 tools, servers that wrap simple CLI commands (gh, git, npm, supabase, vercel)

CLAUDE.md (project + user-level)

  • Count tokens per file in the CLAUDE.md chain
  • Flag: combined total >300 lines

Phase 2: Classify

Sort every component into a bucket:

Bucket Criteria Action
Always needed Referenced in CLAUDE.md, backs an active command, or matches current project type Keep
Sometimes needed Domain-specific (e.g. language patterns), not referenced in CLAUDE.md Consider on-demand activation
Rarely needed No command reference, overlapping content, or no obvious project match Remove or lazy-load

Phase 3: Detect Issues

Read the full file on GitHub · 137 lines

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. 9d ago First seen · 137 lines · 65 tokens per session scan A 920c5edde48e

Subscribe to this mod's changes

context-budget is a skill published in the GitHub repository gongyijie85/dsh-ecc (6 stars, last pushed 2d ago), licensed MIT. It adds 65 tokens to every session and 1,338 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 89% identical to context-budget, differing in 28 lines, and is treated as a copy.

Related

Other skills, from other repositories

manage-taskboard

Manage work in the native DeepSeek Harness Taskboard with exact task ids and optimistic versions. Use when an Agent must inspect project work, claim an eligible todo, record progress or blockers, verify an implementation, submit it for human review, or release its own claim; also use when a human asks how to accept…

shengsheng90/DSH-taskboard · 88 tokens

causal-memory

Causal memory for agents — install/setup the causal-memory MCP server, then record decisions/outcomes and recall them before acting. Trigger when the user asks to install or set up causal-memory/agent memory, when causal-memory MCP tools are available and the agent faces a non-trivial decision (architecture, debugging…

JingxuanC/causal-memory · 88 tokens

handoff

A handoff document that summarizes the current conversation so another coding agent can continue the work. It is saved in the computer's temporary folder and includes suggested skills for the next agent.

gongyijie85/mattpocock-skills-dsh-zh · 28 tokens

handoff

Compact the current conversation into a handoff document for another agent to pick up.

gongyijie85/mattpocock-skills-dsh · 19 tokens

dsh-web-sdk-compatibility

Adapt and repair dsh-web after an approved official @deepseek-ai SDK/runtime cohort is selected or installed. Compare public API, type, service-injection, module-table, protocol, and behavior changes; map every change to repository consumers; implement the smallest fixes and durable compatibility contracts; handle…

zhu1090093659/dsh-web · 107 tokens

dsh-web-pet-developer

Create a pet for the dsh-pet plugin and integrate it into the dsh web GUI — author a v2 pet.json manifest plus an 8-column x 9-row atlas per the Codex/hatch-pet contract (live2d pets, voice packs and status decorations included), drop it into the pet-center user directory or contribute it as a built-in asset under…

zhu1090093659/dsh-web · 162 tokens