Skip to content

Commit de2990c

Browse files
committed
feat(export): enhance export functionality with incremental updates and latest-day slice
- Updated README to clarify bulk export options, including incremental updates and latest-day slice. - Modified CLI export flags to support `--since incremental` for exporting only new or changed sessions since the last export. - Implemented logic in the export API to handle the new export options, including returning a 422 error when there is nothing to export. - Enhanced session filtering for the latest activity day and improved project matching for exports. - Added unit tests for new export features and validation of state management.
1 parent e0e0a76 commit de2990c

9 files changed

Lines changed: 864 additions & 155 deletions

File tree

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ Browse and export Claude Code chat history — Web GUI and CLI.
1919
- **Smooth transitions** — staggered card/message animations, crossfade content swaps
2020
- **Scroll-to-top button** in bottom-right corner
2121
- **Per-model badges** in session header
22-
- **Bulk export** — download all sessions as a zip
22+
- **Bulk export** — download all sessions, incremental updates, or latest-day slice as a zip; if there is nothing to export, the API returns **422** JSON (`Nothing to export`) instead of an empty zip
2323

2424
### CLI Export
2525
- Standalone script to export all sessions to Markdown with YAML frontmatter
2626
- Rich Markdown: token usage, tool calls, thinking blocks, model info, timestamps
27-
- `--since last` flag for incremental export (only new/updated sessions)
28-
- `--project` flag to export a specific project
27+
- `--since last` — export every session that overlaps the **latest UTC calendar day** present in your history (zip name includes `last-MM-DD`)
28+
- `--since incremental` — export only sessions **new or changed since the last export** (file mtime + saved state)
29+
- `--project` flag to export a subset of projects
2930

3031
## Quick Start
3132

@@ -60,7 +61,7 @@ python app.py --base-dir /path/to/claude/projects
6061
```bash
6162
# Activate venv first (see above), then:
6263

63-
# List all projects (shows directory names you can use with --project)
64+
# List all projects (first column is a friendly name; --project accepts that or the dir slug)
6465
python scripts/export.py list
6566

6667
# Export all sessions as zip
@@ -69,14 +70,17 @@ python scripts/export.py
6970
# Export to specific directory, no zip
7071
python scripts/export.py --out ./exports --no-zip
7172

72-
# Incremental export (only new sessions since last run)
73+
# Latest calendar day (UTC): all sessions active on that day; zip like claude-code-export-last-04-06-2026-05-08.zip
7374
python scripts/export.py --since last
7475

75-
# Export specific project only (substring match on directory name)
76+
# Incremental (only new/updated sessions since last run, using export state)
77+
python scripts/export.py --since incremental
78+
79+
# Export specific project only (substring on friendly name from list and/or dir name under ~/.claude/projects/)
7680
python scripts/export.py --project boost-capy
7781
```
7882

79-
The `--project` flag matches against the directory names under `~/.claude/projects/`. These are path-based names like `F--boost-capy` or `d--harbor-forge`. You can use any substring — for example `boost-capy` will match `F--boost-capy`. Run `python scripts/export.py list` to see all available project names.
83+
The `--project` flag matches a **case-insensitive substring** of either the **Project** column from `list` (derived from the session working directory) or the internal directory name under `~/.claude/projects/` (for example `F--boost-capy` or `d--harbor-forge`). A substring like `boost-capy` matches `F--boost-capy`; you can also paste the friendly name shown in `list`.
8084

8185
## Data Source
8286

0 commit comments

Comments
 (0)