Skip to main content

Manage Claude Code session data when moving/copying directories

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_sessionutils-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_code_sessionutils-0.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_code_sessionutils-0.1.0.tar.gz.

File metadata

  • Download URL: claude_code_sessionutils-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for claude_code_sessionutils-0.1.0.tar.gz
Algorithm Hash digest
SHA256 95095bcf9c3610e055fcfd4c9b2b7b8b7581987a598f19c54b68232120e9c4c7
MD5 fbf088b724097379033a6eafdbc5744f
BLAKE2b-256 cc554ca61ef9fd06efeb71061d6146c39369fabe0217439a80492d6f769bf756

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_sessionutils-0.1.0.tar.gz:

Publisher: publish.yml on lirazsiri/claude-code-sessionutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_sessionutils-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_sessionutils-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a68bd75ddc8c1e6477b86f8cea9a65c0dbd363b9283e7c98ed9ec6e0cdae4ce
MD5 5b8ede3c89010b4b727c6ed61cfa2f80
BLAKE2b-256 6fff612a329e272d1630802303bd6cc0eb002e310bc505dec10a9e3aa108a2c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_sessionutils-0.1.0-py3-none-any.whl:

Publisher: publish.yml on lirazsiri/claude-code-sessionutils

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page