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.
npx agentmods add skills/zaxbyhub/opencode-swarm/durable-session-statenpx skills add ZaxbyHub/opencode-swarm --skill durable-session-stategit clone --depth 1 https://github.com/ZaxbyHub/opencode-swarmWrote 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.
[](https://agentmods.dev/skills/zaxbyhub/opencode-swarm/durable-session-state)<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>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.
| Model | Per session | Once 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 |
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.
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 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.
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.
- today Changed 3d7dcfdb513c
- 6d ago First seen · 83 lines · 70 tokens per session scan A 63515caeabe2
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.
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.
context-engineering
项目级上下文工程框架:通过 PROJECT / REQUIREMENTS / ROADMAP / STATE 四层文档 为每个任务建立结构化上下文,控制 token 预算,防止上下文腐烂, 确保跨会话连续性。与 context-lifecycle 的 L0-L3 层互补。.
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.
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…
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.
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.