Skip to main content

Module discovery

Module discovery 

Source
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_DIR env 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.