Documentation
¶
Overview ¶
Package episode parses a Claude Code session transcript (JSONL) into a structured Episode and renders it as a markdown "episode" file for the identity vault. It is the v0 of the episodic substrate — raw per-session capture, no distillation, not indexed into the vault's search layer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capture ¶
Capture parses the transcript at transcriptPath, renders the episode markdown, and writes it to outputDir. Returns the written file path. Overwrites an existing file with the same derived ID — re-running against a finalized transcript is idempotent by design. Uses atomic temp-file + rename so concurrent SessionEnd hook invocations cannot produce torn files.
func RenderMarkdown ¶
RenderMarkdown turns a parsed Episode into a vault-ready markdown file. Schema is intentionally simple: frontmatter + section-per-signal-type. No distillation, no prose — the next layer (arc distillation) will consume this structure.
Types ¶
type Episode ¶
type Episode struct {
ID string
SessionID string
StartedAt string
EndedAt string
CWD string
GitBranch string
UserMessages []Message
AssistantMessages []Message
ToolCounts map[string]int
Commits []string
PRs []PRLink
FilesTouched []string
}
Episode is the structured output of parsing a session transcript.
func ParseTranscript ¶
ParseTranscript reads a Claude Code JSONL transcript and returns the distilled Episode. Noise records (system reminders, tool results, thinking blocks) are filtered — only real human/assistant exchanges, tool uses, and structural events are kept.