Claude-File-Recovery: CLI tool extracts files from Claude Code session history

✍️ OpenClawRadar📅 Published: February 28, 2026🔗 Source
Claude-File-Recovery: CLI tool extracts files from Claude Code session history
Ad

What this tool does

claude-file-recovery is a Python command-line tool with an interactive TUI that extracts files from Claude Code's session history. It was created after the author accidentally deleted files through a symlink that Claude Code didn't recognize, and their backup hadn't run for a month. The tool reconstructs files by parsing JSONL session transcripts stored in ~/.claude/projects/.

Key features and functionality

The tool can recover any file that Claude Code ever read, edited, or wrote, including earlier versions of files at specific points in time. It offers:

  • 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 and usage

Requires Python 3.10+. Installation options:

# Recommended
uv tool install claude-file-recovery

Or with pipx

pipx install claude-file-recovery

Or with pip

pip install claude-file-recovery

Basic commands:

# 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

Ad

How it works

The tool scans all JSONL session files under ~/.claude/projects/ and parses them in parallel using a thread pool. It correlates tool-use requests in assistant messages to their results in user messages via tool_use_id, then reconstructs files by replaying operations in chronological order per file path: Write operations set content, Edit operations apply string replacements, and Read operations capture snapshots. The --before flag uses binary search to cut off at any point in time.

TUI keybindings

  • 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

This type of recovery tool is useful for developers who use Claude Code extensively and want insurance against accidental file deletion or corruption. The MIT-licensed project has 26 stars and 1 fork on GitHub as of this writing.

📖 Read the full source: HN AI Agents

Ad

👀 See Also

Snip: Open-source tool reduces Claude Code token usage with YAML filters
Tools

Snip: Open-source tool reduces Claude Code token usage with YAML filters

Snip is a Go-based tool that sits between Claude Code and the shell, filtering verbose command output through declarative YAML pipelines to reduce token usage by 60-90%. It includes 16 composable pipeline actions and works with multiple AI coding agents.

OpenClawRadar
Travel Hacking Toolkit: AI Skills and MCP Servers for Points and Miles Search
Tools

Travel Hacking Toolkit: AI Skills and MCP Servers for Points and Miles Search

A GitHub repository provides 7 markdown skills and 6 MCP servers that teach Claude Code and OpenCode to search award flights across 25+ mileage programs, compare cash prices, pull loyalty balances, and find hotels and ferries. Setup requires cloning the repo and running setup.sh.

OpenClawRadar
Tatu: Open-source security layer for Claude Code blocks secrets and destructive commands
Tools

Tatu: Open-source security layer for Claude Code blocks secrets and destructive commands

Tatu is an open-source hook system that intercepts Claude Code actions in real time to block leaked secrets, flag PII, and deny destructive commands before execution. Installation is via pip/pipx with 'tatu-hook init' to enable audit mode.

OpenClawRadar
ClamBot: AI Agent Runs LLM-Generated Code in WASM Sandbox for Security
Tools

ClamBot: AI Agent Runs LLM-Generated Code in WASM Sandbox for Security

ClamBot is an AI agent framework that executes all LLM-generated code in a WebAssembly sandbox using QuickJS in Wasmtime, eliminating the need for exec() or subprocess calls. It includes an approval gate for tool calls, persistent script caching as 'clams', and supports multiple LLM providers.

OpenClawRadar