Metadata-Version: 2.4
Name: claude-diary
Version: 4.2.0
Summary: Auto-generate work diaries from Claude Code sessions
Author: solzip
License: MIT
Project-URL: Homepage, https://github.com/solzip/claude-code-hooks-diary
Project-URL: Repository, https://github.com/solzip/claude-code-hooks-diary
Keywords: claude-code,productivity,work-diary,automation,hooks
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: notion
Requires-Dist: requests>=2.28; extra == "notion"
Provides-Extra: all
Requires-Dist: requests>=2.28; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0; extra == "dev"
Dynamic: license-file

# 📓 Claude Code Working Diary

**Your Claude Code sessions, automatically documented.**

[![CI](https://github.com/solzip/claude-code-hooks-diary/actions/workflows/ci.yml/badge.svg)](https://github.com/solzip/claude-code-hooks-diary/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen)](https://github.com/solzip/claude-code-hooks-diary)

> [한국어](README.md) | **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.

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

<p align="center">
  <img src="docs/demo.svg" alt="claude-diary demo" width="680">
</p>

## 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)

```bash
pip install claude-diary
claude-diary init
```

### Option 2: Claude Code Plugin

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

### Option 3: Manual Install

```bash
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

```markdown
# 📓 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) |

```bash
# 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
# PowerShell (persistent)
[Environment]::SetEnvironmentVariable("CLAUDE_DIARY_LANG", "en", "User")
[Environment]::SetEnvironmentVariable("CLAUDE_DIARY_DIR", "$env:USERPROFILE\working-diary", "User")
```

## CLI Commands

```bash
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:**

```markdown
## 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/`](docs/plans/) for detailed roadmaps.

## License

MIT License — [LICENSE](LICENSE)
