Agent skill

Durable Session State

by ZaxbyHub in ZaxbyHub/opencode-swarm

Keeps plans, decisions, evidence and reviewer verdicts in small files so long multi-phase tasks survive context compaction and session resumes.

MITAuto-check passedAgent Workflows

Install Durable Session State

skills CLI
$ npx skills add ZaxbyHub/opencode-swarm --skill durable-session-state -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ZaxbyHub/opencode-swarm durable-session-state --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/durable-session-state .claude/skills/durable-session-state && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
durable-session-state
GitHub stars
496
Token cost
~896 tokens
SKILL.md length
422 words
Files
1
Skills in repo
91
Repo updated
First seen
Licence
MIT

At a glance

Keeps plans, decisions, evidence and reviewer verdicts in small files so long multi-phase tasks survive context compaction and session resumes.

  • Works in 4 steps: plan.md — task scope, success criteria,… → decisions.md — one line per settled… → evidence.md — validation commands run… → …
  • Running a long or multi-phase task that may hit context compaction
  • SKILL.md covers Where artifacts live, What to persist, When to write and Resume protocol, plus 1 more section
  • Calls git

What it does

Long swarm-mode sessions can outgrow the context window, and a compacted summary tends to lose what the approval gates depend on, such as which diff a reviewer signed off. The skill has the agent treat the conversation as a cache and keep real state in files under .claude/session/tasks/, in a folder named after the task. Four short files are updated in place: plan.md, decisions.md, evidence.md and gates.md, the last being a ledger of reviewer and critic verdicts. They count as working state, so they stay out of commits unless you ask.

Writing happens at phase boundaries, before a turn ends while background subagents are running, and ahead of compaction once the conversation gets long. On resume the agent re-reads the task files first, does not reopen settled decisions without new evidence or a request from you, and checks whether a recorded approval has gone stale against the current git HEAD and working-tree diff. The excerpt is cut off partway through that staleness check.

When your agent uses it

  • Running a long or multi-phase task that may hit context compaction
  • Recording reviewer or critic approval verdicts during a swarm-mode task
  • Resuming work after compaction, a session restart or a handoff

Example prompts

  • “Start tracking this migration in session files so we can resume it after compaction.”
  • “The reviewer just approved the diff. Record that in the gates ledger.”
  • “Pick up where the last session stopped, and re-read the task files before doing anything.”

