Metadata-Version: 2.4
Name: claude-code-sessionutils
Version: 0.1.0
Summary: Manage Claude Code session data when moving/copying directories
Author-email: Liraz Siri <liraz@liraz.org>
Project-URL: Homepage, https://github.com/lirazsiri/claude-code-sessionutils
Project-URL: Bug Tracker, https://github.com/lirazsiri/claude-code-sessionutils/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click
Dynamic: license-file

# Claude Code Session Utils

Tools for managing [Claude Code](https://claude.ai/code) session data when project directories are copied, moved, or removed.

When you move or copy a project directory on your filesystem, Claude Code's internal session data (stored in `~/.claude/projects/`) loses track of it. This tool helps you move/copy the session data along with the directory so you can resume your sessions.

## Features

- **Copy Session Data**: Use `cp` to clone a directory along with its conversation history. Useful for branching your work.
- **Move Session Data**: Use `mv` to rename/move a project directory and update session references.
- **Clean Up**: Use `rm` to delete stale session data for a directory without deleting the directory itself.
- **Auto-Update**: Automatically rewrites path references inside session files so `claude -c` works immediately.

## Installation

### From PyPI

```bash
pipx install claude-code-sessionutils
```

### From Source

```bash
git clone https://github.com/lirazsiri/claude-code-sessionutils.git
cd claude-code-sessionutils
pipx install .
```

## Usage

### Copy a project (and session history)

Useful for forking a task into a new directory/branch while keeping the conversation history.

```bash
claude-session cp source_dir dest_dir
```

### Move/Rename a project

```bash
claude-session mv old_dir new_dir
```

### Remove session data

Cleans up the session history for a directory without deleting the directory itself.

```bash
claude-session rm project_dir
```

## Options

- `-f, --force`: Overwrite existing session data at the destination.
  - Example: `claude-session cp -f src dst`

## Development

```bash
# Install in editable mode
pip install -e .

# Run tests
bash tests/test-claude-session.sh
```

## License

GNU General Public License v3.0
