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 commands/andrew-shwetzer/claude-code-save/savegit clone --depth 1 https://github.com/andrew-shwetzer/claude-code-saveWrote 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/commands/andrew-shwetzer/claude-code-save/save)<a href="https://agentmods.dev/commands/andrew-shwetzer/claude-code-save/save"><img src="https://agentmods.dev/badge/commands/andrew-shwetzer/claude-code-save/save.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 | $0.00000 | $0.01773 |
| Opus 5 | $0.00000 | $0.00886 |
| Sonnet 5 | $0.00000 | $0.00355 |
| Haiku 4.5 | $0.00000 | $0.00177 |
Grade A, and why
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 3d 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 — 183 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Save session progress as a structured checkpoint. Like a video game save: captures where you are, what you were doing, and what to do next.
How to execute
Step 1: Detect project
Identify the project using this priority order:
- Look for
.claude-save-config.jsonin CWD or any parent directory. Read itsproject.slugandproject.name. - Check
~/.claude/saves/config.jsonfor aprojectsmapping that matches the CWD. - Use the git repository name (from
git rev-parse --show-toplevel). - Use the current directory name as a fallback.
- If ambiguous or CWD is
$HOME, ask: "Which project should I save under?"
Convert the slug to kebab-case: lowercase, alphanumeric and hyphens only.
Trivial session check: If the session was only Q&A, a single config tweak, or produced no file output, output:
Skipping save. Session was trivial (no substantive work to checkpoint).
And stop.
Step 2: Gather git state
Run these in the CWD (skip if not a git repo):
git branch --show-current
git log --oneline -1
git status --porcelain
Capture: branch name, last commit (hash + subject), count of dirty files, and the porcelain output lines (max 20).
Step 3: Compose save state from session context
From your conversation context, determine:
- intent (string): What was the user trying to accomplish? Write in past progressive tense. Example: "Implementing JWT authentication for the API endpoints." This answers "what were you in the middle of?" not "what did you finish?"
- files_modified (array): Files created, modified, or deleted. Include a brief description of what changed in each. Use paths relative to the project root.
- decisions (array of strings): Choices made during the session and their rationale. Example: "Used RS256 over HS256 for JWT signing because we need key rotation support."
- next_steps (array of strings): What should happen next, ranked by priority. Be specific and actionable. "Implement the refresh token endpoint in src/auth.ts" not "continue working." Each step should be completable in a single session.
- lessons (array of objects with title/finding/implication): Only if a technical pitfall was solved, a strategic insight was confirmed, or a useful pattern was discovered. Most sessions have zero lessons. Don't force it.
- tags (array of strings): 2-5 descriptive tags for searchability. Examples: "auth", "bugfix", "refactor", "database", "api".
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.
- 3d ago First seen · 183 lines · 0 tokens per session scan A 75aa58838460
save is a command published in the GitHub repository andrew-shwetzer/claude-code-save (2 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,773 tokens. 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.
Other commands, from other repositories
update-workflow
Regenerate an existing custom workflow's shortcut command wiring from the current swarm template.
save
Save this conversation as a new or existing reusable context.
import
Import a shared context bundle, or take a teammate's newer copy of one you already have.
esp-teach
One-time project setup -- discover hardware, find datasheets, persist context to CLAUDE.md.
swift-critique
Critique SwiftUI code for patterns, design, clean code, accessibility, and performance.
extensions
Show what the connected context expects to reach, and whether this machine provides it.