arch-save

A context-refresh workflow for an architect agent: it saves important state, clears the current context, and starts again from that saved point.

In plain words
What is it for?
Refreshing an agent during a long task when the owner explicitly requests it, such as with “save and clear” or “/arch-save”.
Why use it?
Long conversations can accumulate outdated or distracting information. This preserves the details needed to continue while giving the agent a fresh working context.

Skill for Claude CodeCodex

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/cluesmith/codev/arch-save
Any agent
npx skills add cluesmith/codev --skill arch-save
Clone the repo
git clone --depth 1 https://github.com/cluesmith/codev

Made for: Claude Code, Codex.

Per session 86 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,365 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.00086 $0.02365
Opus 5 $0.00043 $0.01182
Sonnet 5 $0.00017 $0.00473
Haiku 4.5 $0.00009 $0.00236

Measured yesterday against content hash 3203b8c59b38, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

arch-save 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 yesterday.

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/arch-save/SKILL.md · 190 lines

How it starts

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

/arch-save — save state, clear, and come back as yourself

Long sessions accumulate stale context. This is the deliberate cure: you choose the moment, you choose what survives, and a fresh session resumes from what you wrote.

$ARGUMENTS is the architect name (e.g. main). Omit it to auto-detect.

When NOT to run this

On the owner's direction, or when the owner runs it themselves. Do not invoke this autonomously mid-task on your own judgement — the irreversible step is a human decision, relocated from "press /clear" to "invoke /arch-save", not removed. If the owner tells you to run it, run it; if you think it is time, suggest it and wait.

Only at a resumable boundary — a gate approval, a PR merge, a completed investigation, the end of a long tool-heavy stretch. Never mid-task. Nothing here can check that; the state file must describe a point a fresh session can resume from, not a half-finished action. A mid-task snapshot resumes into confusion.

The procedure

Do these in order. The order is the feature — step 3 must precede step 4, because the context that knows what to write is the one about to be destroyed.

1. Resolve your name

If $ARGUMENTS is non-empty, that is your name. Otherwise run afx whoami and use the reported name when type: architect.

  • type: builderSTOP. This terminal is a builder. Report the mismatch.
  • Non-zero exit → STOP and ask which architect you are. Do not guess, and do not default to main — writing another architect's state file is the exact failure /arch-init exists to prevent (#1094).

Validate the name before building any path: [a-z][a-z0-9-]*, at most 64 characters. Reject slashes, .., uppercase, spaces. Never interpolate an unvalidated name into codev/state/<name>.md.

2. Stop your own monitors

Enumerate every monitor, watcher or background task you armed, and stop it.

This is the half that only you can do. Monitors are session-bound, not context-bound: they survive /clear and keep firing into a context that cannot evaluate their alerts. pgrep cannot see them — they are harness background tasks, not shell processes — so the instance after the clear has no handle on them. You do. Use it.

Read the full file on GitHub · 190 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. yesterday First seen · 190 lines · 86 tokens per session scan A 3203b8c59b38

Subscribe to this mod's changes

arch-save is a skill published in the GitHub repository cluesmith/codev (286 stars, last pushed 5d ago), licensed Apache-2.0. It adds 86 tokens to every session and 2,365 once invoked, about $0.0004 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