Skip to content

albireo3754/agentlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

52 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

AgentLog

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 ~/Obsidian

Install it once, start using Claude Code, and your Daily Note fills itself.

What It Does

Claude Code hook / Codex notify โ†’ Daily Note append

Why AgentLog

  • 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 -->
- - - - [[ses_a1b2c3d4]]
- 10:53 start building agentlog
- 11:07 open the spec document
- - - - [[ses_e5f6a7b8]]
- 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)
- - - - [[ses_...]] Session boundary (Obsidian wiki-link)
- HH:MM prompt Individual log entry

No manual logging. No copy-paste. No AI summarization overhead.

Install

# With Bun
bun add -g @albireo3754/agentlog

# With npm
npm install -g @albireo3754/agentlog

# Then configure your vault
agentlog init ~/path/to/vault

AgentLog registers the Claude Code hook as agentlog hook, so the agentlog binary must remain available on your PATH after setup.

Requirements

Usage

Setup

Unified CLI:

# Claude Code
agentlog init ~/Obsidian

# Codex
agentlog init --codex ~/Obsidian

# Claude + Codex
agentlog init --all ~/Obsidian

# Plain folder
agentlog init --plain ~/notes

agentlog init does two things:

  1. Creates ~/.agentlog/config.json with your vault path
  2. Registers a hook in ~/.claude/settings.json

Run agentlog init without arguments to auto-detect installed vaults.

agentlog init --codex:

  1. Verifies that Codex CLI is installed and available in PATH
  2. Creates or updates ~/.agentlog/config.json
  3. Registers notify = ["agentlog", "codex-notify"] in ~/.codex/config.toml
  4. Preserves an existing Codex notify command for runtime forwarding

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.

That's It

Use Claude Code or Codex normally. Claude prompts are logged at prompt-submit time; Codex entries are logged when the turn completes because notify currently fires on agent-turn-complete.

How It Works

  1. Claude Code fires UserPromptSubmit, or Codex invokes notify on agent-turn-complete
  2. AgentLog extracts the latest user-visible input and sanitizes it
  3. Finds your Daily Note via obsidian daily:path (Obsidian CLI 1.12+). If that fails, it falls back to {vault}/Daily/YYYY-MM-DD-<Korean weekday>.md
  4. Finds or creates a ## AgentLog section
  5. Finds or creates a #### project subsection matching the current working directory
  6. Inserts a session divider [[ses_...]] if the session changed, then appends the entry
  7. Updates the > ๐Ÿ• latest-entry line at the top of the section

Total overhead: < 50ms per prompt. Fire-and-forget, never blocks Claude Code.

Daily Note Format

Obsidian Mode (default)

AgentLog resolves the Daily Note path via obsidian daily:path when the Obsidian CLI is available (1.12+). If the CLI is unavailable or Obsidian is not running, it falls back to {vault}/Daily/YYYY-MM-DD-<Korean weekday>.md such as 2026-03-01-์ผ.md.

Each working directory gets its own #### project subsection. Session changes insert a [[ses_...]] wiki-link divider. 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 -->
- - - - [[ses_a1b2c3d4]]
- 10:53 start building agentlog
- 11:07 open the spec document

#### 14:00 ยท kotlin/message-gate
<!-- cwd=/Users/you/work/kotlin/message-gate -->
- - - - [[ses_e5f6a7b8]]
- 14:00 adjust the API response
- 14:30 run tests

Plain Mode

With --plain, entries go to {folder}/YYYY-MM-DD.md:

# 2026-03-02
- 10:53 start building agentlog

CLI Reference

Current CLI:

Command Description
agentlog init [vault] [--plain] [--claude|--codex|--all] Configure vault and install integrations. --claude (default): Claude hook, --codex: Codex notify, --all: both
agentlog detect List detected Obsidian vaults and CLI status
agentlog codex-debug <prompt> Run codex exec "<prompt>" with notify auto-registered
agentlog doctor Run health checks for the binary, vault, hook, and Obsidian CLI. Also checks Codex notify status if configured
agentlog open Open today's Daily Note in Obsidian (requires CLI 1.12+)
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 notify only, --all: Remove both
agentlog hook Invoked automatically by Claude Code (not for direct use)
agentlog codex-notify Invoked automatically by Codex (not for direct use)

Configuration

~/.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
codexNotifyRestore unset Previous Codex notify command. Used to forward/restore on Codex uninstall

Environment variables:

Variable Description
AGENTLOG_CONFIG_DIR Override the config directory (default: ~/.agentlog)
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๋ฅผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Uninstall

Claude-only uninstall:

agentlog uninstall

This removes the hook from ~/.claude/settings.json and deletes ~/.agentlog/.

Codex-only uninstall:

agentlog uninstall --codex

Or remove both integrations:

agentlog uninstall --all

Codex ์ƒํƒœ ํ™•์ธ์€ ๋ณ„๋„ ๋ช…๋ น ๋Œ€์‹  ๊ธฐ์กด agentlog doctor์— ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

Development

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.

# 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

Roadmap

  • Phase 2: Obsidian plugin with timeline visualization UI
  • Phase 3: Git log integration (commits โ†’ Daily Note)
  • Future: agentlog run command for session replay from JSONL captures

License

MIT