Recover files created and modified by Claude Code from session transcripts
Project description
claude-file-recovery
Recover files created and modified by Claude Code from its JSONL session transcripts — even if you lost track of them across sessions.
Claude Code stores a full log of every tool call in ~/.claude/projects/. This tool parses those transcripts, replays Write, Edit, and Read operations in order, and reconstructs the files so you can browse, search, and extract them.
Features
- Interactive TUI with fuzzy search and vim keybindings (j/k/g/G,
/to search) - Point-in-time recovery — reconstruct files at any historical snapshot, not just the latest
- Colored diff view showing how files changed over time (unified, full-context, and raw modes)
- Batch extraction — select multiple files and extract them all at once
- Fast scanning — parallel session parsing with orjson and fast-reject byte checks that skip ~77% of lines before parsing
- Symlink deduplication — detects aliased paths and merges them into canonical entries
- Smart-case search — case-sensitive only when your query contains uppercase (like ripgrep)
Installation
# Recommended
uv tool install claude-file-recovery
# Or with pipx
pipx install claude-file-recovery
# Or with pip
pip install claude-file-recovery
Requires Python 3.10+.
Quick Start
# Launch the interactive TUI (default command)
claude-file-recovery
# List all recoverable files
claude-file-recovery list-files
# Filter by pattern
claude-file-recovery list-files --filter '*.py'
# Export as CSV
claude-file-recovery list-files --filter '*.ts' --csv
# Extract files to disk
claude-file-recovery extract-files --output ./recovered --filter '*.py'
# Recover files as they were before a certain time
claude-file-recovery list-files --before '2025-02-20 14:00'
# Point to a different Claude data directory
claude-file-recovery --claude-dir /path/to/claude-backup
How It Works
-
Scan — Discovers all JSONL session files under
~/.claude/projects/and parses them in parallel using a thread pool. A fast-reject byte check skips progress and history-snapshot lines (~77% of all lines) before touching the JSON parser. -
Correlate — Links tool-use requests in assistant messages to their results in user messages via
tool_use_id. This is how file content (which only appears in results, not requests) gets attached to each operation. -
Reconstruct — Replays operations in chronological order per file path. Write ops set content, Edit ops apply string replacements, and Read ops capture snapshots. The
--beforeflag uses binary search to cut off at any point in time. -
Present — The TUI lets you browse all recovered files, search with fuzzy matching, view colored diffs between snapshots, and batch-extract to disk.
TUI Keybindings
| Key | Action |
|---|---|
j / k |
Move up/down |
g / G |
Jump to top/bottom |
/ |
Search |
Ctrl+R |
Cycle search mode (fuzzy / glob / regex) |
x or Space |
Toggle file selection |
Enter |
View file detail + diffs |
d |
Cycle diff mode (unified / full-context / raw) |
Ctrl+E |
Extract selected files |
q |
Back / quit |
Contributing
Contributions are welcome! Feel free to open an issue or submit a pull request.
License
MIT — Rikkert ten Klooster
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_file_recovery-0.2.0.tar.gz.
File metadata
- Download URL: claude_file_recovery-0.2.0.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
955211bb52994c127f0a23d13ef9183aa52527f2dc19a1930e792c18a25ddfd5
|
|
| MD5 |
b920d6e9789c33858fce3ebe122d2e57
|
|
| BLAKE2b-256 |
e76a2f79edfc7f70a36cc684403e692cd7520962b233d0e64db843eec4713003
|
Provenance
The following attestation bundles were made for claude_file_recovery-0.2.0.tar.gz:
Publisher:
release.yml on hjtenklooster/claude-file-recovery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_file_recovery-0.2.0.tar.gz -
Subject digest:
955211bb52994c127f0a23d13ef9183aa52527f2dc19a1930e792c18a25ddfd5 - Sigstore transparency entry: 1003808055
- Sigstore integration time:
-
Permalink:
hjtenklooster/claude-file-recovery@8ac6423b7d0bf39a342d2cd5c9525f7a71e6a996 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hjtenklooster
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8ac6423b7d0bf39a342d2cd5c9525f7a71e6a996 -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_file_recovery-0.2.0-py3-none-any.whl.
File metadata
- Download URL: claude_file_recovery-0.2.0-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
616c228c026478da20a7927bdcdc1ca150b87eaa2156f8e1639e03ea0cbef93e
|
|
| MD5 |
b57d64ec5e4ece9f0572541646a806d5
|
|
| BLAKE2b-256 |
cb1fd58f845eb2b8eb257623baa9f2985893d16d958dc30ffd0db70554503f13
|
Provenance
The following attestation bundles were made for claude_file_recovery-0.2.0-py3-none-any.whl:
Publisher:
release.yml on hjtenklooster/claude-file-recovery
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_file_recovery-0.2.0-py3-none-any.whl -
Subject digest:
616c228c026478da20a7927bdcdc1ca150b87eaa2156f8e1639e03ea0cbef93e - Sigstore transparency entry: 1003808056
- Sigstore integration time:
-
Permalink:
hjtenklooster/claude-file-recovery@8ac6423b7d0bf39a342d2cd5c9525f7a71e6a996 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/hjtenklooster
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8ac6423b7d0bf39a342d2cd5c9525f7a71e6a996 -
Trigger Event:
release
-
Statement type: