Claude Code Memory Setup: Obsidian-based memory
Claude Code Memory Setup
A guide with ready files: Claude Code keeps decisions between sessions through an Obsidian vault and /save and /resume commands
- 1,059 ★ on the repository
- Last commit
- MIT
Broad access
Why this level
- The `/commit` command commits and pushes changes to the remote repository and then runs `/save`
- The `session_autosave.py` hook writes session contents to the vault in plain text: logs may contain secrets from your conversations
- The optional Graphify git hook is added to your repository and rebuilds the graph after every commit
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add workflows/claude-code-memory-setupDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewBroad accessThe tool can change data, run commands or handle secrets.
- The `/commit` command commits and pushes changes to the remote repository and then runs `/save`
- The `session_autosave.py` hook writes session contents to the vault in plain text: logs may contain secrets from your conversations
- The optional Graphify git hook is added to your repository and rebuilds the graph after every commit
This is third-party code. Review the repository files before installing.
What it does
The repository is a detailed guide plus ready files that give Claude Code memory between sessions. Notes live in a single Obsidian vault using the Zettelkasten method: decisions, context and knowledge for all projects in one place, and a `CLAUDE.md` file at the vault root sets the agent's rules for working with it. The `commands` folder holds four slash commands. `/save` writes a session log and moves durable decisions into memory, `/resume` loads project memory and recent logs, `/memorize` pins one item mid-session, and `/commit` commits and pushes changes and then runs `/save`. In `scripts`: `claude_to_obsidian.py` and `sync_claude_obsidian.sh` import past chats into the vault with metadata, tags and wikilinks, and `session_autosave.py` fires on the SessionEnd event and saves a minimal log if you forgot `/save`. For a code map the guide adds Graphify (`pip install graphifyy`, then `graphify install --platform claude`): the project graph lives in the vault, and an optional git hook rebuilds it after a commit.
Who it is for. For developers who run several projects in Claude Code and are tired of re-explaining the stack, past decisions and task status every session.
Good fit when
- Every new Claude Code session starts with re-telling the stack and past decisions
- You want the agent to write a log at the end and move what matters into project memory
- You want to keep past Claude conversations in Obsidian with tags and links between notes
- The agent reads a lot of source and you want to give it a code graph instead of rereading files
- You work on several projects and want one shared knowledge vault
Not a fit when
- You want ready-made memory out of the box: the vault, `CLAUDE.md` and paths are configured by hand
- You have one small project: a plain `CLAUDE.md` in the repository is enough
- You do not use Obsidian and do not want to keep notes: the guide is built around a vault
- You need memory for a team: the vault is local and meant for one person
Example request
/resumeLimitations
This is a guide with files for self-assembly, with no installer: the vault, `CLAUDE.md`, paths and the `VAULT_DIR` variable (`~/vault` by default) are configured by hand. Obsidian and Python for the scripts are required.
The author states that the token-saving figures of 71.5x per session and 499x per query come from their own measurements and cannot be reproduced from published data: real savings depend on the task. Autosave is mechanical and does not consolidate memory; only `/save` does. The guide is in English, with a Brazilian Portuguese version. The last commit was made in October 2026.
How to disable. Delete the four command files from `~/.claude/commands/`, remove the SessionEnd hook from `~/.claude/settings.json` and, if you installed Graphify, delete its hook from `.git/hooks/` in the repository. The Obsidian vault with notes stays on disk until you delete it yourself.
FAQ
How do I install the /save and /resume commands in Claude Code?
Clone the repository and run `cp commands/*.md ~/.claude/commands/`, then `rm ~/.claude/commands/README.md` and restart Claude Code.
How does /save differ from autosave?
`/save` writes a log and moves durable decisions, rules and facts into project memory. The autosave hook only writes a minimal log from the session transcript and consolidates nothing.
Do I need Obsidian and Graphify?
The guide keeps the vault in Obsidian, which is free. Graphify is added separately for the code map: without it the memory and commands still work.
How many tokens does this setup save?
There is no exact figure. The author kept the historical estimates but noted they cannot be reproduced from published data. For your own measurements the repository has a `benchmarks` folder with the `summarize.py` script.
How do I turn on autosave when a session ends?
Copy `scripts/session_autosave.py` to `~/scripts/`, make it executable and add a SessionEnd hook to `~/.claude/settings.json` with the command `VAULT_DIR=$HOME/vault python3 $HOME/scripts/session_autosave.py`. The hook writes errors to `~/scripts/autosave.log` and does not break the session.
Discussion
No questions or reviews yet.
Related
Workflowshipocampus gives an agent file-based memory: a 3,000-token topic index loads each session and shows what came up before
A local workbench for Claude Code, Codex, Pi and OpenCode: memory changes wait for your review, then an audit follows each turn
The Supermemory plugin for Claude Code: persistent memory across sessions with automatic prompt recall, conversation capture and a codebase index
Persistent memory for coding agents: insights are stored as markdown cards and recalled at the start of the next session.
A Claude Code workspace folder: hooks with a local Ollama detect the project type, pick skills and remind you to update the docs
Long-term agent memory in local Markdown files with a link graph, semantic search and MCP access
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| Claude Code Memory Setup: Obsidian-based memory (this card) | no | 1,059 | |
| Claude-Mem | no | 113,534 | a plugin that saves observations and injects context itself; here memory is assembled by hand in Obsidian |
| claude-obsidian | no | 16,188 | a plugin that turns an Obsidian vault into a knowledge base; here the focus is session logs and the /save and /resume commands |
| graphify | no | 142,732 | a standalone skill for a code knowledge graph; the guide uses it as one part of the memory setup |
README in short
The guide starts with two problems: losing context between sessions and rereading code. It then covers, part by part, the Obsidian vault, chat import, Graphify, the overall workflow and the autosave hook, and ends with sections on real results and troubleshooting.