Skip to main content

Claude Code Session Utils

Tools for managing Claude 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

pipx install claude-code-sessionutils

From Source

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.

claude-session cp source_dir dest_dir

Move/Rename a project

claude-session mv old_dir new_dir

Remove session data

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

claude-session rm project_dir

Options

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

Development

# Install in editable mode
pip install -e .

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

License

GNU General Public License v3.0

Metadata

Release files for claude-code-sessionutils 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-code-sessionutils 0.1.0
File Size Uploaded
claude_code_sessionutils-0.1.0.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-code-sessionutils 0.1.0
File Interpreter ABI Platform
claude_code_sessionutils-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 33.5 kB

Release files / claude_code_sessionutils-0.1.0.tar.gz

Download URL claude_code_sessionutils-0.1.0.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
95095bcf9c3610e055fcfd4c9b2b7b8b7581987a598f19c54b68232120e9c4c7
BLAKE2b-256 checksum
How to use checksums
cc554ca61ef9fd06efeb71061d6146c39369fabe0217439a80492d6f769bf756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.

Transparency log

Release files / claude_code_sessionutils-0.1.0-py3-none-any.whl

Download URL claude_code_sessionutils-0.1.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a68bd75ddc8c1e6477b86f8cea9a65c0dbd363b9283e7c98ed9ec6e0cdae4ce
BLAKE2b-256 checksum
How to use checksums
6fff612a329e272d1630802303bd6cc0eb002e310bc505dec10a9e3aa108a2c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page