🔴 Step 1: Subscribe to @SeeStack on YouTube for weekly AI agent tools, custom Claude mods, and Obsidian templates!
A local-first, persistent context, agent workflow, and session-recovery system for Claude Code powered by Obsidian and the native Obsidian CLI.
Tip
If this setup saves you time and context, please consider giving it a ⭐ on GitHub! It helps more developers discover the architecture and keeps active maintenance going.
Every Claude Code session starts completely blind:
- Terminal Amnesia: Every time you launch a new terminal, your AI assistant has zero recollection of previous conversations.
- Trapped Decisions: Architectural patterns, completed milestones, and blockers vanish into conversation history or hidden dotfiles.
- Context Burn: You waste time and tokens re-explaining project architecture, rules, and setup before getting any real coding done.
Claude Obsidian Memory turns an Obsidian vault into a real-time, persistent second brain for Claude Code.
- Plain Markdown Vault: All memory, custom commands, and skills live inside your Obsidian vault as plain Markdown files.
- Symlink Pipeline: Symbolic links seamlessly connect your vault (
Agents/Commands,Agents/Skills, andAuto-memory) directly to~/.claude/. - Native Obsidian CLI: Claude Code invokes the built-in macOS Obsidian CLI binary to inspect, search, and append session logs directly into your knowledge graph.
- Autonomous Execution: Pre-configured permission rules (
Bash(obsidian *)) allow Claude Code to execute vault commands autonomously without prompting you on every line. - Zero Amnesia Session Recovery: Days or weeks later, Claude scans your
Year / Month / Dayjournal structure, reconstructs unfinished work, and picks up right where you left off.
┌────────────────────────────────────────────────────────┐
│ CLAUDE CODE │
└───────────────────────────┬────────────────────────────┘
│
▼
┌────────────────────────────────────────────────────────┐
│ TERMINAL │
└───────────────────────────┬────────────────────────────┘
│ Reads & Writes via Symlinks & CLI
▼
┌────────────────────────────────────────────────────────┐
│ OBSIDIAN VAULT │
│ │
│ ├── Agents/ │
│ │ ├── Commands/ (Custom slash commands) │
│ │ ├── Skills/ (Reusable agent recipes) │
│ │ ├── Scripts/ (Deterministic bash automations) │
│ │ └── Config/ (Auto-memory & settings.json) │
│ ├── Journal/ (Year / Month / Day hierarchy) │
│ └── Templates/ (Daily note markdown scaffolds) │
└────────────────────────────────────────────────────────┘
|
Real-time connections between Claude agents, skills, commands, and daily sessions.
|
Automated Year/Month/Day note scaffolds updated autonomously via Obsidian CLI.
|
Watch the complete, end-to-end setup and the 23-day memory test on YouTube:
- Persistent Claude Code Context: Long-term memory stored outside the chat window.
- Auto-Memory Redirection: Claude Code's auto-memory routed into Obsidian where you can view, edit, and link it.
- Daily Journal System: Automated
Year / Month / Daynote generation with standardized markdown templates. - Custom Agent Commands: Slash commands (e.g.
/daily-journal,/get-context) ready to trigger from your CLI. - Reusable Agent Skills: Structured workflows defined in markdown recipes (
SKILL.md). - Deterministic Scripts: Bash scripts (
daily-journal.sh) that build note hierarchies safely without AI hallucinations. - Automated Context Pruning: One bash command (
scripts/prune-memory.sh) to enforce <200 line budgets, prune stale caches, and archive sessions to Obsidian. - Session Recovery: Prompt protocols that let Claude reconstruct previous sessions and find unfinished tasks.
To enable fully autonomous, bi-directional memory between Claude Code and Obsidian, three core components must be configured:
- Obsidian CLI: Enables command-line reads, appends, and search inside your vault.
- Claude Code Permissions: Grants autonomous execution permission (
Bash(obsidian *)) to eliminate approval prompts. - Symlink Wiring: Connects vault commands, skills, and memory paths to
~/.claude/.
Run the included automated setup script from the root of this repo:
# Clone the repository
git clone https://github.com/see-stack/claude-obsidian-memory.git
cd claude-obsidian-memory
# Run setup (detects Obsidian, configures symlinks & permissions)
./scripts/setup.shThe script will:
- Symlink the macOS Obsidian binary to
~/.local/bin/obsidian. - Symlink
Agents/Commandsto~/.claude/commands. - Symlink
Agents/Skillsto~/.claude/skills. - Inject
"Bash(obsidian *)"into~/.claude/settings.json. - Set
autoMemoryDirectoryto your vault'sAuto-memorypath.
If you prefer to configure everything manually, follow the steps below:
Obsidian includes a built-in command-line binary inside the application bundle at /Applications/Obsidian.app/Contents/MacOS/obsidian.
To make it accessible system-wide from any terminal:
# Link to your user local bin
mkdir -p ~/.local/bin
ln -sf /Applications/Obsidian.app/Contents/MacOS/obsidian ~/.local/bin/obsidian
# Verify the CLI works
obsidian version
obsidian help(Ensure ~/.local/bin is in your PATH. If not, add export PATH="$HOME/.local/bin:$PATH" to your ~/.zshrc or ~/.bashrc).
obsidian append path="<file>" content="<text>"— Appends timestamped dev logs without altering the rest of your note.obsidian read path="<file>"— Reads file contents directly from the vault.obsidian search query="<text>"— Performs rapid full-text vault search.obsidian tasks daily— Queries pending and completed tasks from daily notes.obsidian open file="<file>"— Opens the note inside the Obsidian GUI.
By default, Claude Code pauses execution and prompts for user confirmation every time a shell command is run. For background memory queries and logging, this breaks the agentic workflow.
Add "Bash(obsidian *)" to the permissions.allow array in ~/.claude/settings.json:
{
"permissions": {
"allow": [
"Bash(obsidian *)",
"Bash(ls *)",
"Bash(find *)",
"Bash(mkdir *)"
]
}
}Tip
The wildcard pattern "Bash(obsidian *)" allows Claude Code to execute obsidian append, obsidian read, obsidian search, and all other vault operations autonomously without interrupting your flow.
Bridge your Obsidian vault to Claude Code's global configuration directory (~/.claude):
# 1. Ensure Claude config directory exists
mkdir -p ~/.claude
# 2. Symlink custom slash commands (/daily-journal, etc.)
ln -sf "/path/to/AI-Knowledge-Base/Agents/Commands" ~/.claude/commands
# 3. Symlink reusable agent skills (recipes with multi-step workflows)
ln -sf "/path/to/AI-Knowledge-Base/Agents/Skills" ~/.claude/skillsConfigure Claude Code to store persistent memories directly inside your vault rather than hidden local state:
In ~/.claude/settings.json:
{
"autoMemoryDirectory": "/path/to/AI-Knowledge-Base/Agents/Config/Auto-memory"
}Now, anything Claude commits to memory automatically becomes a note inside your Obsidian vault that you can view, edit, link, and graph.
- Open Obsidian Settings ➔ Core Plugins ➔ Enable Daily Notes and Templates.
- Under Templates settings:
- Set Template folder location to
Templates.
- Set Template folder location to
- Under Daily Notes settings:
- Set Date format to
YYYY/MM/DD. - Set New file location to
Journal. - Set Template file location to
Templates/Daily.
- Set Date format to
claude/memory
Claude Code will confirm it is reading and writing to your Obsidian vault's Auto-memory directory.
/daily-journal Implemented authentication hooks and fixed token refresh bug
What happens automatically:
daily-journal.shexecutes deterministically, creating today's note (Journal/YYYY/MM/DD.md) linked into the parent month and year notes.- The
daily-journalskill triggersobsidian appendto log timestamped entries under## Dev / Logs. - Updated tasks and files are recorded and cross-linked into your Obsidian knowledge graph.
Close the terminal. Days or weeks later, open a fresh terminal in any project and prompt:
What did we work on in our last session, and what tasks are still pending?
Claude will inspect your Obsidian vault, scan the latest journal entries, reconstruct your last state, and report the pending tasks with complete clarity.
claude-obsidian-memory/
├── assets/
│ ├── architecture-diagram.png # System architecture flow diagram
│ ├── obsidian-vault-demo.gif # Live Obsidian vault navigation demo
│ └── obsidian-graph-view.gif # Interactive knowledge graph animation
├── scripts/
│ ├── setup.sh # 1-command automated configuration script
│ └── prune-memory.sh # Context budget manager and memory pruner
├── AI-Knowledge-Base/ # Ready-to-use Obsidian Vault template
│ ├── Agents/
│ │ ├── Commands/ # Custom Claude Code slash commands (.md)
│ │ │ └── Daily-Journal.md # /daily-journal slash command definition
│ │ ├── Skills/ # Reusable agent workflows
│ │ │ └── daily-journal/ # Structured skill recipe (SKILL.md)
│ │ ├── Scripts/
│ │ │ └── daily-journal.sh # Deterministic bash linking & note scaffold
│ │ └── Config/
│ │ ├── Auto-memory/ # Claude Code auto-memory destination
│ │ ├── settings.json # Symlinked Claude settings
│ │ └── settings.example.json # Template settings reference
│ ├── Journal/ # Auto-maintained Year / Month / Day hierarchy
│ ├── Templates/
│ │ ├── Daily.md # Daily journal scaffold
│ │ ├── Month.md # Month overview scaffold
│ │ └── Year.md # Year overview scaffold
│ ├── CLAUDE.md # Project-level agent instructions
│ └── Agents.md # Vault agent root index
└── README.md # Project documentation
AI coding agents accumulate context bloat over weeks of usage: stale scratchpad caches, session debug traces, and overflowing instruction files consume tens of thousands of tokens per prompt.
Run the automated context pruner:
./scripts/prune-memory.shWhat it does:
- Audits Active Context: Verifies
CLAUDE.mdis strictly capped under 200 lines of core architecture rules. - Prunes Stale Scratchpads: Cleans expired paste caches and debug logs older than 3 days.
- Offloads to Obsidian: Moves aged session files (>7 days) into your persistent Obsidian archive (
Archive/AI-Memory/). - Cuts Token Bills by ~80%: Keeps agent reasoning sharp and prevents token waste.
- 100% Local-First: No external cloud services or databases required. All memories, notes, and session logs reside on your physical machine in open Markdown.
- Secret Protection: Keep API tokens,
.envfiles, and credentials out of your vault notes. Never commit keys to Git.
- Website: seestack.dev — Real AI workflows, tools, and developer setups.
- YouTube: @SeeStack — Step-by-step video tutorials and system breakdowns.
- GitHub Organization: @see-stack
- X: @seestackx — Rapid tooling drops and architecture notes.
- Bluesky: @seestack.bsky.social
- Instagram: @see.stack — Fast tips and agent demos.
If this system helped you build autonomous agent workflows, give it a star! It lets us know what tools to build next.
This project is licensed under the MIT License.


