claude-hop
v1.2.0
Published
Hop between Claude Code sessions instantly
Downloads
13
Maintainers
Readme
claude-hop
Hop between Claude Code sessions instantly with a simple command.
Author: Eliot Paynter
Repository: https://github.com/epaynter/claude-hop
Installation
npm install -g claude-hopOr install from source:
git clone https://github.com/epaynter/claude-hop.git
cd claude-hop
npm install
npm run build
npm linkUsage
Resume a session
claude-hop 724e929e-4b6d-4579-b109-c29278885319This will:
- Find the session file in
~/.claude/projects/ - Extract the project path
- Open Claude Code in that directory
List all sessions
claude-hop --list
# or
claude-hop -lShows all available Claude sessions with their IDs and project paths.
How It Works
Claude Code stores session files in ~/.claude/projects/ with hyphenated directory names that represent the actual project paths. This tool:
- Searches for session files matching the provided ID
- Converts the hyphenated path back to the actual filesystem path
- Launches Claude Code in the correct directory
Path Conversion Example
Stored as: ~/.claude/projects/-Users-john-Desktop-myproject/session-id.jsonl
Converts to: /Users/john/Desktop/myprojectArchitecture
The tool follows clean architecture principles with modular, testable components:
- SessionFinder: Locates session files in the Claude directory
- PathConverter: Transforms between hyphenated and system paths
- ClaudeLauncher: Manages Claude process execution
- CLI: Orchestrates the components with proper error handling
Development
Prerequisites
- Node.js >= 16.0.0
- TypeScript
- Claude CLI installed
Setup
npm installBuild
npm run buildTest
npm testLint
npm run lintError Handling
The tool provides clear error messages for common scenarios:
- Session not found: Shows available sessions with
--list - Directory moved/deleted: Indicates the project path no longer exists
- Claude not installed: Provides installation instructions
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Author
Created by Eliot Paynter
- GitHub: @epaynter
- Repository: github.com/epaynter/claude-hop
License
MIT © 2025 Eliot Paynter
