MCPcopy Create free account
hub / github.com/Facets-cloud/flow / RenderTranscript

Method RenderTranscript

internal/harness/claude/transcript.go:22–37  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

20// legacy NULL rows). Claude keys its transcript path on its startup
21// cwd; the two can diverge for `flow do --here` binds.
22func (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

Callers

nothing calls this directly

Calls 2

resolveTranscriptPathFunction · 0.85
RenderJSONLFunction · 0.85

Tested by

no test coverage detected