Documentation
¶
Index ¶
- Constants
- func AbsPath(ctx context.Context, relPath string) (string, error)
- func CheckpointPath(checkpointID id.CheckpointID) stringdeprecated
- func ClearWorktreeRootCache()
- func ExtractSessionIDFromTranscriptPath(transcriptPath string) string
- func GetClaudeProjectDir(repoPath string) (string, error)
- func GetLastTimestampFromBytes(data []byte) time.Time
- func GetLastTimestampFromFile(path string) time.Time
- func GetWorktreeID(worktreePath string) (string, error)
- func IsInfrastructurePath(path string) bool
- func ParseTimestampFromJSONL(line string) time.Time
- func SanitizePathForClaude(path string) string
- func SessionMetadataDirFromSessionID(sessionID string) string
- func ToRelativePath(absPath, cwd string) string
- func WorktreeRoot(ctx context.Context) (string, error)
Constants ¶
const ( EntireDir = ".entire" EntireTmpDir = ".entire/tmp" EntireMetadataDir = ".entire/metadata" )
Directory constants
const ( ContextFileName = "context.md" PromptFileName = "prompt.txt" SummaryFileName = "summary.txt" TranscriptFileName = "full.jsonl" TranscriptFileNameLegacy = "full.log" MetadataFileName = "metadata.json" CheckpointFileName = "checkpoint.json" ContentHashFileName = "content_hash.txt" SettingsFileName = "settings.json" )
Metadata file names
const MetadataBranchName = "entire/checkpoints/v1"
MetadataBranchName is the orphan branch used by manual-commit strategy to store metadata
Variables ¶
This section is empty.
Functions ¶
func AbsPath ¶
AbsPath returns the absolute path for a relative path within the repository. If the path is already absolute, it is returned as-is. Uses WorktreeRoot() to resolve paths relative to the worktree root.
func CheckpointPath
deprecated
func CheckpointPath(checkpointID id.CheckpointID) string
CheckpointPath returns the sharded storage path for a checkpoint ID. Uses first 2 characters as shard (256 buckets), remaining as folder name. Example: "a3b2c4d5e6f7" -> "a3/b2c4d5e6f7"
Deprecated: Use checkpointID.Path() directly instead.
func ClearWorktreeRootCache ¶ added in v0.4.8
func ClearWorktreeRootCache()
ClearWorktreeRootCache clears the cached worktree root. This is primarily useful for testing when changing directories.
func ExtractSessionIDFromTranscriptPath ¶
ExtractSessionIDFromTranscriptPath attempts to extract a session ID from a transcript path. Claude transcripts are stored at ~/.claude/projects/<project>/sessions/<id>.jsonl If the path doesn't match expected format, returns empty string.
func GetClaudeProjectDir ¶
GetClaudeProjectDir returns the directory where Claude stores session transcripts for the given repository path.
In test environments, set ENTIRE_TEST_CLAUDE_PROJECT_DIR to override the default location.
func GetLastTimestampFromBytes ¶
GetLastTimestampFromBytes extracts the timestamp from the last non-empty line of JSONL content. Returns zero time if not found.
func GetLastTimestampFromFile ¶
GetLastTimestampFromFile reads the last non-empty line from a JSONL file and extracts the timestamp field. Returns zero time if file doesn't exist or no valid timestamp is found.
func GetWorktreeID ¶
GetWorktreeID returns the internal git worktree identifier for the given path. For the main worktree (where .git is a directory), returns empty string. For linked worktrees (where .git is a file), extracts the name from .git/worktrees/<name>/ path. This name is stable across `git worktree move`.
func IsInfrastructurePath ¶
IsInfrastructurePath returns true if the path is part of CLI infrastructure (i.e., inside the .entire directory)
func ParseTimestampFromJSONL ¶
ParseTimestampFromJSONL extracts the timestamp from a JSONL line. Returns zero time if the line is empty or doesn't contain a valid timestamp.
func SanitizePathForClaude ¶
SanitizePathForClaude converts a path to Claude's project directory format. Claude replaces any non-alphanumeric character with a dash.
func SessionMetadataDirFromSessionID ¶
SessionMetadataDirFromSessionID returns the path to a session's metadata directory for the given Entire session ID. The sessionID must be the full, already date-prefixed Entire session identifier as stored on disk, not an agent-specific or raw Claude ID.
func ToRelativePath ¶
ToRelativePath converts an absolute path to relative. Returns empty string if the path is outside the working directory.
func WorktreeRoot ¶ added in v0.4.8
WorktreeRoot returns the git worktree root directory. Uses 'git rev-parse --show-toplevel' which returns the working tree toplevel. In a worktree this is the worktree root, not the main repository root. The result is cached per working directory. Returns an error if not inside a git repository.
Types ¶
This section is empty.