agentleFS
darrenCWJdarrenCWJ/agent-skills-scaffold/.claude/skills/context-management/SKILL.md

context-management

Skill0 starsChanged 3 months agoMITView on GitHub

Keep the context window lean and survive compaction without losing the thread. Use when a session runs long, when many large files or logs have been loaded, before fanning out major work, when you catch yourself re-reading or re-deriving established facts, or when compaction looms — write state down BEFORE it is lost, not after.

14 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

1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Never let the FIRST handover of a long session be the one written at 95% context — by then the details worth handing over are already gone.

    line 38

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

Context is a budget, not a given. Everything held only in conversation is one compaction away from gone; everything written to artifacts survives. Manage accordingly.

Keep it lean (during work)

  • Don't load what a subagent can read for you. Bulk file reading, broad searches, long logs → fan out (fan-out skill) and keep only the conclusions.
  • Read narrowly. The section, not the file; the diff, not the repo; the failing test's output, not the whole run.
  • Don't re-read to "confirm". A file you just edited is in the state the tool result reported.
  • Summarize as you go. Long tool output becomes one line in the plan ledger or task list; the artifact remembers so the context doesn't have to.

Warning signs (act when you see them)

  • Re-deriving facts already established this session, or re-opening files already read.
  • Raw dumps sitting in context where a one-line conclusion would do.
  • Starting a large new phase while carrying a finished phase's debris.
  • The session is long AND the newest handover is stale — the gap between reality and paper is the amount you lose on compaction.

Before compaction (or any risk of context loss)

  1. Handover NOW (handover skill) — zero-context resumability is the standard.
  2. Flush memory writes (memory skill) — preferences, failures, and decisions still only in conversation get files immediately.
  3. Sync the paper trail — plan ledger current, task list statuses true, roadmap honest.

After compaction / on resume

Re-orient (orient skill): memory index → newest handover → roadmap → verify claimed state against reality. Trust the artifacts over the summary's confidence — summaries compress, artifacts don't.

Rules

  • State written to artifacts beats state held in context, always.
  • A phase boundary is the natural shedding point: ledger updated, memory written, then move on light.
  • Never let the FIRST handover of a long session be the one written at 95% context — by then the details worth handing over are already gone.

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.