How to Give Claude Code Persistent Memory with Obsidian

Claude Code forgets everything when a session ends. There's no built-in memory that carries your project decisions, preferences, or architectural choices into the next conversation. The fix is straightforward: use Obsidian as a persistent context layer by storing structured markdown notes in a vault that Claude Code can read directly from your terminal. Every session starts with full context instead of a blank slate, and your knowledge compounds over time rather than evaporating.
Why Claude Code Loses Context Every Session
Claude Code operates within a context window, and when that window closes, everything discussed is gone. There's no automatic memory system writing your preferences to a database or recalling that you decided to use Supabase over PostgreSQL three weeks ago. Each new session is genuinely cold.
This isn't a bug. It's how stateless AI sessions work by design. But for developers working on long-running projects, it creates a real productivity tax. Based on typical daily Claude Code usage patterns, developers spend roughly 8 to 12 minutes per session re-establishing project context through prompts, pasted code, or repeated explanations before any meaningful work begins. Over a month, that adds up to hours of lost time.
The deeper cost isn't just time. When you skip the re-prompting because it feels tedious, Claude Code makes decisions without your architectural preferences, naming conventions, or business logic. That's where subtle errors and technical debt creep in.
If you're new to working with Claude AI generally, it helps to first understand how to set up Claude AI properly for beginners before layering in a memory system.
What Obsidian Actually Does in This Workflow
Obsidian is a local-first markdown note-taking app. Every note you write is a plain .md file stored in a folder on your computer. That's the entire architecture that makes this integration work.
Because your Obsidian vault is just a folder full of text files, Claude Code can read any of those files directly from the terminal with a simple command. You're not using an API, a plugin, or a third-party sync service. The vault is a directory, and markdown is plain text. Claude Code can consume it instantly.
Obsidian supports vaults with 10,000 or more notes without performance degradation, which means you're building a context system that can grow with your projects for years without hitting a ceiling. The local-first design also means your project decisions, client details, and architectural notes never leave your machine unless you want them to.
How to Set Up Claude Code Memory with an Obsidian Vault
Step 1: Structure Your Vault for AI Context
Don't just dump random notes into a folder and expect Claude to make sense of them. Design a dedicated section of your vault specifically for AI context. A clean structure looks like this:
/YourVault
/AI-Context
CLAUDE.md <-- master project brief Claude reads first
tech-stack.md <-- languages, frameworks, databases, why
brand-voice.md <-- tone, style, naming conventions
architecture.md <-- system design, key decisions, tradeoffs
pricing-logic.md <-- business rules, edge cases, formulas
decisions-log.md <-- dated record of what you decided and why
current-sprint.md <-- what you're building right now
The CLAUDE.md file is the anchor. Every session, you'll point Claude Code here first. It should contain a concise project summary, links to the other context files, and any standing instructions you want Claude to follow across all sessions.
Step 2: Write a Useful CLAUDE.md File
This file does the heavy lifting. Keep it scannable and specific. Here's a working template:
# Project: [Your Project Name]
## What This Is
[2-3 sentence description of what you're building and for whom]
## Tech Stack
See: /AI-Context/tech-stack.md
## Current Focus
See: /AI-Context/current-sprint.md
## Standing Instructions
- Always use TypeScript, never plain JavaScript
- Use named exports, never default exports
- Error messages must be user-facing and plain English
- Check architecture.md before suggesting new patterns
## Key Decisions Already Made
See: /AI-Context/decisions-log.md
## Do Not
- Suggest switching databases mid-project
- Use class components in React
- Abstract prematurely
The "Do Not" section alone saves significant back-and-forth. Claude Code won't suggest something you've already ruled out, because it knows you've ruled it out.
Step 3: Connect Your Obsidian Vault to the Claude Code Terminal Workflow
Open your terminal in your project directory. At the start of each session, load your context files explicitly:
cat ~/YourVault/AI-Context/CLAUDE.md | claude
Or pass multiple files together for deeper context:
cat ~/YourVault/AI-Context/CLAUDE.md \
~/YourVault/AI-Context/tech-stack.md \
~/YourVault/AI-Context/current-sprint.md | claude
You can also create a simple shell script so loading context becomes a single command:
#!/bin/bash
# save as: load-context.sh
cat ~/YourVault/AI-Context/CLAUDE.md \
~/YourVault/AI-Context/tech-stack.md \
~/YourVault/AI-Context/architecture.md \
~/YourVault/AI-Context/current-sprint.md | claude "$@"
Run it with ./load-context.sh "your first prompt here" and Claude Code starts every session already knowing your project. For more on what Claude Code can do with these setups, check the Claude Code slash commands you should know in 2025.
Step 4: Build the Habit of Updating Your Vault
The system compounds when you treat your vault as a living record. After any session where you make a significant decision, open your decisions-log.md and add a dated entry. After you complete a sprint, update current-sprint.md. This takes less than two minutes and means future sessions start with genuinely current context.
Most developers who set this up report cutting their session ramp-up time by roughly 70 to 80 percent within the first two weeks, simply because Claude stops asking questions it already has answers to.
Building a Second Brain Setup for Your AI Development Workflow
The Obsidian vault approach isn't just a workaround for a missing feature. It's a fundamentally better pattern for AI context management on long-term projects. Prompt templates and system messages give Claude generic instructions. A structured vault gives it institutional knowledge specific to your project, your preferences, and your real decisions.
The gap between those two things is the difference between an AI that feels like a new hire every session and one that feels like a senior collaborator who was there for all the important conversations. Developers working on projects longer than four weeks notice the difference most sharply.
For deeper thinking on this topic, giving Claude AI persistent memory using Obsidian covers the broader memory architecture in detail, including how to handle context across multiple projects simultaneously.
This also scales beyond individual developers. If you're building with a small team or running a solo consulting practice, the vault becomes shared infrastructure. One well-maintained decisions-log.md means any team member who opens a Claude Code session gets the same institutional context you do. According to Obsidian's own documentation, the plain-text, local-first format makes vault contents fully portable and readable by any tool that processes text, including every major AI coding assistant.
You can also layer in notes about clients, service pricing logic, or product requirements using the same structure. The vault grows alongside your work and stays useful because it's written for both human and AI readers.
The developers who get the most value from Claude Code aren't the ones with the best prompts. They're the ones who stopped treating every session as a fresh start and built a system that carries their knowledge forward. Your Obsidian vault, structured around context files and kept current as a habit, does exactly that. Start with a single CLAUDE.md file today, run one session using it, and you'll understand immediately why this approach beats re-prompting from scratch every single time.
Obsidian + Claude Code: Give Your AI a Persistent Memory
Claude forgets everything when a session ends. Wire up an Obsidian vault as a persistent external brain using MCP, and your AI starts walking into each conversation already knowing your projects, preferences, and open decisions.
Read the white paper →Get a free AI-powered SEO audit of your site
We'll crawl your site, benchmark your local pack, and hand you a prioritized fix list in minutes. No call required.
Run my free audit