claude-code-log 0.3.0__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- claude_code_log-0.3.2/.claude/settings.json.bak +38 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/.claude/settings.local.json +2 -1
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/.github/workflows/ci.yml +1 -1
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/CHANGELOG.md +19 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/CLAUDE.md +58 -16
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/PKG-INFO +30 -11
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/README.md +28 -10
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/converter.py +5 -4
- claude_code_log-0.3.2/claude_code_log/models.py +379 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/parser.py +16 -3
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/renderer.py +181 -35
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/global_styles.css +4 -2
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/message_styles.css +34 -2
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/timeline.html +85 -59
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/timeline_styles.css +13 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/transcript.html +15 -3
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/utils.py +11 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/justfile +4 -1
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/pyproject.toml +4 -1
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/uv.lock +357 -1
- claude_code_log-0.3.0/claude_code_log/models.py +0 -222
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/.github/workflows/docs.yml +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/.gitignore +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/LICENSE +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/__init__.py +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/cli.py +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/py.typed +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/filter_styles.css +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/project_card_styles.css +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/session_nav.html +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/session_nav_styles.css +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/components/todo_styles.css +0 -0
- {claude_code_log-0.3.0 → claude_code_log-0.3.2}/claude_code_log/templates/index.html +0 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"hooks": {
|
|
3
|
+
"PostToolUse": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "uv run ruff format"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"Stop": [
|
|
15
|
+
{
|
|
16
|
+
"matcher": "",
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "uv run ruff check --fix"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "command",
|
|
24
|
+
"command": "uv run ty check"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "command",
|
|
28
|
+
"command": "uv run pyright"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "command",
|
|
32
|
+
"command": "uv run pytest"
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
run: uv python install ${{ matrix.python-version }}
|
|
25
25
|
|
|
26
26
|
- name: Install dependencies
|
|
27
|
-
run: uv sync --all-extras --dev
|
|
27
|
+
run: uv sync --all-extras --dev && uv run playwright install chromium
|
|
28
28
|
|
|
29
29
|
- name: Run tests with coverage
|
|
30
30
|
run: uv run pytest --cov=claude_code_log --cov-report=xml --cov-report=html --cov-report=term
|
|
@@ -6,6 +6,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
## [0.3.2] - 2025-07-03
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Fix initial message lookup for session boxes + only show one hour of timeline to decrease initialisation time**
|
|
14
|
+
- **Fix lint issue**
|
|
15
|
+
- **Fix sidechain issues in timeline and add to filters + add Playwright browser testing**
|
|
16
|
+
- **Docs update**
|
|
17
|
+
- **Use Anthropic Python SDK for parsing types + handle sub-assistant and system messages**
|
|
18
|
+
- **Fix broken test + add ty and fix type errors**
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
## [0.3.1] - 2025-07-01
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- **Timeline tooltips + dead code cleanup**
|
|
26
|
+
|
|
27
|
+
|
|
9
28
|
## [0.3.0] - 2025-06-29
|
|
10
29
|
|
|
11
30
|
### Changed
|
|
@@ -8,25 +8,58 @@ This tool processes Claude Code transcript files (stored as JSONL) and generates
|
|
|
8
8
|
|
|
9
9
|
## Key Features
|
|
10
10
|
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
11
|
+
- **Project Hierarchy Processing**: Process entire `~/.claude/projects/` directory with linked index page
|
|
12
|
+
- **Individual Session Files**: Generate separate HTML files for each session with navigation links
|
|
13
|
+
- **Single File or Directory Processing**: Convert individual JSONL files or specific directories
|
|
13
14
|
- **Session Navigation**: Interactive table of contents with session summaries and quick navigation
|
|
14
15
|
- **Token Usage Tracking**: Display token consumption for individual messages and session totals
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
16
|
+
- **Runtime Message Filtering**: JavaScript-powered filtering to show/hide message types (user, assistant, system, tool use, etc.)
|
|
17
|
+
- **Chronological Ordering**: All messages sorted by timestamp across sessions
|
|
18
|
+
- **Cross-Session Summary Matching**: Properly match async-generated summaries to their original sessions
|
|
17
19
|
- **Date Range Filtering**: Filter messages by date range using natural language (e.g., "today", "yesterday", "last week")
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
20
|
-
- **
|
|
20
|
+
- **Rich Message Types**: Support for user/assistant messages, tool use/results, thinking content, images
|
|
21
|
+
- **System Command Visibility**: Show system commands (like `init`) in expandable details with structured parsing
|
|
22
|
+
- **Markdown Rendering**: Server-side markdown rendering with syntax highlighting using mistune
|
|
23
|
+
- **Interactive Timeline**: Optional vis-timeline visualization showing message chronology across all types, with click-to-scroll navigation (implemented in JavaScript within the HTML template)
|
|
24
|
+
- **Floating Navigation**: Always-available back-to-top button and filter controls
|
|
25
|
+
- **Space-Efficient Layout**: Compact design optimised for content density
|
|
21
26
|
- **CLI Interface**: Simple command-line tool using Click
|
|
22
27
|
|
|
23
28
|
## Usage
|
|
24
29
|
|
|
30
|
+
### Default Behavior (Process All Projects)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Process all projects in ~/.claude/projects/ (default behavior)
|
|
34
|
+
claude-code-log
|
|
35
|
+
|
|
36
|
+
# Explicitly process all projects
|
|
37
|
+
claude-code-log --all-projects
|
|
38
|
+
|
|
39
|
+
# Process all projects and open in browser
|
|
40
|
+
claude-code-log --open-browser
|
|
41
|
+
|
|
42
|
+
# Process all projects with date filtering
|
|
43
|
+
claude-code-log --from-date "yesterday" --to-date "today"
|
|
44
|
+
claude-code-log --from-date "last week"
|
|
45
|
+
|
|
46
|
+
# Skip individual session files (only create combined transcripts)
|
|
47
|
+
claude-code-log --no-individual-sessions
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This creates:
|
|
51
|
+
|
|
52
|
+
- `~/.claude/projects/index.html` - Master index with project cards and statistics
|
|
53
|
+
- `~/.claude/projects/project-name/combined_transcripts.html` - Individual project pages
|
|
54
|
+
- `~/.claude/projects/project-name/session-{session-id}.html` - Individual session pages
|
|
55
|
+
|
|
56
|
+
### Single File or Directory Processing
|
|
57
|
+
|
|
25
58
|
```bash
|
|
26
59
|
# Single file
|
|
27
60
|
claude-code-log transcript.jsonl
|
|
28
61
|
|
|
29
|
-
#
|
|
62
|
+
# Specific directory
|
|
30
63
|
claude-code-log /path/to/transcript/directory
|
|
31
64
|
|
|
32
65
|
# Custom output location
|
|
@@ -37,8 +70,6 @@ claude-code-log /path/to/directory --open-browser
|
|
|
37
70
|
|
|
38
71
|
# Filter by date range (supports natural language)
|
|
39
72
|
claude-code-log /path/to/directory --from-date "yesterday" --to-date "today"
|
|
40
|
-
claude-code-log /path/to/directory --from-date "last week"
|
|
41
|
-
claude-code-log /path/to/directory --to-date "2025-06-01"
|
|
42
73
|
claude-code-log /path/to/directory --from-date "3 days ago" --to-date "yesterday"
|
|
43
74
|
```
|
|
44
75
|
|
|
@@ -47,7 +78,7 @@ claude-code-log /path/to/directory --from-date "3 days ago" --to-date "yesterday
|
|
|
47
78
|
- `claude_code_log/parser.py` - Data extraction and parsing from JSONL files
|
|
48
79
|
- `claude_code_log/renderer.py` - HTML generation and template rendering
|
|
49
80
|
- `claude_code_log/converter.py` - High-level conversion orchestration
|
|
50
|
-
- `claude_code_log/cli.py` - Command-line interface
|
|
81
|
+
- `claude_code_log/cli.py` - Command-line interface with project discovery
|
|
51
82
|
- `claude_code_log/models.py` - Pydantic models for transcript data structures
|
|
52
83
|
- `claude_code_log/templates/` - Jinja2 HTML templates
|
|
53
84
|
- `transcript.html` - Main transcript viewer template
|
|
@@ -58,13 +89,14 @@ claude-code-log /path/to/directory --from-date "3 days ago" --to-date "yesterday
|
|
|
58
89
|
|
|
59
90
|
The project uses:
|
|
60
91
|
|
|
61
|
-
- Python 3.12+
|
|
62
|
-
- Click for CLI interface
|
|
63
|
-
- Pydantic for data
|
|
92
|
+
- Python 3.12+ with uv package management
|
|
93
|
+
- Click for CLI interface and argument parsing
|
|
94
|
+
- Pydantic for robust data modelling and validation
|
|
64
95
|
- Jinja2 for HTML template rendering
|
|
65
96
|
- dateparser for natural language date parsing
|
|
66
97
|
- Standard library for JSON/HTML processing
|
|
67
|
-
-
|
|
98
|
+
- Minimal dependencies for portability
|
|
99
|
+
- mistune for quick Markdown rendering
|
|
68
100
|
|
|
69
101
|
## Development Commands
|
|
70
102
|
|
|
@@ -76,6 +108,12 @@ Run tests with:
|
|
|
76
108
|
uv run pytest
|
|
77
109
|
```
|
|
78
110
|
|
|
111
|
+
The test suite includes both unit tests and browser-based integration tests using Playwright. Timeline functionality is tested in real browsers to ensure JavaScript components work correctly. Playwright tests require Chromium to be installed:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
uv run playwright install chromium
|
|
115
|
+
```
|
|
116
|
+
|
|
79
117
|
### Test Coverage
|
|
80
118
|
|
|
81
119
|
Generate test coverage reports:
|
|
@@ -97,7 +135,7 @@ HTML coverage reports are generated in `htmlcov/index.html`.
|
|
|
97
135
|
|
|
98
136
|
- **Format code**: `ruff format`
|
|
99
137
|
- **Lint and fix**: `ruff check --fix`
|
|
100
|
-
- **Type checking**: `uv run pyright`
|
|
138
|
+
- **Type checking**: `uv run pyright` and `uv run ty check`
|
|
101
139
|
|
|
102
140
|
### Testing & Style Guide
|
|
103
141
|
|
|
@@ -138,3 +176,7 @@ Uses Jinja2 templates for HTML generation:
|
|
|
138
176
|
- **Summary Attachment**: Links session summaries via leafUuid -> message UUID -> session ID mapping
|
|
139
177
|
- **Timestamp Tracking**: Records first and last timestamp for each session
|
|
140
178
|
- **Navigation**: Generates clickable ToC with session previews and metadata
|
|
179
|
+
|
|
180
|
+
### Timeline Component
|
|
181
|
+
|
|
182
|
+
The interactive timeline is implemented in JavaScript within `claude_code_log/templates/components/timeline.html`. It parses message types from CSS classes generated by the Python renderer. **Important**: When adding new message types or modifying CSS class generation in `renderer.py`, ensure the timeline's message type detection logic is updated accordingly to maintain feature parity. Also, make sure that the filter is still applied consistently to the messages both in the main transcript and in the timeline. You can use Playwright to test browser runtime features.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: claude-code-log
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.2
|
|
4
4
|
Summary: Convert Claude Code transcript JSONL files to HTML
|
|
5
5
|
Project-URL: Homepage, https://github.com/daaain/claude-code-log
|
|
6
6
|
Project-URL: Issues, https://github.com/daaain/claude-code-log/issues
|
|
@@ -10,6 +10,7 @@ License-File: LICENSE
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Requires-Python: >=3.12
|
|
13
|
+
Requires-Dist: anthropic>=0.56.0
|
|
13
14
|
Requires-Dist: click>=8.0.0
|
|
14
15
|
Requires-Dist: dateparser>=1.0.0
|
|
15
16
|
Requires-Dist: jinja2>=3.0.0
|
|
@@ -48,15 +49,28 @@ uvx claude-code-log --open-browser
|
|
|
48
49
|
- **Token Usage Tracking**: Display token consumption for individual messages and session totals
|
|
49
50
|
- **Runtime Message Filtering**: JavaScript-powered filtering to show/hide message types (user, assistant, system, tool use, etc.)
|
|
50
51
|
- **Chronological Ordering**: All messages sorted by timestamp across sessions
|
|
52
|
+
- **Interactive timeline**: Generate an interactive, zoomable timeline grouped by message times to navigate conversations visually
|
|
51
53
|
- **Cross-Session Summary Matching**: Properly match async-generated summaries to their original sessions
|
|
52
54
|
- **Date Range Filtering**: Filter messages by date range using natural language (e.g., "today", "yesterday", "last week")
|
|
53
55
|
- **Rich Message Types**: Support for user/assistant messages, tool use/results, thinking content, images
|
|
54
56
|
- **System Command Visibility**: Show system commands (like `init`) in expandable details with structured parsing
|
|
55
57
|
- **Markdown Rendering**: Server-side markdown rendering with syntax highlighting using mistune
|
|
56
58
|
- **Floating Navigation**: Always-available back-to-top button and filter controls
|
|
57
|
-
- **Space-Efficient Layout**: Compact design optimized for content density
|
|
58
59
|
- **CLI Interface**: Simple command-line tool using Click
|
|
59
60
|
|
|
61
|
+
## What Problems Does This Solve?
|
|
62
|
+
|
|
63
|
+
This tool helps you answer questions like:
|
|
64
|
+
|
|
65
|
+
- **"How can I review all my Claude Code conversations?"**
|
|
66
|
+
- **"What did I work on with Claude yesterday/last week?"**
|
|
67
|
+
- **"How much are my Claude Code sessions costing?"**
|
|
68
|
+
- **"How can I search through my entire Claude Code history?"**
|
|
69
|
+
- **"What tools did Claude use in this project?"**
|
|
70
|
+
- **"How can I share my Claude Code conversation with others?"**
|
|
71
|
+
- **"What's the timeline of my project development?"**
|
|
72
|
+
- **"How can I analyse patterns in my Claude Code usage?"**
|
|
73
|
+
|
|
60
74
|
## Usage
|
|
61
75
|
|
|
62
76
|
### Default Behavior (Process All Projects)
|
|
@@ -71,15 +85,18 @@ claude-code-log --all-projects
|
|
|
71
85
|
# Process all projects and open in browser
|
|
72
86
|
claude-code-log --open-browser
|
|
73
87
|
|
|
74
|
-
# Process all projects with date filtering
|
|
88
|
+
# Process all projects with date filtering
|
|
75
89
|
claude-code-log --from-date "yesterday" --to-date "today"
|
|
76
90
|
claude-code-log --from-date "last week"
|
|
91
|
+
|
|
92
|
+
# Skip individual session files (only create combined transcripts)
|
|
93
|
+
claude-code-log --no-individual-sessions
|
|
77
94
|
```
|
|
78
95
|
|
|
79
96
|
This creates:
|
|
80
97
|
|
|
81
|
-
- `~/.claude/projects/index.html` -
|
|
82
|
-
- `~/.claude/projects/project-name/combined_transcripts.html` - Individual project pages
|
|
98
|
+
- `~/.claude/projects/index.html` - Top level index with project cards and statistics
|
|
99
|
+
- `~/.claude/projects/project-name/combined_transcripts.html` - Individual project pages (these can be several megabytes)
|
|
83
100
|
- `~/.claude/projects/project-name/session-{session-id}.html` - Individual session pages
|
|
84
101
|
|
|
85
102
|
### Single File or Directory Processing
|
|
@@ -239,10 +256,16 @@ Install using pip:
|
|
|
239
256
|
pip install claude-code-log
|
|
240
257
|
```
|
|
241
258
|
|
|
259
|
+
Or run directly with uvx (no installation required):
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
uvx claude-code-log
|
|
263
|
+
```
|
|
264
|
+
|
|
242
265
|
Or install from source:
|
|
243
266
|
|
|
244
267
|
```bash
|
|
245
|
-
git clone https://github.com/
|
|
268
|
+
git clone https://github.com/daaain/claude-code-log.git
|
|
246
269
|
cd claude-code-log
|
|
247
270
|
uv sync
|
|
248
271
|
uv run claude-code-log
|
|
@@ -250,14 +273,10 @@ uv run claude-code-log
|
|
|
250
273
|
|
|
251
274
|
## TODO
|
|
252
275
|
|
|
253
|
-
- **Timeline view**: Show interaction on a timeline to get a better idea on timings and parallel calls - maybe Timeline.js optionally generated runtime?
|
|
254
|
-
- document what questions does this library help answering
|
|
255
276
|
- integrate `claude-trace` request logs if present?
|
|
256
|
-
- use Anthropic's own types: <https://github.com/anthropics/anthropic-sdk-python/tree/main/src/anthropic/types> – can these be used to generate Pydantic classes though?
|
|
257
277
|
- Shortcut / command to resume a specific conversation by session ID $ claude --resume 550e8400-e29b-41d4-a716-446655440000?
|
|
258
278
|
- Localised number formatting and timezone adjustment runtime? For this we'd need to make Jinja template variables more granular
|
|
259
279
|
- get `cwd` from logs to be able to render the proper path for titles
|
|
260
|
-
- handle `"isSidechain":true` for sub-agent Tasks
|
|
261
280
|
- convert images to WebP as screenshots are often huge PNGs – this might be time consuming to keep redoing (so would also need some caching) and need heavy dependencies with compilation (unless there are fast pure Python conversation libraries? Or WASM?)
|
|
262
281
|
- add special formatting for built-in tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch
|
|
263
282
|
- render Edit / MultiEdit as diff(s)?
|
|
@@ -265,4 +284,4 @@ uv run claude-code-log
|
|
|
265
284
|
- Thinking block should have Markdown rendering as sometimes they have formatting
|
|
266
285
|
- system blocks like `init` also don't render perfectly, losing new lines
|
|
267
286
|
- add `ccusage` like daily summary and maybe some textual summary too based on Claude generate session summaries?
|
|
268
|
-
|
|
287
|
+
– import logs from @claude Github Actions
|
|
@@ -29,15 +29,28 @@ uvx claude-code-log --open-browser
|
|
|
29
29
|
- **Token Usage Tracking**: Display token consumption for individual messages and session totals
|
|
30
30
|
- **Runtime Message Filtering**: JavaScript-powered filtering to show/hide message types (user, assistant, system, tool use, etc.)
|
|
31
31
|
- **Chronological Ordering**: All messages sorted by timestamp across sessions
|
|
32
|
+
- **Interactive timeline**: Generate an interactive, zoomable timeline grouped by message times to navigate conversations visually
|
|
32
33
|
- **Cross-Session Summary Matching**: Properly match async-generated summaries to their original sessions
|
|
33
34
|
- **Date Range Filtering**: Filter messages by date range using natural language (e.g., "today", "yesterday", "last week")
|
|
34
35
|
- **Rich Message Types**: Support for user/assistant messages, tool use/results, thinking content, images
|
|
35
36
|
- **System Command Visibility**: Show system commands (like `init`) in expandable details with structured parsing
|
|
36
37
|
- **Markdown Rendering**: Server-side markdown rendering with syntax highlighting using mistune
|
|
37
38
|
- **Floating Navigation**: Always-available back-to-top button and filter controls
|
|
38
|
-
- **Space-Efficient Layout**: Compact design optimized for content density
|
|
39
39
|
- **CLI Interface**: Simple command-line tool using Click
|
|
40
40
|
|
|
41
|
+
## What Problems Does This Solve?
|
|
42
|
+
|
|
43
|
+
This tool helps you answer questions like:
|
|
44
|
+
|
|
45
|
+
- **"How can I review all my Claude Code conversations?"**
|
|
46
|
+
- **"What did I work on with Claude yesterday/last week?"**
|
|
47
|
+
- **"How much are my Claude Code sessions costing?"**
|
|
48
|
+
- **"How can I search through my entire Claude Code history?"**
|
|
49
|
+
- **"What tools did Claude use in this project?"**
|
|
50
|
+
- **"How can I share my Claude Code conversation with others?"**
|
|
51
|
+
- **"What's the timeline of my project development?"**
|
|
52
|
+
- **"How can I analyse patterns in my Claude Code usage?"**
|
|
53
|
+
|
|
41
54
|
## Usage
|
|
42
55
|
|
|
43
56
|
### Default Behavior (Process All Projects)
|
|
@@ -52,15 +65,18 @@ claude-code-log --all-projects
|
|
|
52
65
|
# Process all projects and open in browser
|
|
53
66
|
claude-code-log --open-browser
|
|
54
67
|
|
|
55
|
-
# Process all projects with date filtering
|
|
68
|
+
# Process all projects with date filtering
|
|
56
69
|
claude-code-log --from-date "yesterday" --to-date "today"
|
|
57
70
|
claude-code-log --from-date "last week"
|
|
71
|
+
|
|
72
|
+
# Skip individual session files (only create combined transcripts)
|
|
73
|
+
claude-code-log --no-individual-sessions
|
|
58
74
|
```
|
|
59
75
|
|
|
60
76
|
This creates:
|
|
61
77
|
|
|
62
|
-
- `~/.claude/projects/index.html` -
|
|
63
|
-
- `~/.claude/projects/project-name/combined_transcripts.html` - Individual project pages
|
|
78
|
+
- `~/.claude/projects/index.html` - Top level index with project cards and statistics
|
|
79
|
+
- `~/.claude/projects/project-name/combined_transcripts.html` - Individual project pages (these can be several megabytes)
|
|
64
80
|
- `~/.claude/projects/project-name/session-{session-id}.html` - Individual session pages
|
|
65
81
|
|
|
66
82
|
### Single File or Directory Processing
|
|
@@ -220,10 +236,16 @@ Install using pip:
|
|
|
220
236
|
pip install claude-code-log
|
|
221
237
|
```
|
|
222
238
|
|
|
239
|
+
Or run directly with uvx (no installation required):
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
uvx claude-code-log
|
|
243
|
+
```
|
|
244
|
+
|
|
223
245
|
Or install from source:
|
|
224
246
|
|
|
225
247
|
```bash
|
|
226
|
-
git clone https://github.com/
|
|
248
|
+
git clone https://github.com/daaain/claude-code-log.git
|
|
227
249
|
cd claude-code-log
|
|
228
250
|
uv sync
|
|
229
251
|
uv run claude-code-log
|
|
@@ -231,14 +253,10 @@ uv run claude-code-log
|
|
|
231
253
|
|
|
232
254
|
## TODO
|
|
233
255
|
|
|
234
|
-
- **Timeline view**: Show interaction on a timeline to get a better idea on timings and parallel calls - maybe Timeline.js optionally generated runtime?
|
|
235
|
-
- document what questions does this library help answering
|
|
236
256
|
- integrate `claude-trace` request logs if present?
|
|
237
|
-
- use Anthropic's own types: <https://github.com/anthropics/anthropic-sdk-python/tree/main/src/anthropic/types> – can these be used to generate Pydantic classes though?
|
|
238
257
|
- Shortcut / command to resume a specific conversation by session ID $ claude --resume 550e8400-e29b-41d4-a716-446655440000?
|
|
239
258
|
- Localised number formatting and timezone adjustment runtime? For this we'd need to make Jinja template variables more granular
|
|
240
259
|
- get `cwd` from logs to be able to render the proper path for titles
|
|
241
|
-
- handle `"isSidechain":true` for sub-agent Tasks
|
|
242
260
|
- convert images to WebP as screenshots are often huge PNGs – this might be time consuming to keep redoing (so would also need some caching) and need heavy dependencies with compilation (unless there are fast pure Python conversation libraries? Or WASM?)
|
|
243
261
|
- add special formatting for built-in tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch
|
|
244
262
|
- render Edit / MultiEdit as diff(s)?
|
|
@@ -246,4 +264,4 @@ uv run claude-code-log
|
|
|
246
264
|
- Thinking block should have Markdown rendering as sometimes they have formatting
|
|
247
265
|
- system blocks like `init` also don't render perfectly, losing new lines
|
|
248
266
|
- add `ccusage` like daily summary and maybe some textual summary too based on Claude generate session summaries?
|
|
249
|
-
|
|
267
|
+
– import logs from @claude Github Actions
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
from pathlib import Path
|
|
5
5
|
import traceback
|
|
6
6
|
from typing import List, Optional, Dict, Any
|
|
7
|
-
from .utils import should_use_as_session_starter
|
|
7
|
+
from .utils import should_use_as_session_starter, extract_init_command_description
|
|
8
8
|
|
|
9
9
|
from .parser import (
|
|
10
10
|
load_transcript,
|
|
@@ -143,9 +143,10 @@ def _collect_project_sessions(messages: List[TranscriptEntry]) -> List[Dict[str,
|
|
|
143
143
|
):
|
|
144
144
|
first_user_content = extract_text_content(message.message.content)
|
|
145
145
|
if should_use_as_session_starter(first_user_content):
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
146
|
+
preview_content = extract_init_command_description(
|
|
147
|
+
first_user_content
|
|
148
|
+
)
|
|
149
|
+
sessions[session_id]["first_user_message"] = preview_content[:500]
|
|
149
150
|
|
|
150
151
|
# Convert to list format with formatted timestamps
|
|
151
152
|
session_list: List[Dict[str, Any]] = []
|