agentleFS
LucaDominiciLucaDominici/arbiter/.claude/skills/context-rot-management/SKILL.md

context-rot-management

Skill0 starsChanged 57 days agoApache-2.0View on GitHub

Use during Standard-tier tasks with more than 5 implementation units, or when the context window is approaching compaction, or when resuming after /clear or an auto-compaction. A 3-layer durable-redundancy protocol (BACKLOG snapshot + task cursor + git log) that makes context loss a non-event with zero single point of failure. NOT auto-activated for small Standard tasks — a 1M-context model handles those natively.

  • Commits and pushes

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

    When the activation condition is met, immediately after GO (before the first implementation unit):

    line 61
  2. Very specific:

    Create .arbiter/evidence/<task-id>/BACKLOG.md from the template below.

    line 63
  3. Distinctive:

    Add the first phase section (files listed, not yet started).

    line 65
  4. Distinctive:

    Run all three at every phase boundary (finishing phase N, starting N+1):

    line 109
  5. Very specific:

    No manual cleanup. The BACKLOG stays under .arbiter/evidence/<task-id>/ (retained per the evidence-class policy).

    line 130
  6. Distinctive:

    Write decisions only in commit messages — not recoverable from task state.

    line 139
  7. Distinctive:

    Use the BACKLOG as a to-do list — it is a state snapshot, not a backlog.

    line 140

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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-Rot Management (3-layer durable redundancy)

Authority: Proven on a long multi-phase task (100+ specs, 5 phases, one mid-task compaction, zero re-work). Trigger: Deterministic heuristic (see When this applies). Enforcement: MANDATORY once activated — skipping a checkpoint requires an explicit human override.

Context compaction destroys in-memory state. This skill keeps three independent durable records of the task, any one of which can fully recover it. CLI-first by design (ADR-020): the checkpoint layer is arbiter lifecycle checkpoint, not an MCP call, so it works in any governed project with no MCP dependency.


When this applies

Activation condition:

Tier = Standard  AND  (implementation_units > 5  OR  user requests explicitly)

A 1M-context model handles compaction for most Standard tasks natively, so auto-activating every task only adds BACKLOG overhead with no benefit when units are few.

Evaluated at: end of the /ship plan phase, after GO, once the implementation-unit count is known.

ScenarioTierUnitsResult
AStandard> 5ACTIVATE
BStandard≤ 5SKIP — small task, handled natively
CStandardanyACTIVATE on explicit user request
DSanySKIP — tier below Standard
EXSanySKIP — tier below Standard

The 3 layers

LayerArtifactSurvivesHow to access
1. BACKLOG.arbiter/evidence/<task-id>/BACKLOG.mdgit pushRead tool
2. Task cursorarbiter lifecycle checkpoint (last / next / digest in task state)/clear, recomputearbiter lifecycle get
3. Git logphase-boundary commitsgit historygit log --oneline

Any single layer failing → the other two still recover the task. Zero single point of failure. (pre-compact.mjs additionally re-grounds the model immediately after a compaction by printing branch / task / phase to stdout.)


Initialization

When the activation condition is met, immediately after GO (before the first implementation unit):

  1. Create .arbiter/evidence/<task-id>/BACKLOG.md from the template below.
  2. Populate the header from the plan's Context Block.
  3. Add the first phase section (files listed, not yet started).

<task-id> is the sanitized issue id (e.g. 1440), matching the arbiter evidence convention.

BACKLOG.md template

# Task BACKLOG — #<ISSUE> <title>

**Branch:** task/#<ISSUE>-<slug>
**Tier:** Standard
**Activated:** context-rot-management (units > 5)
**Last updated:** <date>

---

## Phase <N>/<M> — <phase-name>

**Status:** [IN PROGRESS | DONE | BLOCKED]

### Files done (<count>/<total>)

- `path/to/file.ext` — <one-line summary>

### Files remaining (<count>)

- `path/to/file.ext` — <what remains>

### Decisions

- **<decision>:** <what> — Why: <rationale> — Ref: <INV-NN / ADR-NNN / file:line>

### Issues

- [OPEN] <blocker or risk>
- [RESOLVED] <past blocker — kept for recovery context>

Append a new section per phase. Never delete old phase sections — they are the recovery context.


Phase-transition checklist

Run all three at every phase boundary (finishing phase N, starting N+1):

  1. Update BACKLOG — add the new phase section (status of the completed phase, files done/remaining, decisions, issues).
  2. Pin the cursor — arbiter lifecycle checkpoint --last "<what was just done>" --next "<exact next action>" --digest "<one line>". This is the searchable, CLI-native checkpoint; it survives /clear.
  3. Commit — one logical unit per the exec-protocol commit strategy; the message names the phase completed and what's next.

Recovery after compaction

Execute in order; stop once state is fully recovered.

  1. Read .arbiter/evidence/<task-id>/BACKLOG.md — current phase, files done/remaining, open decisions, open issues.
  2. Read the cursor — arbiter lifecycle get (last / next / digest pinned by arbiter lifecycle checkpoint); recovers any decision not yet written to BACKLOG.
  3. Verify against git — git log --oneline; confirm phase commits are present and resolve any discrepancy with the BACKLOG.
  4. Resume — continue from the last checkpoint. Re-read only the files listed under "remaining". Do NOT re-read the generic SSOT docs (AGENTS.md, ADRs) unless a specific invariant is in question — that is context bloat, not recovery.

Cleanup

No manual cleanup. The BACKLOG stays under .arbiter/evidence/<task-id>/ (retained per the evidence-class policy); the cursor lives in task state; commits are permanent.


Anti-patterns

Never:

  • Skip a phase checkpoint ("I'll do it at the end") — defeats the purpose; checkpoints must survive a mid-task compaction.
  • Write decisions only in commit messages — not recoverable from task state.
  • Use the BACKLOG as a to-do list — it is a state snapshot, not a backlog.
  • Overwrite an old phase section — append only; old sections are recovery context.
  • Re-read the full SSOT set on resume — re-read only "remaining" files.

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.