claude

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ProviderName = "claude_code"

Variables

This section is empty.

Functions

func DecodeProjectPath

func DecodeProjectPath(sourceKey string) string

DecodeProjectPath decodes the project path from a Claude source key. Claude stores projects under ~/.claude/projects/<encoded-path>/, where the encoded path replaces "/" with "-".

Returns "" when sourceKey is not actually under the projects base.

Claude does not escape dashes inside path segments, so this decoded path can be ambiguous. Do not use it for routing, filesystem access, or authorization until the decoder is disambiguated.

func DecodeProjectPathFromSourceKey

func DecodeProjectPathFromSourceKey(sourceKey string) string

DecodeProjectPathFromSourceKey decodes the project path from a Claude source key.

func ExtractBasename

func ExtractBasename(sourceKey string) string

ExtractBasename returns the filename without extension.

func ExtractParentSessionID

func ExtractParentSessionID(sourceKey string) string

ExtractParentSessionID extracts the parent session UUID from a subagent path.

func ExtractSessionIDFromPath

func ExtractSessionIDFromPath(sourceKey string) string

ExtractSessionIDFromPath extracts the UUID session ID from a JSONL filename.

func HasOnlyReadToolUses

func HasOnlyReadToolUses(tus []ToolUse) bool

HasOnlyReadToolUses reports whether every extracted tool_use is Read.

func SerializeToolUses

func SerializeToolUses(tus []ToolUse, contentTypes []string) sql.NullString

SerializeToolUses returns tool uses and content types as a JSON NullString.

Types

type ExtractedFields

type ExtractedFields = extractedFields

ExtractedFields aliases extractedFields for hook integration.

func ExtractFields

func ExtractFields(line string) ExtractedFields

ExtractFields parses a single Claude JSONL line and returns structured fields.

type ToolUse

type ToolUse = toolUse

ToolUse aliases toolUse for hook integration.

Jump to

Keyboard shortcuts

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