Resume any Claude Code session from anywhere.
Never lose track of your Claude sessions again. claude-anywhere lets you see all your Claude Code sessions across all projects and instantly jump back into any of them - no matter which directory you're in.
Tip: Just ask Claude Code to install this for you! Share this repo URL with Claude and say: "Install claude-anywhere from https://github.com/streetturtle/claude-anywhere"
brew install streetturtle/tap/claude-anywhereBefore using claude-anywhere, you need to set up a statusline script that captures session data.
brew install jqCreate ~/.claude/write-status.sh with the following content:
#!/bin/bash
# Read the JSON input from stdin
input=$(cat)
# Extract session ID
session_id=$(echo "$input" | jq -r '.session_id // "unknown"')
# Create sessions directory if it doesn't exist
sessions_dir="$HOME/.claude_sessions"
mkdir -p "$sessions_dir"
# Use session_id as the filename to support multiple sessions from the same folder
status_file="$sessions_dir/claude-status-${session_id}.json"
# Write the status data to file with timestamp
# Use milliseconds - on macOS, date doesn't support %N, so we append 000 to convert seconds to ms
echo "$input" | jq ". + {\"_statusline_update_time\": $(date +%s)000}" > "$status_file"
# Pass the input to stdout for the next script in the pipe
echo "$input"Make it executable:
chmod +x ~/.claude/write-status.shEdit ~/.claude/settings.json and add or update the statusLine configuration:
{
"statusLine": {
"type": "command",
"command": "~/.claude/write-status.sh | ~/.claude/your-existing-statusline-script.sh",
"padding": 0
}
}If you don't have an existing statusline script, you can use just the writer:
{
"statusLine": {
"type": "command",
"command": "~/.claude/write-status.sh",
"padding": 0
}
}Restart Claude Code to apply the changes. Session data will now be written to ~/.claude_sessions/.
Simply run from any directory:
claude-anywhere- ↑/↓ or j/k - Navigate through sessions
- / - Search/filter sessions
- Enter - Resume selected session
- q or Ctrl+C - Quit
- Esc - Clear search filter
- ⚡ Resume from anywhere - Jump into any Claude session from any directory
- 📊 Interactive TUI - Beautiful terminal UI with keyboard navigation and search
- 💰 Cost tracking - See real-time costs, token usage, and context window usage
- 🎨 Status indicators - Quickly identify active (●), idle (◐), and closed (○) sessions
- 🔍 Fast search - Filter sessions by project name or model
Each session shows:
- Status indicator - Active (●), Idle (◐), or Closed (○)
- Session name - Custom name if set (via
/renamein Claude Code), otherwise project folder name - Model - Which Claude model is being used
- Cost - Total cost in USD for the session
- Context usage - Percentage of context window used
- Last activity - How long ago the session was active
- Token counts - Input/output tokens used
- Code changes - Lines added/removed in the session
The header shows aggregate stats: total sessions, active count, idle count, and total cost across all sessions.
Tip: Use
/rename <your-name>in Claude Code to give your sessions meaningful names that will show up inclaude-anywhere!
Note: Session names may take a moment to update due to how Claude Code updates its session index. This is a known limitation in Claude Code itself.
- Check that
~/.claude/settings.jsonhas thestatusLineconfiguration - Ensure
~/.claude/write-status.shexists and is executable:chmod +x ~/.claude/write-status.sh - Verify
~/.claude_sessions/exists and containsclaude-status-*.jsonfiles - Make sure you have an active Claude Code session
Install jq:
brew install jq- Verify your
settings.jsonhas the correct command withwrite-status.sh - Restart Claude Code
- Check file timestamps:
ls -la ~/.claude_sessions/to verify files are being updated
By default, claude-anywhere shows sessions from the last 7 days. You can clean up old session files:
find ~/.claude_sessions -name "claude-status-*.json" -mtime +7 -delete