claude-session-tools
v1.1.0
Published
CLI tools for managing Claude Code session files across .claude folders
Downloads
312
Maintainers
Readme
claude-session-tools
CLI for moving and copying Claude Code session files between .claude folders.
Session data in ~/.claude is spread across multiple subdirectories (debug, file-history, image-cache, session-env, tasks, todos, projects/*/). This tool finds all files matching a session ID and transfers them in one command, preserving the directory structure.
Install
npm install -g claude-session-toolsOr run directly with npx:
npx claude-session-tools <command>Usage
claude-session-tools <command> <id> --from=<path> --to=<path> [-f]Commands
move
Move session files from one .claude folder to another. Files are removed from the source after transfer.
claude-session-tools move <id> --from=<source> --to=<target> [-f]copy
Copy session files from one .claude folder to another. Source files are kept.
claude-session-tools copy <id> --from=<source> --to=<target> [-f]Options
| Option | Description |
|---|---|
| <id> | Session ID (full UUID or partial match) |
| --from | Path to the source .claude folder |
| --to | Path to the target .claude folder |
| -f, --force | Overwrite existing files without prompting |
Examples
Copy a session to a backup folder:
claude-session-tools copy 004685f2 --from=~/.claude --to=~/claude-backupMove a session between two .claude directories:
claude-session-tools move 004685f2 --from=/tmp/claude-export --to=~/.claudeForce overwrite without prompts:
claude-session-tools copy 004685f2 --from=~/.claude --to=~/claude-backup -fPartial IDs work — just provide enough characters to uniquely match:
claude-session-tools copy 004685 --from=~/.claude --to=~/backupWhat gets transferred
The tool searches these subdirectories for files containing the given ID:
debug/file-history/image-cache/session-env/tasks/todos/projects/*/
If a file already exists in the target, you'll be prompted to overwrite it (unless -f is used).
Requirements
- Node.js >= 18
