durable-agent-architecture

durable-agent-architecture is a skill for Claude Code, Codex from Hoja-Solutions/agent-stdlib. It costs 179 tokens per session (713 once invoked), scanned A, original, MIT.

A design for long-running software agents that can recover after crashes by separating decision-making, tool execution, and durable session history.

In plain words
What is it for?
Use it to build agents that run for hours, resume from an append-only event log, replace failed execution containers, and keep credentials outside those containers.
Why use it?
It prevents the loss of progress when the temporary environment or a process fails.

Skill for Claude CodeCodex

Part of the agent-stdlib plugin — 14 skills, 2 commands, 1 agent, 2 hooks, 2 MCP servers shipped together

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/hoja-solutions/agent-stdlib/durable-agent-architecture
Any agent
npx skills add Hoja-Solutions/agent-stdlib --skill durable-agent-architecture
Clone the repo
git clone --depth 1 https://github.com/Hoja-Solutions/agent-stdlib

Made for: Claude Code, Codex.

Or install agent-stdlib, the plugin that ships this one along with the rest of its 14 skills, 2 commands, 1 agent, 2 hooks, 2 MCP servers.

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-agent-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/hoja-solutions/agent-stdlib/durable-agent-architecture.svg)](https://agentmods.dev/skills/hoja-solutions/agent-stdlib/durable-agent-architecture)
Your own site
<a href="https://agentmods.dev/skills/hoja-solutions/agent-stdlib/durable-agent-architecture"><img src="https://agentmods.dev/badge/skills/hoja-solutions/agent-stdlib/durable-agent-architecture.svg" alt="Measured on agentmods" height="20"></a>
Per session 179 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 713 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 $0.00179 $0.00713
Opus 5 $0.00089 $0.00357
Sonnet 5 $0.00036 $0.00143
Haiku 4.5 $0.00018 $0.00071

Measured 4d ago against content hash 1b2bc4e18dce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

durable-agent-architecture 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 4d 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.

skills/durable-agent-architecture/SKILL.md · 53 lines

How it starts

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

Durable agent architecture

Source: Scaling Managed Agents. Long-running-harness skills exist, but they track context and progress within a run. None encode the service-level decomposition that lets a component die and the agent resume.

A demo agent lives in one process. A production agent runs for hours, survives crashes, and resumes where it stopped. The difference is structural: split the agent into three planes with stable interfaces between them, so each fails and reboots without taking the others down.

The three planes

  • Brain. The model plus the harness logic that drives it. This decides what to do next.
  • Hands. The sandbox and tools that execute. Treat these as ephemeral and disposable.
  • Session. A durable, queryable event log of everything that happened. This is the source of truth.

The rule that makes it durable: the brain and the session live outside the execution container. When the container dies, and containers die, you lose the hands and nothing else. Cattle, not pets.

Resume from the log, not from memory

The session is an append-only event log you can query, not a transcript stuffed back into the context window. Build two operations around it:

  • wake(sessionId) rehydrates an agent from its log and continues.
  • getSession(id) reads the current state without resuming execution.

Let the model pull history out of the log on demand through a getEvents()-style call that returns a selected range, rather than replaying the entire log into context every time. The full log will outgrow the window; selective retrieval keeps the agent working on long sessions.

The reference in references/session-interface.md sketches the event schema and these operations.

Keep credentials out of the hands

The execution environment runs model-directed code, so it is the last place a long-lived secret should sit. Two patterns keep credentials out of it:

  • Token bundling at init. Inject a short-lived, scoped token when the sandbox starts (the pattern Git access uses).
  • A vault proxy. Route authenticated calls through an intermediary that holds the real credential and validates the request (the pattern OAuth flows use).

Read the full file on GitHub · 53 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 4d ago First seen · 53 lines · 179 tokens per session scan A 1b2bc4e18dce

Subscribe to this mod's changes

durable-agent-architecture is a skill published in the GitHub repository Hoja-Solutions/agent-stdlib (1 stars, last pushed 1mo ago), licensed MIT. It adds 179 tokens to every session and 713 once invoked, about $0.0009 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-31.

Related

Other skills, from other repositories

unified_meta_agent_skill

A foundational meta-agent skill for generating Multi-Agent Systems (MAS). It systematically drives the process from conceptual task decomposition to agent engineering, and finally to workflow orchestration.

linhh29/Skill_MAS · 39 tokens

controlflow-planning

Use when a repository task needs a strict ControlFlow-style implementation plan before coding, especially for small, medium, or large scope, cross-file edits, risky migrations, architectural uncertainty, or any work that should produce a saved Markdown plan artifact in plans/.

Smithbox-ai/ControlFlow · 55 tokens

controlflow-router

Use when a task broadly matches ControlFlow for Codex and you need to decide whether to start with spec capture, strict workflow, strict planning, pre-execution plan review, orchestration, code review, or memory hygiene, or whether to combine several of those skills in sequence.

Smithbox-ai/ControlFlow · 60 tokens

controlflow-plan

Use when a repository task needs a high-quality ControlFlow plan before coding — small, medium, or large scope, cross-file edits, risky migrations, architectural uncertainty, or any work that should produce a saved Markdown plan artifact in plans/. Single-sources the plan format from schemas/planner.plan.schema.json…

Smithbox-ai/ControlFlow · 69 tokens

controlflow-verify

Use after /controlflow-claude-code:controlflow-plan produces a plan, before implementation. Runs adversarial pre-execution verification inline in the main context (zero subagents): structural audit, assumption/mirage detection, and executability cold-start simulation. Emits APPROVED / NEEDSREVISION / REJECTED with…

Smithbox-ai/ControlFlow · 73 tokens

controlflow-spec

Use before planning non-trivial Codex work when the requirements, acceptance criteria, boundaries, constraints, or success measures are not yet clear enough for a safe implementation plan.

Smithbox-ai/ControlFlow · 38 tokens