You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Export: latest-day filter, project-scoped CLI, and bulk API hardening (#34)
* 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.
* refactor(export): centralize export state management and enhance error handling
- Introduced a new utility module for managing export state with atomic I/O and locking mechanisms.
- Updated the export API to validate request bodies and handle invalid 'since' parameters, returning appropriate error responses.
- Enhanced the README to clarify bulk export options and CLI export flag behaviors.
- Added unit tests for new error handling scenarios in the export API and improved logging for session parsing failures.
- Refactored existing code to utilize the new export state management utilities, ensuring consistency across API and CLI.
* test(export): add unit tests for load_export_state_from_disk validation
* test(export): add additional unit tests for iso_timestamp_to_date function
-**Bulk export** — download all sessions, incremental updates, or latest-day slice as a zip; if there is nothing to export, the API returns **422** with JSON body `{"error": "Nothing to export", "since": "<mode>"}` (the `since` field echoes your request: `"all"`, `"last"`, or `"incremental"`) instead of an empty zip
23
23
24
24
### CLI Export
25
25
- Standalone script to export all sessions to Markdown with YAML frontmatter
-`--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 (default zip name: `claude-code-export-last-MM-DD-YYYY-MM-DD.zip` — the first `MM-DD` is that latest UTC day, and `YYYY-MM-DD` is the export date)
28
+
-`--since incremental` — export only sessions **new or changed since the last export** (file mtime + saved state)
# 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)
64
65
python scripts/export.py list
65
66
66
67
# Export all sessions as zip
@@ -69,14 +70,17 @@ python scripts/export.py
69
70
# Export to specific directory, no zip
70
71
python scripts/export.py --out ./exports --no-zip
71
72
72
-
#Incremental export (only new sessions since last run)
73
+
#Latest calendar day (UTC): all sessions active on that day; zip pattern claude-code-export-last-MM-DD-YYYY-MM-DD.zip (e.g. claude-code-export-last-04-06-2026-05-08.zip — 04-06 = latest UTC day, 2026-05-08 = export date)
73
74
python scripts/export.py --since last
74
75
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/)
76
80
python scripts/export.py --project boost-capy
77
81
```
78
82
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`.
0 commit comments