Documentation
¶
Index ¶
- func ClaudeProjectsDir() string
- func DesktopSessionsDir() string
- func DiscoverSessions(cache *model.SessionCache, desktopCache *DesktopCache) ([]*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 ClaudeProjectsDir ¶
func ClaudeProjectsDir() string
ClaudeProjectsDir returns the path to ~/.claude/projects.
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) ([]*model.Session, error)
DiscoverSessions scans ~/.claude/projects 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.