Expand description
Discover Claude Code session JSONL files for a project.
Sessions live at ~/.claude/projects/<encoded-path>/<uuid>.jsonl.
The encoded path replaces non-alphanumeric chars (except -) with -.
Functionsยง
- claude_
config_ dir - Resolve the Claude Code config directory.
Uses
CLAUDE_CONFIG_DIRenv if set, otherwise~/.claude. - encode_
project_ path - Encode a filesystem path into the Claude Code project directory name format.
Non-alphanumeric chars (except
-) are replaced with-. - find_
project_ dir - Find the project directory for a given filesystem path. Tries exact match first, then prefix match for worktree variants.
- list_
all_ projects - List all project directories in Claude Code config.
- list_
sessions - List all session JSONL files in a project directory.
Excludes agent files (starting with
agent-). Returns files sorted by modification time (newest first). - projects_
dir - Get the projects directory where session files live.