Skip to main content

Auto-generate work diaries from Claude Code sessions

Project description

๐Ÿ““ Claude Code Working Diary

Your Claude Code sessions, automatically documented.

CI License: MIT Python 3.8+ Zero Dependencies

ํ•œ๊ตญ์–ด | English

โš ๏ธ This is a community project, not officially affiliated with Anthropic.

Every Claude Code session you run is full of valuable work โ€” tasks completed, files changed, bugs fixed. But when the session ends, that context disappears. claude-diary captures it all automatically.

pip install claude-diary && claude-diary init  # That's it. You're done.

claude-diary demo

How It Works

Claude Code session ends
        โ”‚
        โ–ผ
  Stop Hook fires automatically
        โ”‚
        โ–ผ
  Parses transcript โ†’ extracts tasks, files, commands, git info
        โ”‚
        โ–ผ
  ~/working-diary/2026-03-24.md  โ† auto-generated diary entry

Zero config needed. Every session end triggers the hook, analyzes what you did, and appends a structured Markdown entry to today's diary.

Supported Platforms

Platform Python Auto Diary Weekly Summary Cron
macOS python3 โœ… โœ… โœ…
Linux python3 โœ… โœ… โœ…
Windows (Git Bash) python โœ… โœ… โŒ (Use Task Scheduler)

What Gets Logged

Item Description
๐Ÿ“‹ Task Requests What the user asked Claude to do
๐Ÿ“„ Files Created List of newly created files
โœ๏ธ Files Modified List of edited files
โšก Key Commands Important shell commands executed
๐Ÿ“ Work Summary Summary of AI-performed tasks
โš ๏ธ Issues Errors or problems encountered

Installation

Option 1: pip (Recommended)

pip install claude-diary
claude-diary init

Option 2: Claude Code Plugin

# Inside Claude Code
/plugin marketplace add https://github.com/solzip/claude-code-hooks-diary
/plugin install working-diary

Option 3: Manual Install

git clone https://github.com/solzip/claude-code-hooks-diary.git
cd claude-code-hooks-diary/working-diary-system
./install.sh

After installation:

  • Stop Hook registered (auto-runs on session end)
  • ~/working-diary/ directory created
  • Config file generated

Directory Structure

~/working-diary/
โ”œโ”€โ”€ 2026-03-15.md          โ† Daily diary
โ”œโ”€โ”€ 2026-03-16.md
โ”œโ”€โ”€ 2026-03-17.md
โ”œโ”€โ”€ .session_counts.json    โ† Internal counter (auto)
โ”œโ”€โ”€ .gitignore
โ””โ”€โ”€ weekly/
    โ”œโ”€โ”€ W11_2026-03-09.md   โ† Weekly summary report
    โ””โ”€โ”€ W12_2026-03-16.md

Manual Diary โ€” /diary Slash Command

For when you want to record an entry mid-session without waiting for the Stop Hook. Coexists with the auto diary and lives at a separate, project-organized path.

~/working-diary/manual/
โ””โ”€โ”€ 2026-04-29/
    โ””โ”€โ”€ claude-code-hooks-diary/
        โ””โ”€โ”€ 2026-04-29.md      โ† appended on subsequent calls within the same day/project

Usage:

  • Inside a Claude Code session: type /diary โ€” reads the current cwd's transcript and writes the entry
  • Or from the terminal: claude-diary write

