save

save is a command for Claude Code from lucasrosati/claude-code-memory-setup. It costs 0 tokens per session (1,661 once invoked), scanned A, original, MIT.

A session-saving command that stores the current work in a vault and extracts lasting decisions, insights, and conventions. A vault is a folder used to keep project memory between sessions.

In plain words
What is it for?
Use it at the end of a session or before pausing work to save a session log and update project memory when appropriate.
Why use it?
It prevents useful context from being lost when work pauses or ends. It avoids writing permanent notes when the session contains nothing durable.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: mentions CLAUDE.md.

Good fit Use it at the end of a session or before pausing work to save a session log and update project memory when appropriate.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/lucasrosati/claude-code-memory-setup/save
About the project

Claude Code Memory Setup is a workflow that gives Claude Code persistent project memory and selected codebase context using Obsidian notes, chat imports, and Graphify knowledge graphs. Developers use it to retain decisions between sessions and retrieve relevant code information without repeatedly reading the whole repository. Its catalogue commands support this memory and code-context workflow.

lucasrosati/claude-code-memory-setup · 1,038 stars · on GitHub

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.

Clone the repo
git clone --depth 1 https://github.com/lucasrosati/claude-code-memory-setup

Made for: Claude Code.

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/lucasrosati/claude-code-memory-setup/save/github.svg)](https://agentmods.dev/commands/lucasrosati/claude-code-memory-setup/save)
Your own site
<a href="https://agentmods.dev/commands/lucasrosati/claude-code-memory-setup/save"><img src="https://agentmods.dev/badge/commands/lucasrosati/claude-code-memory-setup/save/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.

agentmods 80×15 button for save

Your own site · 80×15
<a href="https://agentmods.dev/commands/lucasrosati/claude-code-memory-setup/save"><img src="https://agentmods.dev/badge/commands/lucasrosati/claude-code-memory-setup/save.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,661 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01661
Opus 5.5 $0.00000 $0.00664
Sonnet 5.5 $0.00000 $0.00332
Haiku 4.5 $0.00000 $0.00166

Measured yesterday against content hash b46976c2013c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 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.

commands/save.md · 105 lines

How it starts

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

/save — Save the Session and Consolidate Memory

Saves the session to the vault and automatically consolidates durable decisions, insights and conventions. Use it when you finish or pause work.

Run both phases in order. Phase 2 only writes when there is durable knowledge. When in doubt, don't write: the session log already preserves the context, and the user can pin something later with /memorize.

Vault detection (same rule as /resume)

Run this block (one Bash call) and use the printed vault= as <vault>, project= as <project>, project_dir= as <vault>/<project> and logs= as the log folder:

setopt nullglob 2>/dev/null  # zsh aborts on unmatched globs; no-op in bash
vault=${VAULT_DIR:-$HOME/vault}
root=$(git rev-parse --show-toplevel 2>/dev/null); root=${root:-$PWD}
project=$(basename "$root")
if [ -d "$vault/$project" ]; then pdir="$vault/$project"; logs="$pdir/logs"; else pdir=""; logs="$vault/logs"; fi
echo "vault=$vault project=$project project_dir=${pdir:-NONE} logs=$logs"
  • The vault is $VAULT_DIR (default ~/vault). The project is the basename of the git top-level folder, or of the current directory outside git.
  • project_dir=NONE: logs go to <vault>/logs/ and decisions stay in the log only. Don't create a project folder in the vault.

Phase 1: Session log (always)

  1. Read <vault>/CLAUDE.md before writing. Review the whole conversation of this session.
  2. Create <logs>/YYYY-MM-DD-short-description.md (kebab-case, no accents). Never overwrite an existing log: if the name already exists, add HHMM after the date. Frontmatter:
---
title: "Descriptive session title"
tags: [session-log, <project>]
created: YYYY-MM-DD
updated: YYYY-MM-DD
status: completed
type: log
---
  1. Sections:
    • ## What was done
    • ## Decisions made (if none, "No new decisions.")
    • ## Pending
    • ## State for resume: task (or none), branch, pending acceptance criteria, tests run and result, blockers, exact next action
    • ## Files modified (path — what changed)
    • ## Notes created or updated (filled at the end of Phase 2)
  2. Follow the rules in <vault>/CLAUDE.md: at least 2 wikilinks, complete frontmatter.
  3. Never include the raw log of the whole conversation. If an existing vault note became outdated and is not handled in Phase 2, tell the user.

Read the full file on GitHub · 105 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 · 105 lines · 0 tokens per session scan A b46976c2013c

Subscribe to this mod's changes

save is a command published in the GitHub repository lucasrosati/claude-code-memory-setup (1,038 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,661 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-10-22.

Related

Other commands, from other repositories