save

save is a command for coding agents from 0xDarkMatter/claude-mods. It costs 24 tokens per session (2,672 once invoked), scanned A, original, MIT.

A command that saves the current coding session into project files so it can be restored later with /sync.

In plain words
What is it for?
It is for saving tasks, plan content, Git and pull-request context, notes, and a readable progress summary, with an option to archive the current plan.
Why use it?
It prevents session-specific tasks, plans, notes, and Git context from being lost or tied to one machine.

Command

Part of the claude-mods plugin — 50 skills, 3 commands, 3 agents, 4 hooks 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 commands/0xdarkmatter/claude-mods/save
Clone the repo
git clone --depth 1 https://github.com/0xDarkMatter/claude-mods

Or install claude-mods, the plugin that ships this one along with the rest of its 50 skills, 3 commands, 3 agents, 4 hooks.

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 save

README.md
[![agentmods](https://agentmods.dev/badge/commands/0xdarkmatter/claude-mods/save.svg)](https://agentmods.dev/commands/0xdarkmatter/claude-mods/save)
Your own site
<a href="https://agentmods.dev/commands/0xdarkmatter/claude-mods/save"><img src="https://agentmods.dev/badge/commands/0xdarkmatter/claude-mods/save.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,672 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.00024 $0.02672
Opus 5 $0.00012 $0.01336
Sonnet 5 $0.00005 $0.00534
Haiku 4.5 $0.00002 $0.00267

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

Security

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 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.

commands/save.md · 371 lines

How it starts

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

Save - Session State Persistence

Persist your current session state for later restoration with /sync.

Claude Code's native auto-memory remembers learnings for you on this machine, but tasks are still session-scoped and nothing native is portable. /save writes state you control — a git-trackable .claude/session-cache.json (tasks, git/PR context, session ID, handoff notes) you can commit, share with a team, or pick up on another machine.

Arguments

$ARGUMENTS

  • No args: Save current state (tasks, plan, git context)
  • "notes": Save with descriptive notes
  • --archive: Archive current plan to PLAN-<date>.md, then save fresh

What It Saves

Data Source Destination
Tasks TaskList API .claude/session-cache.json
Plan content Conversation context <plan-path> (see Step 0)
Git context git status/log .claude/session-cache.json
User notes Command argument .claude/session-cache.json
Human-readable summary Generated .claude/claude-progress.md

Execution

Step 0: Resolve Plan Path

Determine where the strategic plan file lives:

  1. Check .claude/settings.local.json for a plansDirectory key
  2. If not found, check .claude/settings.json for plansDirectory
  3. If found, plan path = <plansDirectory>/PLAN.md
  4. If not found, default to docs/PLAN.md

Store the resolved path for use in all subsequent steps.

Note: plansDirectory is a Claude Code setting (added in v2.1.9) for plan file storage. Our strategic PLAN.md co-locates with native plans when this is set.

Step 1: Capture Task State

Use TaskList and TaskGet to capture full task data:

1. Call TaskList to get all task IDs and summaries
2. For each task, call TaskGet to retrieve:
   - subject (title)
   - description (full details)
   - status (pending, in_progress, completed)
   - blockedBy (dependency IDs)
3. Store as array with index-based dependency mapping

Note: Tasks do not persist across sessions automatically. This is why /save exists.

Read the full file on GitHub · 371 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. 4d ago First seen · 371 lines · 24 tokens per session scan A 579759b541f2

Subscribe to this mod's changes

save is a command published in the GitHub repository 0xDarkMatter/claude-mods (32 stars, last pushed 11d ago), licensed MIT. It adds 24 tokens to every session and 2,672 once invoked, about $0.0001 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.