🇷🇺 Русский | English | 🇨🇳 中文
Automatic session logging for Claude Code into an Obsidian vault.
Work with Claude Code in any project — session logs are automatically saved to Obsidian as markdown notes.
You work with Claude Code (any project)
│
▼
PostToolUse hook → counts tool invocations
│
▼ (5+ invocations = substantial session)
Stop hook → reminds Claude to write a detailed log
│
▼
Claude writes a log → sessions/2024-03-15_14-30_my-project.md
│
▼
SessionEnd hook → creates a draft if Claude didn't write one
│
▼
Open Obsidian → see the history of all sessions
- What was done (specific actions)
- Which files were changed
- Key decisions and reasoning
- TODOs for next time
- Tags for search (#project, #topic)
- Node.js v18+
- Claude Code CLI
- Obsidian (recommended but not required — logs are just .md files)
- Bash (Git Bash on Windows, built-in on macOS/Linux)
git clone https://github.com/paradoxcalm/claude-code-to-obsidian.git
cd claude-obsidian-logger
bash install.shThe installer will ask for your Obsidian vault path and handle everything automatically:
- Creates the folder structure in the vault
- Installs hook scripts
- Configures
~/.claude/settings.json - Adds instructions to
~/.claude/CLAUDE.md
bash install.sh ~/Documents/MyVaultbash install.sh /c/Users/YourName/Documents/MyVaultMyVault/
├── CLAUDE.md # Rules for working with the vault
├── .claude/
│ └── skills/
│ └── obsidian-logger/
│ └── SKILL.md # Vault operation skills
├── sessions/ # ← Session logs (automatic)
│ ├── 2024-03-15_14-30_my-project.md
│ ├── 2024-03-15_16-00_other-project.md
│ └── README.md
├── daily/ # Daily notes
├── notes/ # Notes and ideas
├── projects/ # Projects
├── archive/ # Archive
├── templates/ # Templates (daily, meeting, project)
└── scripts/ # Hook scripts
├── log-session.sh
├── log-tools.sh
└── session-reminder.sh
| Hook | Event | What it does |
|---|---|---|
PostToolUse |
Every tool invocation | Appends a line to .tool-log-DATE.txt (counter) |
Stop |
Claude finished responding | If 5+ tool calls and no log written — injects a [AUTOLOG] reminder into the context |
SessionEnd |
Exiting the session | Creates a log draft if Claude didn't write a detailed one |
- Short sessions (< 5 tool calls) — no action, no spam
- Long sessions — Claude writes a detailed log on its own
- Duplicate protection — a marker file
.logged-SESSION_IDprevents repeated reminders
# Session: Added OAuth Authorization
**Date:** 2024-03-15 14:30
**Project:** my-app
**Directory:** /home/user/projects/my-app
## What Was Done
- Added OAuth2 flow via Google
- Created users table in the database
- Wrote tests for auth middleware
## Changed Files
- `src/auth/oauth.ts` — new authorization module
- `src/db/migrations/001_users.sql` — migration
- `src/middleware/auth.ts` — token verification middleware
- `tests/auth.test.ts` — tests
## Key Decisions
- Chose OAuth over JWT — client requirement
- Refresh token stored in httpOnly cookie
## TODO
- [ ] Add GitHub authorization
- [ ] Rate limiting on /auth endpoints
#session #my-app #auth #oauthAfter installation, .obsidian-logger.json is created in the vault:
{
"min_tool_calls": 5,
"log_retention_days": 30,
"language": "en",
"canvas": false,
"daily_notes": true,
"stale_threshold_days": 5
}| Parameter | Default | Description |
|---|---|---|
min_tool_calls |
5 |
Minimum tool calls to trigger the AUTOLOG reminder |
log_retention_days |
30 |
Days before deleting technical files (.tool-log-*, .logged-*, .reminded-*) |
language |
ru |
Language of logs and reminders (ru, en, zh) |
canvas |
false |
Visual project map in Obsidian Canvas format (.canvas) |
daily_notes |
true |
Automatically record sessions in daily notes |
stale_threshold_days |
5 |
Days without activity before a "stale project" warning |
project_roots |
{} |
Manual mapping of directory paths to project names |
context_injection |
true |
Enable/disable automatic context injection on session start |
bash uninstall.shRemoves hooks from settings.json and the section from CLAUDE.md. Your vault and notes are not deleted.
- Dataview — SQL-like queries across your notes
- Tasks — task management
- Templater — advanced templates
All sessions from the last week:
```dataview
TABLE file.cday as "Date"
FROM "sessions"
WHERE file.cday >= date(today) - dur(7 days)
SORT file.cday DESC
```All TODOs from sessions:
```dataview
TASK FROM "sessions"
WHERE !completed
```Q: Does it work on macOS / Linux? A: Yes. The scripts are written in bash + node and work everywhere.
Q: What if I don't use Obsidian? A: Logs are plain .md files. You can open them in any editor, VS Code, Notion (import), etc.
Q: Do the hooks slow down Claude Code? A: No. The scripts execute in ~50ms (writing a line to a file).
Q: Can I disable it temporarily?
A: Remove or comment out the hooks in ~/.claude/settings.json.
Q: The logs are in Russian. How do I change the language?
A: Edit ~/.claude/CLAUDE.md — replace the language instruction with your preferred language.
MIT