# claude-code-memory-setup: Obsidian vault and Graphify setup to cut token waste in Claude Code sessions

> claude-code-memory-setup is a guide and configuration kit that pairs Claude Code with an Obsidian Zettelkasten vault and Graphify to reduce per-session token waste. It works by teaching Claude Code to read structured notes through a CLAUDE.md file, but keeping the vault current requires manual note maintenance after each session.

**lucasrosati/claude-code-memory-setup** — Up to 71.5x fewer tokens per session on Claude Code with Obsidian + Graphify. Persistent memory, codebase knowledge graphs, and chat import pipeline. 🇧🇷 PT-BR included.

- Repository: https://github.com/lucasrosati/claude-code-memory-setup
- Stars: 1,019 · Forks: 91
- Language: Python
- License: MIT
- Published: 2026-10-11 · Updated: 2026-10-11 · Language: en
- Canonical page: https://hysenlabs.com/projects/lucasrosati-claude-code-memory-setup

## Session amnesia and per-session file scanning waste tokens before any work begins

Two separate token drains appear in every Claude Code session. First, each new session starts without memory of the previous one, forcing engineers to re-explain the project stack, past decisions, active bugs and remaining tasks. Second, Claude Code scans project files at session start to understand the codebase structure.

A project with approximately 40 files uses about 20,000 tokens for orientation alone, before any question is asked. At 10 sessions per day, that figure reaches 200,000 tokens consumed purely for context reconstruction.

claude-code-memory-setup addresses both problems as separate layers. Obsidian handles the declarative side, meaning what was decided and what the project context is. Graphify handles the structural side, meaning how the codebase is organized. Both are separate systems: engineers can adopt one without the other.

## One Obsidian vault stores memory for all projects, linked by Zettelkasten rules

One Obsidian vault serves all projects rather than one vault per project. A single vault lets a note about a shared dependency link to every project that uses it, and the graph view reveals cross-project connections that separate vaults would hide.

Inside the vault, folders separate permanent notes, an inbox for raw capture, fleeting notes for temporary ideas, templates, logs, per-project folders, a chats/ directory for imported conversations and a graphify/ directory for codebase graphs. Inside each project folder, the guide adds subfolders for architecture, pipeline, data model, features and session logs.

Notes follow Zettelkasten principles that the CLAUDE.md file enforces: one concept per note (atomicity), at least two wikilinks per note, mandatory YAML frontmatter and kebab-case filenames (auth-flow.md rather than Auth Flow.md). Internal links use wikilinks ([[note-name]]), not standard Markdown links. These conventions keep the graph queryable and consistent across projects.

## CLAUDE.md at the vault root defines what Claude Code reads and the two session commands

Every Claude Code session begins with the contents of CLAUDE.md, which makes the file the bridge between Obsidian and the assistant. Placed at the vault root, CLAUDE.md covers three areas: a list of project stacks, the Zettelkasten rules and two session commands.

/resume tells Claude Code to read the three most recent entries in the logs/ directory and the architecture/decisions.md file for the current project, then produce a summary of current state and remaining work. /save tells it to create a dated session log (logs/YYYY-MM-DD-description.md), record what was done, decisions made and pending items, add wikilinks to any notes created or modified and run git commit and push if inside a repository.

Neither /resume nor /save is a built-in Claude Code command. Both are instructions embedded in CLAUDE.md that define what Claude should do when it reads those strings in a conversation. Removing them from CLAUDE.md removes the behavior entirely, because they have no effect outside the CLAUDE.md context.

## Setting up the vault directory and the default note template

Two bash commands set up the initial structure. A first command creates the directory layout for a project named my-project at the vault path:

```bash
cd ~/vault  # adjust to your path
mkdir -p permanent inbox fleeting templates logs references
mkdir -p my-project/{architecture,pipeline,data,features,logs}
```

A second command creates the default note template using a heredoc:

```bash
cat > templates/default-note.md << 'EOF'
---
title: {{title}}
tags: []
created: {{date}}
updated: {{date}}
status: draft
type: permanent
---

# {{title}}

## Context

## Details

## Related links
EOF
```

Its content matches the YAML frontmatter the rules in CLAUDE.md require. Obsidian's Templater plugin or manual editing fills in the {{title}} and {{date}} placeholders. No Templater installation steps appear alongside this template in the guide, so setting up automatic placeholder substitution requires finding the plugin separately.

## Four Obsidian plugins are listed, with one requiring a beta installer first

Four plugins appear in the setup table. BRAT is a community plugin that installs beta and pre-release plugins from GitHub. It is the installation method for the 3D Graph plugin at version 2.4.1, which provides three-dimensional vault visualization. Both Folders to Graph and Calendar install through Obsidian's standard Community Plugins browser. Calendar adds daily note navigation.

