Skip to content
Agentmart
Submit a tool

context-budget

How the context budget is spent and where it leaks.

Skill by TheyanzXD

IndexedMIT★ 9
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/theyanzxd-context-budget

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

How the context budget is spent and where it leaks.

Use cases: finance

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/context-budget

What's inside

Skill name
context-budget
Description
How the context budget is spent and where it leaks.
License
MIT
Instructions
41 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • name: "context-budget" does not match folder "context"

Files (1)

  • SKILL.md

SKILL.md (first lines)

The window is a budget. These are the rules that keep it cheap.

**Cached prefix.** The system message, runtime context, memory, and pinned
turns form a stable prefix the provider caches. Anything above the recent
turns should change as rarely as possible — one changed byte invalidates the
cache and rebills everything below it. This is why memory and skills are
spliced in as their own system messages instead of editing the base prompt.

**Compression.** `compressContext` protects the head and the tail and
summarizes the middle into one block marked `[summary]`. The summary replaces
the messages it covered, so the prefix above it stays byte-identical and the
cache still hits.

**Injection order, deepest to shallowest:**

```
soul.md              personality — changes rarely
runtime context      date, session, workspace — changes every turn
pinned turns         /pin — changes when the user pins
skills               only the SKILL.md files the turn matched
memory               durable facts, top-N by relevance
[summary]            the compressed middle
recent turns         what the model is working on
```

**Where tokens leak**
- A huge tool output in context. Cap it: `browser_read` truncates, `job_output`
  tails. Push large state to `scratchpad_write` and read back only the slice.
- History with no expiry. `SESSION_TTL_DAYS` deletes old turns; without it the
  prefix grows forever.
- Skills that never match. A skill injected when it is not needed costs every
  turn. `selectSkills` requires word overlap or a `when` pattern hit.
- Retyping instead of regenerating. The ↻ button and edit-detection reuse the
  stored prompt; a retype re-bills the whole prefix.

**Cost attribution.** `cost_report` breaks a turn down by model and by tool.
`/usage` shows the per-model 7-day total. When a turn is slow or expensive,
`trace_export` has the full call sequence with timings — that is where the
answer is.

From TheyanzXD/opencode-telegram-gateway, MIT.

Signals

Stars
9
Forks
0
Open issues
0
Last commit (this folder)
Sep 20, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from TheyanzXD

Cite this page

context-budget skill. Agent Mart. https://agentmart.dev/skills/theyanzxd-context-budget (last updated 2026-10-24)