agentleFS
pinexaipinexai/claude-code-skills/frugal-context/SKILL.md

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.

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
  1. Distinctive:

    Search before reading whole files.

    line 26
  2. Distinctive:

    Before any edit, state in one line whether you have enough context to be confident.

    line 38
  3. Distinctive:

    Never proceed on a guess to save tokens — under-reading is a correctness bug, not a saving, and this gate always wins over frugality.

    line 43
  4. Distinctive:

    No whole-project scans, no unfiltered logs, no large pastes into the prompt.

    line 47
  5. Distinctive:

    Keep narration short — spend tokens on the work, not on describing it.

    line 50

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Hypothesize first — name the 1-3 files/symbols most likely to matter, read those before anything else. Never open "the whole project" to start.
  2. Search before reading whole files. Grep/symbol-search, then read only the specific line ranges needed, not entire files.
  3. Filter at the door. Never let raw logs or verbose tool output enter context — pipe through scripts/filter_output.sh to keep only failure/error signal, capped.
  4. 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.
  5. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.