agentleFS
daryaKutodaryaKuto/claude-skills/skills/trim-context/SKILL.md

trim-context

Skill0 starsChanged 16 days agoMITView on GitHub

Use when a transcript, tool-call history, or set of notes has grown too large to keep in full and needs to be cut down before continuing, handing off to another agent, or writing a digest, especially when an exact file path, error message, command, or constraint inside it must not be lost to a paraphrase.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    When content is too large to keep whole, decide per unit whether to keep it verbatim, truncate it with a note, or drop it, instead of …

    line 10
  2. Distinctive:

    Do NOT use: when the content already fits, or the goal is genuine re-explanation for a fresh human reader (a report, a README): that needs …

    line 23
  3. Distinctive:

    Stop condition: stop degrading the moment it fits, even with stages left.

    line 37

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

Trim context

Overview

When content is too large to keep whole, decide per unit whether to keep it verbatim, truncate it with a note, or drop it, instead of asking a model to paraphrase everything into a summary. A summary can silently lose the one exact detail that mattered; a keep, truncate or drop decision never rewrites what it keeps.

When to use

  • Compacting your own working context or a long tool-call history.
  • Writing a handoff document for another agent or a later session.
  • Building a research digest that must stay faithful to its sources.
  • Any time "cut this down" would otherwise mean "summarize this."

Do NOT use when the content already fits, or the goal is genuine re-explanation for a fresh human reader (a report, a README): that needs real prose, not unit-by-unit pruning.

The pattern

  1. Pin what must not move: the task or goal, the newest N turns, anything already referenced ahead. Leave these untouched.
  2. Judge each remaining unit alone (one tool call, log entry, or paragraph): matters as-is, matters only as a fact, or now dead weight.
  3. Degrade in stages, cheapest first, stop once it fits: truncate plus a one-line note beats paraphrasing; collapsing a run of low-value units into one placeholder line beats deleting them silently; only drop a unit once truncation alone did not fit. Re-measure after each stage.
  4. Stop condition: stop degrading the moment it fits, even with stages left. If it still does not fit after the last stage, say so instead of quietly paraphrasing what remains.

Quick reference

StageWhat happensWhen
Keep verbatimNo changePinned, or still fully needed
Truncate + noteKeep first N chars, note what was cutPartly needed, or reproducible
Collapse a runSeveral low-value units become one lineOld units, none matter alone
DropRemoved entirelyConfirmed not needed, even as a fact
ParaphraseNever, for kept contentN/A

Common mistakes

  • Summarizing everything uniformly instead of judging each unit on its own, smoothing away the one detail that mattered.
  • Truncating without a note of what was cut and roughly how much, so a later reader cannot tell there was ever more.
  • Dropping one half of a paired call and result (or a question and its answer), leaving the other orphaned.
  • Re-trying a degrade stage that already proved insufficient instead of moving to the next one and re-measuring.

Source

  • Repo: https://github.com/tamaratran/fast-jev-compaction, commit e3f262a7f4d42bd8dd32ced30d26176f7cb545b0.
  • License: MIT.
  • File read: README.md ("What and why", "How it works").
  • Adapted: the per-unit keep/truncate/drop decision with staged, cheapest-first degradation, generalized past the source project's Claude Code compaction plugin to any oversized transcript, handoff note, or digest. Written independently; no wording or code copied from the source.

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.