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.
What it solves
This project provides a comprehensive setup to give Claude Code persistent long-term memory and codebase awareness. It solves the problem of "amnesia" between sessions—where users must re-explain project details—and the high token cost associated with the AI re-reading entire codebases to understand structure.
How it works
The system uses a three-layer approach to manage context:
- Project Memory (Obsidian): A centralized Obsidian vault acting as a "second brain" using the Zettelkasten method. It stores decisions, progress, and knowledge. Claude Code interacts with this vault via a
CLAUDE.mdinstruction file and custom/resumeand/savecommands. - Code Map (Graphify): It integrates Graphify to transform codebases into queryable knowledge graphs. This allows Claude to query structural information (via AST) rather than reading raw files, significantly reducing token usage.
- Chat Import Pipeline: A Python-based pipeline that exports Claude conversations (from both the CLI and Web app) and imports them into the Obsidian vault as tagged, interlinked notes.
Additionally, a safety-net auto-save hook is provided to mechanically extract session facts from transcripts and log them to the vault upon session end.
Who it’s for
Developers using Claude Code who want to maintain a persistent knowledge base across multiple sessions and optimize token consumption when working with large codebases.
Highlights
- Persistent Memory: Uses Obsidian for declarative memory (decisions, architecture).
- Token Efficiency: Leverages Graphify for structural codebase mapping to avoid redundant file reads.
- Automated Sync: Includes a pipeline to convert chat histories into searchable vault notes.
- Zettelkasten Integration: Implements a structured note-taking system for AI-assisted development.
- Session Continuity: Custom commands and hooks ensure that progress and context are preserved automatically.
Related
- Project
- Project
- Project
- Dispatch
- Project