Documentation
¶
Index ¶
- func ClaudeProjectsDirs(configDirs []string) []string
- func DesktopSessionsDir() string
- func DiscoverSessions(cache *model.SessionCache, desktopCache *DesktopCache, configDirs []string) ([]*model.Session, error)
- func IsWorktree(path string) (bool, string)
- func ParseJSONL(path string) (*model.Session, int64, error)
- func ParseJSONLIncremental(path string, offset int64, base *model.Session) (*model.Session, int64, error)
- func ProjectDirForCWD(cwd string) string
- type DesktopCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClaudeProjectsDirs ¶ added in v0.7.8
ClaudeProjectsDirs returns the Claude projects directories to scan. If configDirs is non-empty, those are used directly (with /projects appended). Otherwise it auto-detects from CLAUDE_CONFIG_DIR (falling back to ~/.claude).
func DesktopSessionsDir ¶
func DesktopSessionsDir() string
DesktopSessionsDir returns the path to Claude Desktop's session metadata directory. Returns empty string on non-macOS platforms.
func DiscoverSessions ¶
func DiscoverSessions(cache *model.SessionCache, desktopCache *DesktopCache, configDirs []string) ([]*model.Session, error)
DiscoverSessions scans Claude projects directories for JSONL session files. Every JSONL file is a separate session. Uses caches to skip unchanged files.
func IsWorktree ¶
IsWorktree detects if a path is a git worktree and returns the main repo.
func ParseJSONL ¶
ParseJSONL reads a JSONL file and returns a populated Session and the byte offset consumed (for incremental parsing on the next call).
func ParseJSONLIncremental ¶
func ParseJSONLIncremental(path string, offset int64, base *model.Session) (*model.Session, int64, error)
ParseJSONLIncremental reads only the tail of a JSONL file starting at the given byte offset, merging new entries into the provided base session. Returns the updated session and new byte offset.
func ProjectDirForCWD ¶
ProjectDirForCWD encodes a CWD path to the ~/.claude/projects directory name. Claude replaces every / and . with -, keeping the leading slash as a leading -.
Types ¶
type DesktopCache ¶
type DesktopCache struct {
// contains filtered or unexported fields
}
DesktopCache caches parsed desktop metadata JSON files keyed by file path.
func NewDesktopCache ¶
func NewDesktopCache() *DesktopCache
NewDesktopCache creates an empty desktop cache.