durable-session-state

durable-session-state is a skill for Claude Code from ZaxbyHub/opencode-swarm. It costs 70 tokens per session (844 once invoked), scanned A, original, MIT.

A method for saving plans, decisions, evidence, and review results to durable task files during long coding-agent sessions. These files preserve working state when the conversation is shortened or resumed.

In plain words
What is it for?
Use it for long or multi-phase tasks, especially swarm workflows, approval gates, implementation reviews, and resumed sessions.
Why use it?
It prevents important decisions and approvals from being lost during context changes or handoffs.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions subagents; mentions Claude Code; mentions OpenCode.

Good fit Use it for long or multi-phase tasks, especially swarm workflows, approval gates, implementation reviews, and resumed sessions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/durable-session-state
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ZaxbyHub/opencode-swarm --skill durable-session-state
Clone the repo
git clone --depth 1 https://github.com/ZaxbyHub/opencode-swarm

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for durable-session-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/durable-session-state/github.svg)](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/durable-session-state)
Your own site
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/durable-session-state"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/durable-session-state/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for durable-session-state

Your own site · 80×15
<a href="https://agentmods.dev/skills/zaxbyhub/opencode-swarm/durable-session-state"><img src="https://agentmods.dev/badge/skills/zaxbyhub/opencode-swarm/durable-session-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 844 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Rogue Agent · line 18
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00070 $0.00844
Opus 5.5 $0.00028 $0.00338
Sonnet 5.5 $0.00014 $0.00169
Haiku 4.5 $0.00007 $0.00084

Measured 7d ago against content hash 7a30dbd4f5c4, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

durable-session-state scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/durable-session-state/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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>
    

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.

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago Changed · +1 lines 7a30dbd4f5c4
  2. 1mo ago Changed 3d7dcfdb513c
  3. 1mo ago First seen · 83 lines · 70 tokens per session scan A 63515caeabe2

Subscribe to this mod's changes

durable-session-state is a skill published in the GitHub repository ZaxbyHub/opencode-swarm (509 stars, last pushed today), licensed MIT. It adds 70 tokens to every session and 844 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

context-engineering

Use when designing, reviewing, or debugging how an agent's context window gets filled, pruned, or shared — choosing what loads at boot versus on demand, sizing an install or an always-loaded file, fixing an agent that drifts, repeats itself, or forgets constraints mid-task, planning compaction or summarization…

mvschwarz/openrig · 142 tokens

claude-compaction-restore

Use when a Claude Code session is about to compact, has just compacted, reached its context limit, resumed after /compact, or must rebuild its working picture of a long-running seat from its own restore map, its JSONL transcript and the files it touched.

mvschwarz/openrig · 60 tokens

retiring-and-inheriting-a-seat

Use when you are a sitting agent near your context threshold (85%) and a PLANNED seat transition is due — retire deliberately and hand your seat to a fresh successor primed from a packet, rather than let compaction degrade you. Covers the handover packet, the append-only lineage ledger (one row per tenure)…

mvschwarz/openrig · 145 tokens

session-compaction-and-restore

Use when reasoning about what survives compaction/context-loss/restart/seat-refresh, designing a high-fidelity restore packet, or distinguishing native runtime resume vs fork vs artifact-backed mental-model rebuild. Covers the 4 failure modes that prevent honest restore (compacted seat drops hot potato; restore packet…

mvschwarz/openrig · 88 tokens

continuous-learning

Use when a mistake, correction, or surprise taught the workspace something that must stick — a retro or postmortem, the same agent error corrected twice, a resolved bug's root cause, scattered notes-to-self — and route that lesson to the durable surface that fires next time. NOT a forward choice with alternatives…

ericrisco/rsc-harness · 73 tokens

atomic-wiki

Conversational wiki and capture-bucket routing. Fires when the user wants a place, space, or folder for notes, research, tickets, raw dumps, or knowledge capture — checks the block in /.claude/CLAUDE.md; if the cwd is under a registered realm, creates the folder as a bucket via atomic wiki bucket add rather than a…

damusix/atomic-claude · 204 tokens