agentleFS
kazemcodeskazemcodes/skill-tree/skills/context-compress/SKILL.md

context-compress

Skill1 starsChanged 5 months agoMITView on GitHub

Compress and optimize context usage — summarize verbose outputs, layer information by relevance, preserve critical facts across sessions

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

7 rules. About 0 are common, 5 are distinctive, and 2 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.

  • 2

    Very specific

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

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

    Use notes.md for session observations

    line 55
  2. Distinctive:

    Search memory before re-exploring

    line 57
  3. Distinctive:

    Don't pass full conversation to every subagent

    line 64
  4. Distinctive:

    Rule: If reading it twice, summarize it once.

    line 75
  5. Distinctive:

    When context is tight:

    line 79
  6. Very specific:

    Write findings to notes.md or task progress

    line 81
  7. Distinctive:

    Start fresh session with focused prompt

    line 84

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

Context Compress

Maximize signal, minimize noise in context windows.

When to Use

  • Context window approaching limits
  • Starting session with prior work
  • Large codebase exploration consuming tokens
  • Need to preserve decisions across checkpoints

Strategies

1. Summarize Aggressively

Bad:  Full stack trace (50 lines)
Good: "TypeError at src/api.ts:42 — missing null check on response.data.user"

Bad:  Entire file read (500 lines)
Good: "File has 200 lines, key function at line 85-120, uses X pattern"

Bad:  Running every test individually
Good: "All 47 tests pass, coverage at 82%"

2. Layer Information

Critical (always keep):
  - Current task goal
  - Active blockers
  - Key architectural decisions
  - Modified file paths

Important (summarize when needed):
  - Prior decisions and rationale
  - Test results
  - Exploration findings

Ephemeral (drop when tight):
  - Full file contents (re-read on demand)
  - Verbose command output
  - Intermediate search results

3. Use Memory System

  • Store durable facts in MEMORY.md
  • Use notes.md for session observations
  • Reference memory instead of re-deriving
  • Search memory before re-exploring

4. Parallel Context via Subagents

  • Spawn subagents for heavy exploration
  • Each gets clean context
  • Synthesize findings, not raw output
  • Don't pass full conversation to every subagent

Token Budget

ContentCost
Full file (500 lines)~2000 tokens
Command output (100 lines)~400 tokens
Subagent prompt~500 tokens
Checkpoint summary~800 tokens

Rule: If reading it twice, summarize it once.

Session Handoff

When context is tight:

  1. Write findings to notes.md or task progress
  2. Summarize what's done and what's next
  3. Reference specific file paths and line numbers
  4. Start fresh session with focused prompt

Anti-Patterns

PatternProblem
Reading full files unnecessarilyBurns tokens
Re-deriving from memoryWastes context
Passing full conversation to subagentsRedundant
Keeping verbose outputNoisy
Not summarizing at checkpointsLoses critical info

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.