durable-session-state

durable-session-state is a skill for Claude Code from ZaxbyHub/opencode-swarm. It costs 70 tokens per session (842 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.

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.

agentmods
npx agentmods add skills/zaxbyhub/opencode-swarm/durable-session-state
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.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.svg" alt="Measured on agentmods" 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 842 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00842
Opus 5 $0.00035 $0.00421
Sonnet 5 $0.00014 $0.00168
Haiku 4.5 $0.00007 $0.00084

Measured today against content hash 3d7dcfdb513c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, 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 today.

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 · 83 lines

How it starts

The opening of the file, as written. The whole thing — 83 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 · 83 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. today Changed 3d7dcfdb513c
  2. 6d 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 (464 stars, last pushed today), licensed MIT. It adds 70 tokens to every session and 842 once invoked, about $0.0003 per session on Opus 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

chronicle-skysight

Use when recent Linux desktop activity memory would help answer a question or when the user asks to inspect or control Chronicle or Skysight.

ilysenko/codex-desktop-linux · 33 tokens

context-engineering

项目级上下文工程框架:通过 PROJECT / REQUIREMENTS / ROADMAP / STATE 四层文档 为每个任务建立结构化上下文,控制 token 预算,防止上下文腐烂, 确保跨会话连续性。与 context-lifecycle 的 L0-L3 层互补。.

hashgraph-online/awesome-codex-plugins · 73 tokens

moai-foundation-context

Manages context window optimization, session state persistence, and token budget allocation for multi-agent workflows. Use for token budget management, context limits, or session handoff across agents.

modu-ai/moai-adk · 41 tokens

token-optimization

Use when the user says 'token optimization', 'save tokens', 'context window', 'reduce tokens', 'token stack', or 'TokenStack', or asks about extending context window capacity. Covers TokenStack, the built-in compression proxy that shrinks Claude Code tool output before it reaches the Anthropic API. Do NOT use for…

cwinvestments/memstack · 79 tokens

mnemos

Task-scoped memory lifecycle — typed MnemoGraph prevents lossy context compaction by treating facts/decisions/code-refs/handoffs as distinct node types with per-type eviction policies.

alinaqi/maggy · 40 tokens

ux-create-manifest

Create the initial Product UX Bible for an existing web or full-screen web app by deeply auditing the repository, using sub-agents when available, and generating docs/ux manifests, schemas, budgets, surface maps, action taxonomy, and design-token policies from observed code.

h0x91b/dev-3.0 · 58 tokens