agentleFS
martingarramonmartingarramon/claude-code-starter-kit/skills/context-management/SKILL.md

context-management

Skill4 starsChanged 9 months agoMITView on GitHub

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use verification and planning-with-files.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • OpenAISkill

    verification

    Full-story verification — infers what the user is building, then verifies the complete flow end-to-end: browser → API → data → response. Triggers on dev server start and 'why isn't this working' signals.

    Also in 3 projects that use this

  • MicrosoftSkill

    planning-with-files

    **USE THIS FOR COMPLEX TASKS.** Implements Manus-style file-based planning for multi-step tasks. Creates task_plan.md, findings.md, and progress.md in .agent_cache/<task-name>/. Use when: implementing multiple APIs, refactoring modules, research tasks, or ANY task requiring >5 tool calls.

    Also in 3 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 13

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before doing anything in a new session:

    line 15
  2. Very specific:

    Read memory/MEMORY.md for current state and priorities

    line 16
  3. Distinctive:

    Read CLAUDE.md for rules (this happens automatically)

    line 17
  4. Distinctive:

    Check if any files referenced in memory have changed

    line 18
  5. Distinctive:

    Don't read everything upfront.

    line 22
  6. Distinctive:

    Start with the files directly relevant to the current task

    line 23
  7. Distinctive:

    Read adjacent files only when you hit a reference or dependency

    line 24
  8. Distinctive:

    When context is bloating:

    line 36
  9. Distinctive:

    Write intermediate results to files instead of keeping them in conversation

    line 38
  10. Very specific:

    Use /compact if available to compress conversation history

    line 39
  11. Very specific:

    Update memory/MEMORY.md with new decisions and status

    line 44
  12. Distinctive:

    Remove stale entries that are no longer true

    line 45
  13. Distinctive:

    Add any new patterns learned to the Patterns section

    line 46
  14. Distinctive:

    Keep memory under 80 lines total

    line 47
  15. Distinctive:

    When in doubt about context freshness, re-read the file.

    line 58
  16. Distinctive:

    If a session exceeds 40 turns, summarize and compact before continuing.

    line 59

“Common” is measured: kept by at least 6 in 10 of the 11 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

Skill: Context Management

When to Use

Activate when working on long sessions, large codebases, or tasks that risk exceeding Claude's context window. Also use when starting a new session to efficiently load relevant context.

Core Principle

Context is a finite budget. Every token spent on stale context is a token unavailable for reasoning. Manage context deliberately, not passively.

Process

1. Session Start Protocol

Before doing anything in a new session:

  • Read memory/MEMORY.md for current state and priorities
  • Read CLAUDE.md for rules (this happens automatically)
  • Check if any files referenced in memory have changed
  • State what you know and what you need to learn before starting work

2. Progressive Context Loading

Don't read everything upfront. Load context as needed.

  • Start with the files directly relevant to the current task
  • Read adjacent files only when you hit a reference or dependency
  • For large files, read the section you need, not the whole file
  • Summarize what you've read to confirm understanding before proceeding

3. Context Bloat Detection

Watch for these signals that context is getting too large:

  • You've read more than 10 files this session
  • Responses are getting slower or less focused
  • You're re-reading files you read earlier
  • The conversation has been going for 30+ turns

4. Context Recovery Actions

When context is bloating:

  • Summarize progress so far in 5-10 lines
  • Write intermediate results to files instead of keeping them in conversation
  • Use /compact if available to compress conversation history
  • For parallel research, use subagents to isolate context

5. Memory Updates

At natural breakpoints (task complete, decision made, session ending):

  • Update memory/MEMORY.md with new decisions and status
  • Remove stale entries that are no longer true
  • Add any new patterns learned to the Patterns section
  • Keep memory under 80 lines total

Anti-Patterns

  • Front-loading everything: Reading 20 files before doing anything
  • Never updating memory: Treating memory as read-only
  • Ignoring bloat signals: Continuing a degraded session instead of compacting
  • Duplicate context: Re-reading files already in the conversation
  • Storing temporary state in memory: Debug notes and one-off observations don't belong

Rules

  • Memory is state, not a diary. Store facts, not narratives.
  • When in doubt about context freshness, re-read the file. Stale assumptions cause bugs.
  • If a session exceeds 40 turns, summarize and compact before continuing.

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.