Auto-generate work diaries from Claude Code sessions
Project description
๐ Claude Code Working Diary
Your Claude Code sessions, automatically documented.
ํ๊ตญ์ด | 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.
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+ (
python3orpython) - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bf6f4a1378fa259c3f226418cd83604781b77883da7dfcca5e0f6d3895f35bc
|
|
| MD5 |
aeea121888b806d79b83f83592a467b2
|
|
| BLAKE2b-256 |
113d19eb088e167577af3e79bba460a311253e968620afe850cc531538fc77c9
|
Provenance
The following attestation bundles were made for claude_diary-4.2.0.tar.gz:
Publisher:
release.yml on solzip/claude-code-hooks-diary
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_diary-4.2.0.tar.gz -
Subject digest:
0bf6f4a1378fa259c3f226418cd83604781b77883da7dfcca5e0f6d3895f35bc - Sigstore transparency entry: 1399080535
- Sigstore integration time:
-
Permalink:
solzip/claude-code-hooks-diary@960600ddd199b1160f9cda02aaeb58033c50b532 -
Branch / Tag:
refs/tags/v4.2.0 - Owner: https://github.com/solzip
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@960600ddd199b1160f9cda02aaeb58033c50b532 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
beb37864de115d1cfb7f47fa269076b79b43835c229807e419856c744af2f965
|
|
| MD5 |
408d44e2f2ed89a982132281c9c9aec7
|
|
| BLAKE2b-256 |
37cf11297fdb5a07b6d0b7ccdba8811c56f1aa41a2766c2f7bcaf37fb24d8759
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_diary-4.2.0-py3-none-any.whl -
Subject digest:
beb37864de115d1cfb7f47fa269076b79b43835c229807e419856c744af2f965 - Sigstore transparency entry: 1399080541
- Sigstore integration time:
-
Permalink:
solzip/claude-code-hooks-diary@960600ddd199b1160f9cda02aaeb58033c50b532 -
Branch / Tag:
refs/tags/v4.2.0 - Owner: https://github.com/solzip
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@960600ddd199b1160f9cda02aaeb58033c50b532 -
Trigger Event:
push
-
Statement type: