frugal-context
Skill1 starsChanged 4 months agoMITView on GitHub
Use this skill on any multi-file or exploratory task in a real codebase where reading, searching, or log/tool output would otherwise flood the context window. Triggers include: "look into", "trace", "debug across files", "why is X happening", long sessions, heavy MCP/tool use, or a task that starts with scanning "the whole project". It enforces minimal, targeted reads with a sufficiency check before acting, so token use drops without sacrificing correctness. Do NOT use for single-file localized edits you already know how to make, or when the user explicitly wants broad exploratory reading, debate, or alternatives.
In this repository6 other files it gives its agents.
- dependency-upgradeSkill
- flaky-test-fixerSkill
- incident-triageSkill
- root-cause-debuggerSkill
- run-receiptSkill
- session-handoffSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Search before reading whole files.
- Distinctive: line 38
Before any edit, state in one line whether you have enough context to be confident.
- Distinctive: line 43
Never proceed on a guess to save tokens — under-reading is a correctness bug, not a saving, and this gate always wins over frugality.
- Distinctive: line 47
No whole-project scans, no unfiltered logs, no large pastes into the prompt.
- Distinctive: line 50
Keep narration short — spend tokens on the work, not on describing it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Frugal Context
When this fires
The cheap failure is reading too much (context rot, cost); the expensive failure is reading too little (wrong answer). This skill manages that tradeoff.
Protocol
- Hypothesize first — name the 1-3 files/symbols most likely to matter, read those before anything else. Never open "the whole project" to start.
- Search before reading whole files. Grep/symbol-search, then read only the specific line ranges needed, not entire files.
- Filter at the door. Never let raw logs or verbose tool output enter
context — pipe through
scripts/filter_output.shto keep only failure/error signal, capped. - Offload heavy reading. If a step needs bulk file reading, delegate it to a subagent so the noise stays in the child context and only the summary returns.
- Path, don't paste. Large content goes to a temp file read by path, not reprocessed on every later turn.
Sufficiency gate (do not skip)
Before any edit, state in one line whether you have enough context to be confident.
- Yes: act.
- No: do exactly ONE targeted read of the specific missing thing, then re-check. Never proceed on a guess to save tokens — under-reading is a correctness bug, not a saving, and this gate always wins over frugality.
Hard rules
- No whole-project scans, no unfiltered logs, no large pastes into the prompt.
- The sufficiency gate overrides every frugality rule above it.
- Keep narration short — spend tokens on the work, not on describing it.
Output
Proceed with the task normally. When a broad read is skipped, note it in one short line (e.g. "read auth/session.py:40-88 only; sufficient") so the shortcut is auditable.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

