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

context-mode

Skill1 starsChanged 5 months agoMITView on GitHub

Manage context windows efficiently — summarize, compress, and preserve critical information across sessions

7 other projects use 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. 0 are common, 5 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 5

    Distinctive

    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 cross-session observations

    line 59
  2. Distinctive:

    Search memory before re-exploring

    line 61
  3. Distinctive:

    Don't pass full conversation to every subagent

    line 68
  4. Distinctive:

    Rule of thumb: If you're reading it twice, summarize it once.

    line 89
  5. Distinctive:

    When context is tight:

    line 93
  6. Very specific:

    Write findings to notes.md or task progress

    line 95
  7. Distinctive:

    Start fresh session with focused prompt

    line 98

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “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 Mode

Optimize context usage. Keep what matters, compress what doesn't, preserve across sessions.

When to Use

  • Context window getting full
  • Starting a new session with prior work
  • Need to preserve decisions across checkpoints
  • Large codebase exploration consuming tokens

Context Management Strategies

1. Summarize Aggressively

Replace verbose output with concise summaries:

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

Bad:  Entire file content read
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

Organize context by relevance:

Critical (always keep):
- Current task goal
- Active blockers
- Key architectural decisions
- File paths of modified files

Important (summarize when needed):
- Prior conversation decisions
- Test results
- Code exploration findings

Ephemeral (drop when context 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 cross-session observations
  • Reference memory instead of re-deriving
  • Search memory before re-exploring

4. Parallel Context via Subagents

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

Checkpoint Discipline

At checkpoint time, ensure these are captured:

  1. What was accomplished (not what was attempted)
  2. Key decisions and their rationale
  3. Current state of modified files
  4. Blockers and how to resolve them
  5. Next action (specific, not vague)

Token Budget Awareness

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

Rule of thumb: If you're 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 context
Keeping verbose command outputNoisy, hard to parse
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.