Auto-log Claude Code prompts and Codex turns to Obsidian Daily Notes.
AgentLog is a local-first prompt logger for Obsidian. It captures Claude Code prompts and Codex CLI turn inputs, then appends them to today's Daily Note, grouped by project and session.
Use it as a lightweight developer journal, worklog capture layer, or the first building block for richer Daily Notes automation.
# Requires Bun (https://bun.sh) installed and available on your PATH
npm install -g @albireo3754/agentlog
agentlog init ~/ObsidianInstall it once, start using Claude Code, and your Daily Note fills itself.
Claude Code hook / Codex hook โ Daily Note append
- Local-first prompt logging with no external service required
- Obsidian Daily Notes integration that works with your existing vault
- Project and session grouping so prompts stay readable later
- Zero copy-paste overhead during normal Claude Code use
Before: You finish a 3-hour Claude Code session. Your Daily Note is empty.
After:
## AgentLog
> ๐ 11:21 โ js/agentlog โบ initialize git and open it in VS Code
#### 10:53 ยท js/agentlog
<!-- cwd=/Users/you/work/js/agentlog -->
- - - - [[claude_a1b2c3d4-1111-2222-3333-444455556666]]
- 10:53 start building agentlog
- 11:07 open the spec document
- - - - [[claude_e5f6a7b8-1111-2222-3333-444455556666]]
- 11:21 initialize git and open it in VS Code| Element | Role |
|---|---|
> ๐ HH:MM โ project โบ prompt |
Latest entry (always updated) |
#### HH:MM ยท project |
Project subsection (grouped by cwd) |
<!-- cwd=... --> |
Section matching key (hidden in Obsidian Reading view) |
- - - - [[claude_...]] / [[codex_...]] |
Session boundary (Obsidian wiki-link) |
- HH:MM prompt |
Individual log entry |
No manual logging. No copy-paste. No AI summarization overhead.
# With Bun
bun add -g @albireo3754/agentlog
# With npm
npm install -g @albireo3754/agentlog
# Then configure your vault
agentlog init ~/path/to/vaultAgentLog registers the Claude Code hook as agentlog hook, so the agentlog binary must remain available on your PATH after setup.
- Claude Code (hook integration) or Codex CLI (hook integration)
- Obsidian (Daily Note target)
- Bun (>=1.0.0) or Node.js >=20
Unified CLI:
# Claude Code
agentlog init ~/Obsidian
# Codex
agentlog init --codex ~/Obsidian
# Claude + Codex
agentlog init --all ~/Obsidian
# Plain folder
agentlog init --plain ~/notesagentlog init does two things:
- Creates
~/.agentlog/config.jsonwith your vault path - Registers or repairs a Claude Code hook in
~/.claude/settings.jsonusing the string matcher format ("matcher": "")
Run agentlog init without arguments to auto-detect installed vaults.
agentlog init --codex:
- Verifies that Codex CLI is installed and available in
PATH - Creates or updates
~/.agentlog/config.json - Registers a Codex
UserPromptSubmitcommand hook in~/.codex/hooks.json - Prints a reminder to review/trust the hook in Codex with
/hooksif prompted
The default = --all variant is intentionally not supported. agentlog init stays Claude-first for backward compatibility and to avoid failing on machines without Codex CLI.
Use Claude Code or Codex normally. Claude and Codex prompts are logged from their UserPromptSubmit hook payloads.
If hooks were disabled, untrusted, or misconfigured for part of the day, rebuild the Daily Note from local session JSONL files:
agentlog backfill # today, Claude + Codex
agentlog backfill 2026-06-19 # specific day
agentlog backfill --source codex --dry-run --format jsonBackfill scans ~/.codex/sessions/YYYY/MM/DD/*.jsonl and top-level ~/.claude/projects/**/*.jsonl, extracts user prompts only, skips subagent/tool-result noise, and appends entries that are not already present in the target Daily Note.
- Claude Code or Codex fires the
UserPromptSubmithook - AgentLog extracts the latest user-visible input and sanitizes it
- Resolves your Daily Note path from
.obsidian/daily-notes.json, thenobsidian daily:pathwhen needed - If the Daily Note is missing in Obsidian mode, asks
obsidian dailyto create it before writing so your Daily Notes template is preserved - Finds or creates a
## AgentLogsection - Finds or creates a
#### projectsubsection matching the current working directory - Inserts a source-prefixed session divider such as
[[claude_...]]or[[codex_...]]if the session changed, then appends the entry - Updates the
> ๐latest-entry line at the top of the section
Steady-state overhead is under 50ms per prompt when the Daily Note already exists. Missing-note bootstrap depends on Obsidian CLI startup. Fire-and-forget, never blocks Claude Code.
AgentLog resolves the Daily Note path from .obsidian/daily-notes.json first, then obsidian daily:path when the vault settings are unavailable or unsupported. If the resolved Daily Note is missing, AgentLog runs obsidian daily before writing and only appends after the file exists, preserving the user's Daily Notes template. Obsidian mode does not create a guessed {vault}/Daily/... fallback file; if no safe path can be resolved or the CLI cannot bootstrap a missing note, the hook fails softly and skips the write. Plain mode still writes directly to {dir}/YYYY-MM-DD.md.
Each working directory gets its own #### project subsection. Session changes insert a source-prefixed wiki-link divider such as [[claude_...]] or [[codex_...]]. The > ๐ blockquote at the top always shows the latest entry across all projects.
## AgentLog
> ๐ 14:30 โ kotlin/message-gate โบ adjust the API response
#### 10:53 ยท js/agentlog
<!-- cwd=/Users/you/work/js/agentlog -->
- - - - [[claude_a1b2c3d4-1111-2222-3333-444455556666]]
- 10:53 start building agentlog
- 11:07 open the spec document
#### 14:00 ยท kotlin/message-gate
<!-- cwd=/Users/you/work/kotlin/message-gate -->
- - - - [[codex_e5f6a7b8-1111-2222-3333-444455556666]]
- 14:00 adjust the API response
- 14:30 run testsWith --plain, entries go to {folder}/YYYY-MM-DD.md:
# 2026-03-02
- 10:53 start building agentlogCurrent CLI:
| Command | Description |
|---|---|
agentlog init [vault] [--plain] [--claude|--codex|--all] |
Configure vault and install integrations. --claude (default): Claude hook, --codex: Codex hook, --all: both |
agentlog detect |
List detected Obsidian vaults and CLI status |
agentlog backfill [date] [--source all|claude|codex] [--dry-run] [--format text|json] |
Scan local Claude/Codex session JSONL files and append missing prompts to the Daily Note |
agentlog codex-debug <prompt> |
Run codex exec "<prompt>" with Codex hook auto-registered |
agentlog doctor |
Run health checks for the binary, vault, Claude hook registration/format, and Obsidian CLI. Also checks Codex hook status if configured |
agentlog open |
Open today's Daily Note in Obsidian (requires CLI 1.12.4+) |
agentlog version |
Print AgentLog version. In dev builds, also shows channel and commit |
agentlog uninstall [-y] [--codex|--all] |
default: Remove Claude hook + config, --codex: Remove Codex hook and unregister/restore legacy ~/.codex/config.toml notify if AgentLog set it up, --all: Remove both |
agentlog hook |
Invoked automatically by Claude Code or Codex (not for direct use) |
agentlog codex-notify |
Legacy handler for older Codex notify installs |
~/.agentlog/config.json:
| Field | Default | Description |
|---|---|---|
vault |
(required) | Path to the Obsidian vault or plain output folder |
plain |
false |
Plain mode that writes simple markdown files without Obsidian integration |
claudeHookInstalled |
false |
Records that AgentLog expects the Claude hook to be installed, so doctor does not downgrade a missing Claude hook in --all installs |
codexHookInstalled |
false |
Records that AgentLog expects the Codex hook to be installed, so doctor can detect partial damage |
codexNotifyRestore |
unset | Legacy metadata for older Codex notify installs |
englishAsk |
unset | Optional Codex prompt evaluator config. Disabled unless englishAsk.enabled is true |
Example EnglishAsk config:
{
"englishAsk": {
"enabled": true,
"mode": "log-only",
"threshold": 3,
"timeoutMs": 8000
}
}When enabled, AgentLog evaluates English Codex user prompts with codex exec after writing the normal AgentLog entry. Results are appended to the same Daily Note under ## EnglishAsk. Evaluator failures and timeouts are ignored. Child evaluator runs set AGENTLOG_ENGLISHASK_EVAL=1 so AgentLog skips evaluator child notify turns.
Environment variables:
| Variable | Description |
|---|---|
AGENTLOG_CONFIG_DIR |
Override the config directory (default: ~/.agentlog) |
AGENTLOG_ENGLISHASK_EVAL |
Internal recursion guard for EnglishAsk evaluator runs |
AGENTLOG_PHASE |
Force the runtime channel (dev or prod), overriding auto-detection |
OBSIDIAN_BIN |
Override the Obsidian CLI binary path |
agentlog version์ ํ์ฌ ์คํ ์ค์ธ AgentLog์ build identity๋ฅผ ์ถ๋ ฅํฉ๋๋ค.
prod: ํค๋๋ผ์ธ๋ง ์ถ๋ ฅ
AgentLog 0.1.1
dev: ๊ฐ๋ฐ ์คํ์์ ๋ํ๋ด๋ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ์ถ๊ฐ ์ถ๋ ฅ
AgentLog 0.1.1
channel: dev
commit: <short-sha>
๊ธฐ๋ณธ ๊ท์น์ git ๋ฉํ๋ฐ์ดํฐ๊ฐ ์๋ checkout/link ์คํ์ด๋ฉด dev, ํจํค์ง ์ค์น๋ณธ์ด๋ฉด prod์
๋๋ค. ํ
์คํธ๋ ๋๋ฒ๊น
์์ channel์ ๊ณ ์ ํ๊ณ ์ถ๋ค๋ฉด AGENTLOG_PHASE=dev ๋๋ AGENTLOG_PHASE=prod๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
Claude-only uninstall:
agentlog uninstallThis removes the hook from ~/.claude/settings.json and deletes ~/.agentlog/.
Codex-only uninstall:
agentlog uninstall --codexThis removes the Codex hook and also restores or removes AgentLog's legacy notify entry in ~/.codex/config.toml when present.
Or remove both integrations:
agentlog uninstall --allCodex ์ํ ํ์ธ์ ๋ณ๋ ๋ช
๋ น ๋์ ๊ธฐ์กด agentlog doctor์ ํฌํจ๋ฉ๋๋ค.
bun install
bun test # run the test suite
bun run test:install-smoke
bun run typecheck # run tsc --noEmit
bun run build # compile to dist/ (optional)The bin entry points directly to src/cli.ts, so you do not need a build during development. Bun runs TypeScript natively.
CLI command boundaries are documented in docs/architecture/cli-layering.md.
# Link as a global command
bun link
# Edit source and run immediately
agentlog doctor
# Isolated bun link install smoke test
bun run test:install-smoke
# Watch mode
bun run dev:watch- Phase 2: Obsidian plugin with timeline visualization UI
- Phase 3: Git log integration (commits โ Daily Note)
- Future:
agentlog runcommand for session replay from JSONL captures
MIT