claude-diary install installs ~/.claude/commands/diary.md so /diary works in every project. Re-run it once if you installed before this feature shipped (it's idempotent). claude-diary uninstall removes it (preserves user-modified files).

Diary Example

# ๐Ÿ““ Work Diary โ€” 2026-03-17 (Tue)

> This file is auto-generated by Claude Code Stop Hook.
> Work content is automatically recorded at the end of each session.

---

### โฐ 09:32:15 | ๐Ÿ“ `ai-chatbot`

**๐Ÿ“‹ Task Requests:**
  1. Implement circuit breaker pattern in WebSocket handler
  2. Update error code definitions

**๐Ÿ“„ Files Created:**
  - `.../handler/CircuitBreakerHandler.java`

**โœ๏ธ Files Modified:**
  - `.../config/WebSocketConfig.java`
  - `.../constant/ErrorCode.java`

**โšก Key Commands:**
  - `./gradlew test`
  - `./gradlew bootRun`

**๐Ÿ“ Work Summary:**
  - Circuit breaker pattern implemented in WebSocket handler
  - Added 3-state transition logic (CLOSEDโ†’OPENโ†’HALF_OPEN)

Configuration

Environment Variable Description Default
CLAUDE_DIARY_LANG Diary language (ko or en) ko
CLAUDE_DIARY_DIR Auto diary storage path ~/working-diary
CLAUDE_DIARY_MANUAL_DIR Manual diary (/diary) storage path ~/working-diary/manual
CLAUDE_DIARY_TZ_OFFSET UTC offset 9 (KST)
# Add to ~/.bashrc or ~/.zshrc
export CLAUDE_DIARY_LANG="en"
export CLAUDE_DIARY_DIR="$HOME/working-diary"
export CLAUDE_DIARY_TZ_OFFSET="-5"  # EST (UTC-5)

Windows environment variables:

# PowerShell (persistent)
[Environment]::SetEnvironmentVariable("CLAUDE_DIARY_LANG", "en", "User")
[Environment]::SetEnvironmentVariable("CLAUDE_DIARY_DIR", "$env:USERPROFILE\working-diary", "User")

CLI Commands

claude-diary write                        # Write current session diary on demand (also via `/diary` slash command)
claude-diary search "keyword"             # Keyword search
claude-diary filter --project my-app      # Filter by project
claude-diary trace src/main.py            # File change history
claude-diary stats                        # Terminal dashboard
claude-diary weekly                       # Weekly summary
claude-diary dashboard                    # HTML dashboard
claude-diary audit                        # Security audit log
claude-diary audit --verify               # Source code integrity check
claude-diary config                       # View settings
claude-diary team stats                   # Team statistics
claude-diary team weekly                  # Team weekly report

Features

Feature Description
Auto Categories feature/bugfix/refactor/docs/test/config/style auto-tagging
Git Integration Branch, commits, diff stats (+/- lines) auto-recorded
Secret Scanning Passwords, API keys, tokens auto-masked (11+ patterns)
Search Index Fast search across months of diary files
5 Exporters Notion, Slack, Discord, Obsidian, GitHub plugins
HTML Dashboard GitHub-style heatmap, offline charts (zero CDN)
Security Audit Audit log, SHA-256 checksum tamper detection
Team Mode Access control, central Git repo, team reports

Requirements

  • Python 3.8+ (python3 or python)
  • Claude Code (with hooks support)
  • Zero external dependencies (core), no API tokens required

Tips

Add to your CLAUDE.md for better diary entries:

## Work Diary
- Work content is automatically recorded when the session ends
- Please output clear summaries when completing/implementing/fixing tasks

FAQ

"Isn't git log enough?"

git log records what you committed. claude-diary records what you tried, asked for, and debugged โ€” including sessions where you didn't commit anything. It captures the original prompts ("implement JWT auth"), commands run, errors encountered, and time spent. Think of it as the gap between your commit history and your actual workday.

"Does it work with Cursor / Windsurf / Copilot?"

Not yet โ€” currently Claude Code only (via Stop Hook). But the core pipeline just needs session_id + transcript + cwd, so adding other AI IDEs is architecturally straightforward. See roadmap below.

"Why JSON index instead of SQLite?"

The current JSON index is simple and has zero dependencies. SQLite (which is in Python's stdlib) is planned for v5.0 to enable full-text search and faster queries across months of data.

Roadmap

Phase Goal Version Status
A Personal productivity (categories, Git, CLI, plugins, dashboard) v2.0.0 โœ… Done
B Open source community (security, 420+ tests, CI/CD) v3.0.0 โœ… Done
C Team/company tool (access control, central repo, team reports) v4.0.0 โœ… Done
D Distribution (plugin, PyPI, marketplace) v4.1.0 โœ… Done
E Multi-IDE support (Cursor, Windsurf, VS Code extension) v5.0.0 ๐Ÿ“‹ Planned
F SQLite index + full-text search + analytics API v5.1.0 ๐Ÿ“‹ Planned

See docs/plans/ for detailed roadmaps.

License

MIT License โ€” LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_diary-4.2.0.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_diary-4.2.0-py3-none-any.whl (61.6 kB view details)

Uploaded Python 3

File details

Details for the file claude_diary-4.2.0.tar.gz.

File metadata

  • Download URL: claude_diary-4.2.0.tar.gz
  • Upload date:
  • Size: 88.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_diary-4.2.0.tar.gz
Algorithm Hash digest
SHA256 0bf6f4a1378fa259c3f226418cd83604781b77883da7dfcca5e0f6d3895f35bc
MD5 aeea121888b806d79b83f83592a467b2
BLAKE2b-256 113d19eb088e167577af3e79bba460a311253e968620afe850cc531538fc77c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_diary-4.2.0.tar.gz:

Publisher: release.yml on solzip/claude-code-hooks-diary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_diary-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: claude_diary-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 61.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_diary-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 beb37864de115d1cfb7f47fa269076b79b43835c229807e419856c744af2f965
MD5 408d44e2f2ed89a982132281c9c9aec7
BLAKE2b-256 37cf11297fdb5a07b6d0b7ccdba8811c56f1aa41a2766c2f7bcaf37fb24d8759

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_diary-4.2.0-py3-none-any.whl:

Publisher: release.yml on solzip/claude-code-hooks-diary

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page