Requirements

  • A git repository

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. plan.md — task scope, success criteria, files in scope, what must not
  2. decisions.md — one line per settled decision with a one-line rationale
  3. evidence.md — validation commands run and their outcomes (pass/fail plus
  4. gates.md — the approval ledger. One entry per reviewer/critic verdict

What it can do on your machine

Read from SKILL.md and the folder at commit a69d1a9. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Durable Session State loads about 896 tokens when it runs. Until then it costs about 88 tokens; SKILL.md has 422 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~896

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ZaxbyHub/opencode-swarm at commit a69d1a9, republished under its MIT licence (© ZaxbyHub). 422 words, ~896 tokens.

Download SKILL.mdSave it as .claude/skills/durable-session-state/SKILL.md (or your agent's skills folder).
name
durable-session-state
description
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.
audience
swarm-plugin

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 status and exclude them explicitly.

What to persist

Keep it to four small files per task; update in place:

  1. plan.md — task scope, success criteria, files in scope, what must not break. Update when scope changes; never fork a second plan file.

  2. 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.

  3. evidence.md — validation commands run and their outcomes (pass/fail plus the load-bearing output lines, not full logs).

  4. 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>
Show full SKILL.md (191 more words)Show less

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:

  1. Re-read the task's artifacts. They are authoritative over your memory of the conversation.
  2. Do not re-litigate decisions.md entries or redo work evidence.md already proves, absent new evidence or a user request.
  3. 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 is invalid — re-run the affected reviewer/critic gate on the current diff.
  4. 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.

© ZaxbyHub, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/durable-session-state of ZaxbyHub/opencode-swarm.

Open the folder on GitHubat commit a69d1a9

Compare with similar skills

Durable Session State next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Durable Session State compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Durable Session State this skillZaxbyHub/opencode-swarm496—~896Automated safety check: PassMIT
Harness Engineering10xChengTu/harness-engineering1021 repos~1kAutomated safety check: PassNone
Memori Long-Term MemoryMemoriLabs/Memori17k—~2kAutomated safety check: NotesCustom licence
Planning with FilesOthmanAdi/planning-with-files27k—~2.9kAutomated safety check: PassMIT
User Thoughts Memorysickn33/agentic-awesome-skills47k1 repos~2.5kAutomated safety check: PassMIT
Planning With FilesOthmanAdi/planning-with-files27k—~3kAutomated safety check: PassMIT

Similar skills

  • Harness Engineering

    10xChengTu/harness-engineering

    Set up and improve harness engineering (AGENTS.md, docs/, lint rules, eval systems, project-level prompt engineering) for AI-agent-friendly codebases.

    102 GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check: notes
  • Planning with Files

    OthmanAdi/planning-with-files

    Keeps a task plan, findings and progress log in markdown files on disk so long agent tasks survive context resets, with Gemini hooks and helper scripts.

    27k GitHub stars~2.9k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • User Thoughts Memory

    sickn33/agentic-awesome-skills

    Saves a user's project decisions, rules and preferences into a project-local mdbase so later sessions and other agents can recover the intent.

    47k GitHub starsUsed in 1 repo~2.5k tokens
    Agent WorkflowsAuto-check passed
  • Planning With Files

    OthmanAdi/planning-with-files

    Keeps a task plan, findings and progress log as Markdown files in the project so long multi-step agent work survives context resets.

    27k GitHub stars~3k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Planning with Files for Kiro

    OthmanAdi/planning-with-files

    Keeps task_plan.md, findings.md and progress.md on disk as the agent's working memory for multi-step work, wired into Kiro steering, with no hooks.

    27k GitHub stars~2.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed

More from ZaxbyHub/opencode-swarm

All 91 skills in this repo
  • Codebase Review Swarm

    ZaxbyHub/opencode-swarm

    Runs an evidence-gated, quote-grounded audit of a codebase for security, QA, accessibility, performance and more, and writes a verified report without changing source files.

    496 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Issue Tracer

    ZaxbyHub/opencode-swarm

    Drives a bug report from validation and root-cause tracing through a critic-reviewed plan, an approved minimal fix and a PR-ready closure, never merging without recorded human approval.

    496 GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Commit and PR Publishing for Codex

    ZaxbyHub/opencode-swarm

    Codex adapter for opencode-swarm that governs commits, pushes, draft PRs, PR body updates and CI closeout, deferring to the repo's canonical commit-pr protocol.

    496 GitHub stars~1.6k tokensUpdated today
    Auto-check passed
  • Swarm PR Feedback Closer

    ZaxbyHub/opencode-swarm

    Ingests existing pull request feedback such as review comments and CI failures, verifies each claim, fixes confirmed issues and reports closure status for every item.

    496 GitHub stars~14k tokensUpdated today
    Auto-check passed
  • Swarm PR Subscribe

    ZaxbyHub/opencode-swarm

    Monitor a pull request after creation and act autonomously on pushed PR activity.

    496 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Bundle Safety

    ZaxbyHub/opencode-swarm

    Bundle transform safety — minification variant selection, consumer-constraint verification, identifier preservation, and namespace re-export coverage for build output.

    496 GitHub stars~2.3k tokensUpdated today
    Auto-check passed

Categories

Questions about Durable Session State

What does Durable Session State do?

Keeps plans, decisions, evidence and reviewer verdicts in small files so long multi-phase tasks survive context compaction and session resumes. Long swarm-mode sessions can outgrow the context window, and a compacted summary tends to lose what the approval gates depend on, such as which diff a reviewer signed off.claude/session/tasks/, in a folder named after the task.

When should I use Durable Session State?

Durable Session State fits situations like: running a long or multi-phase task that may hit context compaction; recording reviewer or critic approval verdicts during a swarm-mode task; resuming work after compaction, a session restart or a handoff.

How do I install Durable Session State in Claude Code?

Run `npx skills add ZaxbyHub/opencode-swarm --skill durable-session-state -a claude-code`. Or copy the skill folder (.claude/skills/durable-session-state in ZaxbyHub/opencode-swarm) into .claude/skills/durable-session-state in your project. Claude Code loads it when a task matches its description.

How do I install Durable Session State in Codex?

Run `npx skills add ZaxbyHub/opencode-swarm --skill durable-session-state -a codex`. Or copy the skill folder (.claude/skills/durable-session-state in ZaxbyHub/opencode-swarm) into .agents/skills/durable-session-state in your project. Codex loads it when a task matches its description.

Can I use Durable Session State in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ZaxbyHub/opencode-swarm --skill durable-session-state -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/durable-session-state, .gemini/skills/durable-session-state, .github/skills/durable-session-state and .opencode/skills/durable-session-state in your project.

What does Durable Session State need to run?

Going by SKILL.md and its folder, Durable Session State needs the command-line tools its instructions call (git). Our summary lists: A git repository.

Does Durable Session State access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Durable Session State safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Durable Session State use?

Durable Session State is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Durable Session State use?

About 896 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Durable Session State?

Skills that share tags, products or a category with Durable Session State: Harness Engineering (10xChengTu/harness-engineering, 102 stars), Memori Long-Term Memory (MemoriLabs/Memori, 17k stars), Planning with Files (OthmanAdi/planning-with-files, 27k stars) and User Thoughts Memory (sickn33/agentic-awesome-skills, 47k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Durable Session State?

ZaxbyHub (a GitHub organization) maintains it in ZaxbyHub/opencode-swarm, which has 496 GitHub stars. The repository holds 91 skills in this directory. The repository was last updated on October 11, 2026.

Source: ZaxbyHub/opencode-swarm on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.