BRAT introduces an installation dependency not visible in Obsidian's default plugin listing. To install 3D Graph at v2.4.1, BRAT must be present first. Version v2.4.1 is stated in the table, but no URL for the 3D Graph GitHub repository appears in the guide, so finding the plugin requires a search outside it.

Folders to Graph is listed as providing folders as graph nodes, extending the Zettelkasten graph view to show folder relationships. No documentation covers what happens to the graph if Folders to Graph is removed, or whether existing links break if it is uninstalled.

## The 71.5x reduction claim in the README drops the qualifier found in the repository description

In the repository description, the figure appears as 'Up to 71.5x fewer tokens per session on Claude Code with Obsidian + Graphify.' Inside the README's opening blockquote, the same figure reads '71.5x fewer tokens per session with Graphify' without the 'up to' qualifier. A peak ratio and a representative ratio are not the same claim, and the difference matters when engineers use the figure to decide whether to adopt the full stack.

Item 8 in the README's table of contents is titled 'Real Results,' and that section covers the methodology, project size, session type and conditions behind the 71.5x figure. Without reading that section, the ratio cannot be evaluated. No baseline token count, no description of the project used for measurement and no version of Claude or Graphify at measurement time appear in the README's opening.

All four layers in the overview table are listed as free: Obsidian has a free tier (obsidian.md), Graphify is listed as Free (AST mode), the import pipeline is free and the /resume and /save commands are free.

## Parts 2 through 5 cover chat import, Graphify and an auto-save hook beyond the vault setup

Five numbered parts make up the guide. Part 1 covers the Obsidian vault setup detailed in the sections above. Part 2 covers a chat import pipeline that converts both Claude Code and Claude Web conversations into vault notes, placing them in the chats/ directory. Part 3 covers Graphify, the codebase knowledge graph tool that produces the structural map Claude Code reads instead of scanning files directly. Part 4 documents a complete workflow combining both layers. Part 5 describes an Auto-Save Hook listed as a 'Safety Net' in the table of contents.

A scripts/ directory exists at the repository root alongside the README. Python is the repository's primary language, and v1.0.0 is described in the release notes as adding an auto-save hook and CLI corrections. Most of the code lives in the import pipeline and Graphify integration, while the Obsidian vault setup requires no code beyond shell commands and markdown files.

## Conclusion

Adopt this guide if you run Claude Code across multiple projects and spend significant tokens re-explaining context at each session start. An Obsidian vault gives durable, cross-linked notes that Claude reads through CLAUDE.md, and the /resume and /save commands provide a repeatable session structure. Skip it if you want a one-command automation: this is a manual process requiring note creation after every session and ongoing vault maintenance. Before committing to the full stack, read the Real Results section of the README, which covers the methodology and conditions behind the 71.5x token reduction figure.

## FAQ

### What does claude-code-memory-setup do?

It is a guide and configuration kit that pairs Claude Code with an Obsidian Zettelkasten vault and Graphify to reduce two sources of token waste: session amnesia and per-session file scanning. Five parts cover vault setup, chat import, Graphify integration, a complete workflow and an auto-save hook.

### What are the prerequisites for claude-code-memory-setup?

Part 1 requires Claude Code installed and authenticated, and Obsidian installed (free from obsidian.md). Part 3 covers Graphify integration, which has its own prerequisites not detailed in the vault setup section.

### What do /resume and /save do in claude-code-memory-setup?

Both are defined as instructions inside the CLAUDE.md file at the vault root. /resume reads the three most recent session logs and architecture/decisions.md for the current project, then summarizes current state and remaining work. /save creates a dated session log, records decisions and pending items, and runs git commit and push if inside a repository.

### How does the 71.5x token reduction work in claude-code-memory-setup?

The repository description attributes the reduction to Graphify, the codebase knowledge graph tool covered in Part 3. A section titled 'Real Results' is item 8 in the README's table of contents and covers the methodology and conditions behind this figure.

### Can I use claude-code-memory-setup without Obsidian?

Obsidian and Graphify are separate layers that each solve a different problem, so adopting one independently is possible. The /resume and /save commands depend on the Obsidian vault structure, specifically the logs/ directory and architecture/decisions.md.

## Sources

- [Issues](https://github.com/lucasrosati/claude-code-memory-setup/issues)
- [License: MIT](https://github.com/lucasrosati/claude-code-memory-setup/blob/main/LICENSE)
- [lucasrosati/claude-code-memory-setup on GitHub](https://github.com/lucasrosati/claude-code-memory-setup)
- [README](https://github.com/lucasrosati/claude-code-memory-setup/blob/main/README.md)
- [Releases](https://github.com/lucasrosati/claude-code-memory-setup/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/lucasrosati-claude-code-memory-setup
