agentleFS
David-Florian2013David-Florian2013/Stop-trusting-made-it-faster-here-is-5-best-skills-for-Claude-/skills/context-saver/SKILL.md

context-saver

Skill1 starsChanged 41 days agoMITView on GitHub

Cuts the tokens spent reading files and command output without losing anything the task needs. Use on any coding or repo task that involves reading source files longer than about 150 lines, running tests, builds, installs, git log or other commands that print more than about 60 lines, or searching a codebase. Shows only the needed part of a file (by function name, pattern or line range), shortens long command output while keeping every error, and prints the tokens saved at the end of the task. Use it proactively on every such task, even if the user never mentions tokens or limits.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. mhylle/claude-skills-collection★ 20same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If .claude/MAP.md exists, read it before exploring.

    line 15
  2. Very specific:

    Before editing, view the exact lines you will change with peek --lines, so the edit matches the file and not your memory of it.

    line 18
  3. Distinctive:

    Do not re-read what you have already seen unless the file changed.

    line 19
  4. Very specific:

    If lines were omitted and the answer could be among them, do not guess: CS peek <that file> --grep REGEX.

    line 25
  5. Very specific:

    Do not squeeze output the user asked to see, or search results (grep -r, find).

    line 26

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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

Context Saver

Tokens spent reading irrelevant text are unavailable for the task and count against the user's limit. Look at the smallest slice that is enough, and widen the moment it is not. A saving that produces a wrong answer is not a saving.

CS below means python3 <this skill's directory>/scripts/cs.py. It needs only Python 3.

Reading files

  1. If .claude/MAP.md exists, read it before exploring.
  2. File under about 150 lines: read it whole. Slicing a small file saves nothing.
  3. Larger file: run CS outline FILE (functions, classes or headings with line ranges), then CS peek FILE --symbol NAME. For text instead of a name use --grep REGEX (-i ignores case, --context N widens each match). For a known range use --lines A-B. If the output says the block end was not detected, widen with --lines.
  4. Before editing, view the exact lines you will change with peek --lines, so the edit matches the file and not your memory of it.
  5. Do not re-read what you have already seen unless the file changed.

Command output

First ask the command for less: git log --oneline -20, pytest -q. If it may still print more than about 60 lines (verbose tests, builds, installs, log files), use COMMAND 2>&1 | CS squeeze. It keeps the first and last lines, every line mentioning an error, failure, warning or non-zero exit with 2 lines around it, and collapses repeated lines. The last line names a file holding the complete output.

  • --keep REGEX also protects lines that matter for this task, such as a test name or an id.
  • If lines were omitted and the answer could be among them, do not guess: CS peek <that file> --grep REGEX.
  • Do not squeeze output the user asked to see, or search results (grep -r, find); narrow the search until the results are complete.

Never shorten

Error messages and stack traces, code you are about to change, anything the user asked to see verbatim.

Report

As the last step of the task run CS report --reset and print its line as the final line of your reply. If it prints nothing, print nothing. The figures are estimates (characters divided by 4) against reading every source in full.

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.