claude

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

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

func IsWorktree(path string) (bool, string)

IsWorktree detects if a path is a git worktree and returns the main repo.

func ParseJSONL

func ParseJSONL(path string) (*model.Session, int64, error)

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

func ProjectDirForCWD(cwd string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL