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 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/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.
<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>- NVIDIA SkillSpector warn
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.
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.00844 |
| Opus 5.5 | $0.00028 | $0.00338 |
| Sonnet 5.5 | $0.00014 | $0.00169 |
| 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 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.
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 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.
- 7d ago Changed · +1 lines 7a30dbd4f5c4
- 1mo ago Changed 3d7dcfdb513c
- 1mo 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 (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.
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…
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.
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)…
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…
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…
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…