Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePath ¶ added in v0.3.0
DecodePath converts a Claude Code project directory name back to a filesystem path. -Users-name-dev-project → /Users/name/dev/project Note: this is ambiguous when directory names contain literal hyphens. Use ValidateDecodedPath to check if the result exists on disk.
func DefaultClaudeDir ¶
func DefaultClaudeDir() string
DefaultClaudeDir returns the default ~/.claude path. In WSL2, if ~/.claude/projects doesn't exist, falls back to the Windows user's .claude directory at /mnt/c/Users/<name>/.claude.
func EncodePath ¶ added in v0.3.0
EncodePath converts a filesystem path to Claude Code's project directory name. /Users/name/dev/project → -Users-name-dev-project
func ProjectNameFromDir ¶ added in v0.5.0
ProjectNameFromDir extracts a human-readable project name from a Claude project directory path.
Types ¶
type Discoverer ¶
type Discoverer struct {
ClaudeDir string
}
Discoverer finds sessions across Claude project directories.
func (*Discoverer) ListAllSessions ¶
func (d *Discoverer) ListAllSessions() ([]Info, error)
ListAllSessions returns sessions across all projects, sorted by modification time.
func (*Discoverer) ListProjects ¶
func (d *Discoverer) ListProjects() ([]string, error)
ListProjects returns all project directory paths under the claude dir.
func (*Discoverer) ListSessions ¶
func (d *Discoverer) ListSessions(projectDir string) ([]Info, error)
ListSessions returns sessions for a specific project directory.
type Info ¶
type Info struct {
SessionID string
Slug string
FullPath string
FirstPrompt string
MessageCount int
Created time.Time
Modified time.Time
GitBranch string
ProjectPath string
ProjectName string
FileSizeMB float64
IsSidechain bool
ContextStats *QuickStats
Zombie bool
ZombieReason string
}
Info holds metadata about a single conversation session.
func (Info) DisplayName ¶ added in v0.5.0
DisplayName returns the slug if available, otherwise the short ID.
type OrphanedProject ¶ added in v0.3.0
type OrphanedProject struct {
DirName string // directory name under projects/
DecodedPath string // decoded filesystem path
FullDirPath string // full path to the project directory
SessionCount int // number of JSONL files
TotalMessages int // total messages across all sessions
}
OrphanedProject represents a project directory whose decoded path no longer exists.
func FindOrphans ¶ added in v0.3.0
func FindOrphans(claudeDir string) ([]OrphanedProject, error)
FindOrphans scans all project directories and returns those whose decoded filesystem path no longer exists on disk.
type QuickStats ¶
type QuickStats struct {
ContextTokens int
ContextPct float64
ImageCount int
CompactionCount int
LastCompactionBefore int
LastCompactionAfter int
EstimatedCost float64
Model string
SignalPercent int // 0-100, estimated signal/noise ratio
ClientType string // "cli", "desktop", or "unknown"
EntropyScore float64 // 0-100
EntropyLevel string // LOW/MEDIUM/HIGH/CRITICAL
CleanupStatus string // clean/due/overdue
CleanupCadenceScore float64 // 0-100
}
QuickStats holds lightweight context stats for the session browser.
type RelocatePlan ¶ added in v0.3.0
type RelocatePlan struct {
OldPath string
NewPath string
OldDirName string
NewDirName string
SessionCount int
IndexEntries int
OldDirExists bool
NewDirExists bool
}
RelocatePlan describes what a relocation would do without executing it.
func PlanRelocate ¶ added in v0.3.0
func PlanRelocate(claudeDir, fromPath, toPath string) (*RelocatePlan, error)
PlanRelocate creates a dry-run plan for relocating sessions.
type RelocateResult ¶ added in v0.3.0
type RelocateResult struct {
OldDirName string
NewDirName string
SessionsFound int
IndexUpdated bool
CWDUpdated int // entries with CWD rewritten
DryRun bool
}
RelocateResult holds the result of a session relocation operation.
func Relocate ¶ added in v0.3.0
func Relocate(claudeDir, fromPath, toPath string, updateCWD bool) (*RelocateResult, error)
Relocate moves sessions from one project path to another. This renames the project directory and updates sessions-index.json. If updateCWD is true, also rewrites CWD fields in JSONL entries.