agentleFS
saemihemmasaemihemma/lead-producer-oss/.claude/skills/role-context-manager/SKILL.md

role-context-manager

Skill2 starsChanged 3 months agoMITView on GitHub

Context window management: persisting critical state, checkpointing, and preventing context degradation in long sessions. Trigger at ~60% context usage or before large tasks.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    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. Distinctive:

    Keep vs persist vs drop decisions for working memory

    line 22
  2. Distinctive:

    Keep live task, active files, preferences, next step in context.

    line 28
  3. Very specific:

    Write _context/SESSION_STATE.md with current task, decisions, active files, blockers, next steps.

    line 30
  4. Very specific:

    Write _context/HANDOFF.md only when another agent needs to resume.

    line 31
  5. Distinctive:

    If reference files are unavailable:

    line 43
  6. Distinctive:

    Context Degradation: When the model starts repeating itself, losing track of decisions, or contradicting earlier conclusions.

    line 44
  7. Distinctive:

    Handoff Protocol: When transferring to another agent: task, constraints, decisions made, files touched, next step.

    line 47
  8. Distinctive:

    Do not persist away live user constraints or current next step.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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 Manager

Use When

  • Context usage around 60% or higher
  • Long task about to generate noisy output
  • Multi-agent coordination needs durable handoff
  • Rereading same material due to context degradation

Do NOT Use When

  • Session is short and context is comfortable
  • Problem is missing external knowledge, not memory hygiene
  • Task is documentation authoring or product prioritization

What You Own

  • Smallest high-signal persistence before context collapse
  • _context/SESSION_STATE.md as recovery entry point
  • _context/HANDOFF.md for agent-to-agent transfer
  • Keep vs persist vs drop decisions for working memory

Reference Map

  • references/context-hygiene.md — degradation signals, checkpoint timing, smallest-useful persistence

Working Method

  1. Keep live task, active files, preferences, next step in context.
  2. Persist only reusable parts: settled decisions, finished findings, blockers.
  3. Write _context/SESSION_STATE.md with current task, decisions, active files, blockers, next steps.
  4. Write _context/HANDOFF.md only when another agent needs to resume.
  5. On recovery, read SESSION_STATE.md first, then referenced files.

Default Output

CONTEXT CHECKPOINT
==================
Persisted: session state, decisions/findings worth reusing, handoff if needed
Kept In Context: current task, active files, next step

Key Concepts (Inline Fallback)

If reference files are unavailable:

  • Context Degradation: When the model starts repeating itself, losing track of decisions, or contradicting earlier conclusions. Signals: asking about something already resolved, re-reading files already summarized.
  • Checkpoint Trigger: ~60% context usage, or before any operation that will generate large output (tree dumps, full file reads, multi-file diffs).
  • Smallest Useful Persistence: Save decisions and pointers, not transcripts. A 10-line SESSION_STATE.md that lets the next context rebuild > a 200-line dump that wastes budget.
  • Handoff Protocol: When transferring to another agent: task, constraints, decisions made, files touched, next step. Nothing else.
  • Recovery Priority: On context restore, read SESSION_STATE.md first. Only pull referenced files if actively needed for the next step.

Anti-Drift Rules

  • Persist conclusions and pointers, not full tool transcripts.
  • Do not persist away live user constraints or current next step.
  • _context/ is working-memory support, not documentation.

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.