Metadata-Version: 2.4
Name: claude-resume
Version: 0.1.4
Summary: TUI session picker for Claude Code --resume
Author: Jinwoo Jeong
License-Expression: MIT
Project-URL: Homepage, https://github.com/jinwoo/claude-resume
Project-URL: Repository, https://github.com/jinwoo/claude-resume
Keywords: claude,claude-code,tui,session,resume
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: User Interfaces
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: textual>=0.40
Dynamic: license-file

# claude-resume

A TUI session picker for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) `--resume`.

Browse, search, and resume previous Claude Code sessions from any project — without remembering session IDs.

![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue)
![License: MIT](https://img.shields.io/badge/license-MIT-green)

## Features

- **Session discovery** — Scans `~/.claude/projects/` for all sessions across every project
- **Real-time search** — Filter by project name, first prompt, or git branch
- **Project scoping** — Toggle between current project and all projects (`Ctrl+T`)
- **Sort modes** — Cycle through Modified / Messages / Project (`Ctrl+S`)
- **Session detail** — View full metadata with `Space`
- **Delete sessions** — Remove old sessions with `d`
- **Auto cd** — Automatically changes to the session's project directory before resuming
- **Fast cache** — Fingerprint-based cache for instant startup after first load
- **CLI passthrough** — Extra arguments are forwarded to `claude`

## Installation

```bash
pip install claude-resume
```

Or install from source:

```bash
git clone https://github.com/jinwoo/claude-resume.git
cd claude-resume
pip install -e .
```

## Usage

```bash
claude-resume
```

### CLI Options

```
claude-resume [OPTIONS] [-- CLAUDE_ARGS...]

Options:
  -g, --global      Start in global (all projects) mode
  -l, --local       Start in local (current project) mode
  --no-cache        Force reload sessions without cache

Examples:
  claude-resume                     # Pick a session to resume
  claude-resume -g                  # Show all projects by default
  claude-resume --no-cache          # Ignore cache, rescan sessions
  claude-resume -- --verbose        # Pass --verbose to claude
```

### Key Bindings

| Key | Action |
|-----|--------|
| `Enter` | Resume selected session |
| `Space` | Show session detail |
| `/` | Focus search input |
| `Escape` | Clear search |
| `Ctrl+T` | Toggle scope (current project / all) |
| `Ctrl+S` | Cycle sort (Modified / Messages / Project) |
| `d` | Delete session (with confirmation) |
| `q` | Quit |

## How It Works

1. Scans `~/.claude/projects/*/sessions-index.json` for indexed sessions
2. Falls back to parsing `.jsonl` transcript files (reads first 50 lines + last line for efficiency)
3. Filters out sidechains and sessions without user messages
4. On selection, `cd`s to the session's project directory and `exec`s `claude --resume <id>`

## Requirements

- Python 3.10+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed
- [Textual](https://github.com/Textualize/textual) (installed automatically)

## License

MIT
