Scans ~/.claude/projects/ (or the project-specific sub-directory) for
.jsonl session files and extracts metadata from stat + head/tail reads
— no full JSONL parsing required.
Arguments
- directory
Character or NULL. Project directory path. When provided, only sessions for that project (and its git worktrees when
include_worktrees = TRUE) are returned. WhenNULL, all sessions across all projects are returned.- limit
Integer or NULL. Maximum number of sessions to return.
- offset
Integer. Number of sessions to skip (for pagination).
- include_worktrees
Logical. Scan git worktrees (default
TRUE).