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
cpto clone a directory along with its conversation history. Useful for branching your work. - Move Session Data: Use
mvto rename/move a project directory and update session references. - Clean Up: Use
rmto delete stale session data for a directory without deleting the directory itself. - Auto-Update: Automatically rewrites path references inside session files so
claude -cworks 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
- Example:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95095bcf9c3610e055fcfd4c9b2b7b8b7581987a598f19c54b68232120e9c4c7
|
|
| MD5 |
fbf088b724097379033a6eafdbc5744f
|
|
| BLAKE2b-256 |
cc554ca61ef9fd06efeb71061d6146c39369fabe0217439a80492d6f769bf756
|
Provenance
The following attestation bundles were made for claude_code_sessionutils-0.1.0.tar.gz:
Publisher:
publish.yml on lirazsiri/claude-code-sessionutils
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_sessionutils-0.1.0.tar.gz -
Subject digest:
95095bcf9c3610e055fcfd4c9b2b7b8b7581987a598f19c54b68232120e9c4c7 - Sigstore transparency entry: 1154334322
- Sigstore integration time:
-
Permalink:
lirazsiri/claude-code-sessionutils@7f04a2e560cd916ca9fd705150fb40ee6abf288b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lirazsiri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f04a2e560cd916ca9fd705150fb40ee6abf288b -
Trigger Event:
release
-
Statement type:
File details
Details for the file claude_code_sessionutils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: claude_code_sessionutils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a68bd75ddc8c1e6477b86f8cea9a65c0dbd363b9283e7c98ed9ec6e0cdae4ce
|
|
| MD5 |
5b8ede3c89010b4b727c6ed61cfa2f80
|
|
| BLAKE2b-256 |
6fff612a329e272d1630802303bd6cc0eb002e310bc505dec10a9e3aa108a2c3
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_code_sessionutils-0.1.0-py3-none-any.whl -
Subject digest:
3a68bd75ddc8c1e6477b86f8cea9a65c0dbd363b9283e7c98ed9ec6e0cdae4ce - Sigstore transparency entry: 1154334323
- Sigstore integration time:
-
Permalink:
lirazsiri/claude-code-sessionutils@7f04a2e560cd916ca9fd705150fb40ee6abf288b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lirazsiri
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@7f04a2e560cd916ca9fd705150fb40ee6abf288b -
Trigger Event:
release
-
Statement type: