durable-session-state
Skill517 starsChanged 3 days agoMITView on GitHub
Persist plans, scope decisions, evidence, and reviewer/critic verdicts to durable files during long or multi-phase tasks so work survives context compaction, session resumes, and handoffs. Use for swarm-mode tasks, before context grows large, when recording approval gates, and when resuming after compaction or a session restart.
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
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
- Very specific: line 27
Never write task artifacts to the repo root, and never under .swarm/ — that directory is the OpenCode plugin's runtime state, not Claude …
- Distinctive: line 35
Keep it to four small files per task.
- Distinctive: line 58
Before ending a turn while background subagents are running.
- Very specific: line 69
Do not re-litigate decisions.md entries or redo work evidence.md already proves, absent new evidence or a user request.
- Very specific: line 71
Check gate staleness: if git rev-parse HEAD or the working-tree diff no longer matches the latest APPROVE entry in gates.md, that approval …
- Distinctive: line 74
If artifacts and the summarized conversation disagree, trust the artifacts and say so.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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.
Files
Durable Session State
Long swarm-mode sessions outlive their context window. Compaction summarizes history, and summaries lose exactly the things the swarm gates depend on: which diff a reviewer approved, what evidence was recorded, which decisions are settled. Without durable artifacts, a resumed session re-litigates settled decisions or — worse — treats a stale approval as current. Persist state to files as you go; treat the conversation as cache, not storage.
Where artifacts live
- Generic swarm tasks:
.claude/session/tasks/<task-slug>/in the project. - Issue-tracer work:
.agents/issue-traces/<issue-slug>/(that skill's own schema —08b-implementation-review.md,09-final-critic.md— wins for its work). - Never write task artifacts to the repo root, and never under
.swarm/— that directory is the OpenCode plugin's runtime state, not Claude Code's. - These artifacts are working state, not deliverables: do not commit them
unless the user asks. Before committing, check
git statusand exclude them explicitly.
What to persist
Keep it to four small files per task; update in place:
plan.md— task scope, success criteria, files in scope, what must not break. Update when scope changes; never fork a second plan file.decisions.md— one line per settled decision with a one-line rationale ("chose X over Y because Z"). Settled means: do not reopen without new evidence or a user request.evidence.md— validation commands run and their outcomes (pass/fail plus the load-bearing output lines, not full logs).gates.md— the approval ledger. One entry per reviewer/critic verdict:## <gate> — <APPROVE|NEEDS_REVISION|BLOCKED> when: <ISO timestamp or turn marker> head: <git rev-parse HEAD> diff: <git diff --stat summary> items: <blocking items, or none>
When to write
- At phase boundaries (scope settled, plan built, implementation done, each gate verdict received).
- Before ending a turn while background subagents are running.
- Whenever you notice the conversation is long — write ahead of compaction, not after it.
Resume protocol
On resuming (after compaction, a restart, or a handoff), before doing new work:
- Re-read the task's artifacts. They are authoritative over your memory of the conversation.
- Do not re-litigate
decisions.mdentries or redo workevidence.mdalready proves, absent new evidence or a user request. - Check gate staleness: if
git rev-parse HEADor the working-tree diff no longer matches the latest APPROVE entry ingates.md, that approval is invalid — re-run the affected reviewer/critic gate on the current diff. - If artifacts and the summarized conversation disagree, trust the artifacts and say so.
Relationship to swarm gates
The swarm-mode contract invalidates any approval issued before the latest
edit. The gates.md ledger is what makes that rule checkable instead of
vibes: record the HEAD and diff summary at approval time, compare on resume
and before final synthesis. If you cannot demonstrate approval-after-last-edit
from the ledger, the gate is not satisfied.
Other versions1 project uses a version of this.
Word for word · 1
- zaxbysauce/opencode-swarm★ 517100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ci-fix-monitorSkill
- codebase-review-swarmSkill
- commit-prSkill
- contributingSkill
- engineering-conventionsSkill
- fork-pr-operationsSkill
- guardrail-patternsSkill
- issue-tracerSkill
- mock-to-internals-migrationSkill
- pr-review-fixSkill
- qa-sweepSkill
- research-firstSkill
- running-testsSkill
- subprocess-safetySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarmSkill
- tech-debt-ci-reviewSkill
- test-file-splitSkill
- unswarmSkill
- writing-testsSkill
- brainstormSkill
- clarifySkill
- clarify-specSkill
- codebase-review-swarmSkill
- commit-prSkill
- consultSkill
- councilSkill
- critic-gateSkill
- deep-diveSkill
- deep-researchSkill
- design-docsSkill
- discoverSkill
- editing-skillsSkill
- engineering-conventionsSkill
- executeSkill
- fork-pr-operationsSkill
- graphifySkill
- issue-ingestSkill
- issue-tracerSkill
- orchestrating-subagentsSkill
- phase-wrapSkill
- pre-phase-briefingSkill
- qa-sweepSkill
- research-firstSkill
- rust-crate-ciSkill
- specifySkill
- swarm-ci-monitorSkill
- swarm-implementSkill
- swarm-planSkill
- swarm-pr-feedbackSkill
- swarm-pr-reviewSkill
- swarm-pr-subscribeSkill
- swarm-resumeSkill
- The first 60 shown.
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
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.

