RenderTranscript opens the session jsonl at the claude convention path (~/.claude/projects/ / .jsonl), decodes the claude-specific JSONL schema, and writes a normalized human- readable rendering to w. cwd is the directory claude was started in (typically tasks.session_cwd; cal
(cwd, sessionID string, compact bool, w io.Writer)
| 20 | // legacy NULL rows). Claude keys its transcript path on its startup |
| 21 | // cwd; the two can diverge for `flow do --here` binds. |
| 22 | func (c *claude) RenderTranscript(cwd, sessionID string, compact bool, w io.Writer) error { |
| 23 | home, err := os.UserHomeDir() |
| 24 | if err != nil { |
| 25 | return fmt.Errorf("no home dir: %w", err) |
| 26 | } |
| 27 | p, err := resolveTranscriptPath(home, cwd, sessionID) |
| 28 | if err != nil { |
| 29 | return err |
| 30 | } |
| 31 | f, err := os.Open(p) |
| 32 | if err != nil { |
| 33 | return fmt.Errorf("open claude transcript %s: %w", p, err) |
| 34 | } |
| 35 | defer f.Close() |
| 36 | return RenderJSONL(f, compact, w) |
| 37 | } |
| 38 | |
| 39 | // resolveTranscriptPath locates a session's jsonl under |
| 40 | // ~/.claude/projects. It first tries the deterministic cwd-encoded path |
nothing calls this directly
no test coverage detected