Claude Code + Obsidian: Automatically Capture Sessions and Generate a Daily Work Log
Who this is forDevelopers and knowledge workers on macOS who use Claude Code every day and want their session history saved in Obsidian without extra effort.
AI coding sessions contain knowledge you will want again: the bug that took an afternoon to track down, the research summary Claude produced last week, and the reasoning behind a workflow decision. When the session closes, most of that context is gone. The next time the same question comes up, you either search for the old answer or start over. This article describes a pipeline that prevents that loss. A Claude Code Stop Hook saves each session to an Obsidian vault as Markdown, including git status, commit history, and the conversation record. An optional Gemini step then turns each day’s sessions into a structured work log. You will get the overall design, the components and their dependencies, the reasoning behind the approach, and the setup commands.
Overview
The pipeline saves Claude Code and Codex sessions into Obsidian automatically and uses Gemini to generate a daily work log from them. The author describes it as a zero-friction knowledge management pipeline and has published the code and a hands-on guide on GitHub as open source. The central design goal is that normal use of the tools produces the records. The user does not need a separate note-taking step, and the system does not depend on remembering to write anything down.
The idea builds on a concept from Andrej Karpathy, who proposed using a large language model as a knowledge compiler. The pipeline is a practical implementation of that approach, scaled down so that one person can set it up on a single Mac in a short time.
Key data
The main facts from the source note are these:
- A practical implementation of Andrej Karpathy’s “LLM as knowledge compiler” approach
- Components: a Stop Hook for session capture, the Gemini API for work log summaries, and launchd for automation
- Session capture fields: git status, commit history, user conversation records, and project metadata
- Work log categories: one-line summary, attempted, worked, did not work, next steps, and content seeds (ideas worth turning into posts)
- Dependencies: macOS, Claude Code, and Obsidian. Gemini is optional.
- Setup time: 15 minutes with the one-click setup.sh script
Each capture item serves a different purpose. Git status and commit history record what changed in the codebase. The conversation record preserves the reasoning and questions that led to those changes. Project metadata ties each entry to a specific project, so notes stay organized when you work across several repositories. The work log categories push the daily summary beyond a list of commits. “Attempted,” “worked,” and “did not work” capture the path, including dead ends, which are often the most useful part to revisit later.
Insights
The source note makes five points about why the system is designed the way it is.
-
Zero friction is the core requirement. The note states that a plan to organize notes later will fail every time. Its conclusion is that automatic capture at session end is the only reliable solution. Manual systems depend on discipline at the moment when discipline is hardest to maintain.
-
Markdown is the best format. Markdown is not tied to any application. You can search it with grep, track it with git, and link notes together with Obsidian’s backlinks and graph view. Those properties matter over years, because the records remain readable and portable even if the tools change.
-
LLM summarization is practical. When git commits and session conversations are passed to Gemini, a summary of what was done appears automatically. The note says this saves substantial time compared with manual summarization. It does not provide a measured figure for the time saved, so the claim rests on the author’s experience rather than on a benchmark.
-
Adoption can be gradual. You can start with session capture alone, then add the work log, and later build a wiki compilation step. The system does not require all three parts on day one.
-
n8n is optional. launchd on macOS or cron on Linux is enough for scheduling. Leaving out n8n lowers the barrier to entry.
Taken together, these points show a clear priority order. Capture comes first, because without raw records nothing else can work. Summarization adds value on top of those records. Organization and linking come last, and they improve as the archive grows.
Hook configuration and setup
The capture step uses Claude Code’s Stop Hook. Claude Code supports hooks that run shell commands at points in a session, including session start and end and before and after tool use. The Stop Hook runs when a session ends. The note’s configuration runs a script asynchronously, so the session is not blocked while the files are written. The stack lists a 30-second timeout for the hook.
To register the hook, add the following to your Claude Code settings file:
{
"hooks": {
"Stop": [{
"hooks": [{
"type": "command",
"command": "bash ~/.claude/save-session-to-obsidian.sh",
"async": true
}]
}]
}
}
When a session ends, the script performs three steps. First, it collects traces of the work by running git status and git log. Second, it extracts the conversation history from the history file at ~/.claude/history.jsonl. Third, it structures the results as Markdown and saves them to the Obsidian vault. If you add the Gemini API, the pipeline also generates a daily work log that summarizes the day’s sessions.
The stack is built from common tools. The scripts use Bash and Python with no external dependencies. Session capture relies on the Stop Hook. Gemini 2.5 Flash handles the optional work log summaries. launchd on macOS or cron on Linux handles scheduling. To install the project, clone the repository and run the setup script:
git clone https://github.com/ggplab/claude-obsidian-knowledgebase.git
cd claude-obsidian-knowledgebase
bash scripts/setup.sh # 15분 셋업
The final line of that block contains a Korean comment that means “15-minute setup.” The comment is translated here as “15-minute setup” for clarity, and the command itself is unchanged. The repository’s docs/ folder contains more detailed guides. The session capture behavior is documented in 03-session-capture.md. The Gemini prompt structure for the work log is in 04-daily-worklog.md. The Codex CLI wrapper, n8n integration, and Linux configuration are in 05-advanced.md.
Publishing drafts
The source note also prepared three short LinkedIn posts, each written for a different audience. One targeted general AI users who work with these tools every day, with the message that conversations disappear unless something saves them. A second targeted people interested in personal knowledge management, with the message that relying on willpower to organize notes fails and that the system should do the recording automatically. A third targeted engineers and framed the Stop Hook as a way to extend a development workflow. All three point to the same GitHub repository. The drafts are useful mainly as a reminder that the same system can be explained at different levels of technical detail.
Sources
- Andrej Karpathy, LLM knowledge base methodology: https://x.com/karpathy
- Claude Code Hooks documentation: https://docs.anthropic.com/en/docs/claude-code/hooks
- Gemini API (Google AI Studio): https://aistudio.google.com/
- Public repository: https://github.com/ggplab/claude-obsidian-knowledgebase
Bottom line
The evidence in the note supports a clear conclusion: automatic session capture is the foundation of a personal knowledge system built around AI coding tools. The Stop Hook removes the need for a separate note-taking habit, and Markdown in an Obsidian vault keeps the records searchable and portable. The Gemini work log adds a useful daily summary but is optional, and the note offers no measured data on how much time it saves. Start with capture alone, confirm that the records accumulate without effort, and add the work log only when the archive is worth summarizing.
Frequently asked questions
- Does the pipeline work without a Gemini API key?
- Yes. Gemini is optional. Session capture runs on the Claude Code Stop Hook and saves git status, commit history, and conversation records to Obsidian without it. Only the daily work log summary requires Gemini.
- What do I need to run this setup?
- You need macOS, Claude Code, and Obsidian. Gemini is optional. Setup runs from the setup.sh script and takes about 15 minutes. On Linux, cron replaces launchd for scheduling, and the advanced docs cover that configuration.
BuildnWrite helps teams build AI agents that keep running. About BuildnWrite ›