Session parsing, timeline generation, and HTML/video rendering
Find a file
Snider 55ceab4a0d
Some checks failed
Security Scan / security (push) Successful in 8s
Test / test (push) Failing after 1m8s
refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E()
Replace all 8 instances of fmt.Errorf across parser.go, html.go, and video.go
with coreerr.E() from forge.lthn.ai/core/go-log for consistent error handling.
Add dependency on go-log v0.0.4.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 20:38:07 +00:00
.core chore: add .core/ build and release configs 2026-03-06 18:52:37 +00:00
.forgejo/workflows ci: add Forgejo Actions test and security scan workflows 2026-02-23 03:28:08 +00:00
docs docs: add human-friendly documentation 2026-03-11 13:02:40 +00:00
kb refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
specs refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
.editorconfig chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:48 +00:00
.gitignore chore: add .core/ and .idea/ to .gitignore 2026-03-15 10:17:50 +00:00
.golangci.yml chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:48 +00:00
analytics.go fix: improve HTML escaping and modernise sort/search helpers 2026-03-09 08:30:01 +00:00
analytics_test.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:25:55 +00:00
bench_test.go refactor: apply go fix modernizers for Go 1.26 2026-02-22 21:00:17 +00:00
CLAUDE.md docs: add CLAUDE.md project instructions 2026-03-13 13:38:02 +00:00
CONTEXT.md refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
CONTRIBUTING.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:48 +00:00
GEMINI.md refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
go.mod refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
go.sum refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
html.go refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
html_test.go test: add comprehensive Phase 0 test suite — 67 tests, 90.9% coverage 2026-02-20 05:01:28 +00:00
parser.go refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
parser_test.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:25:55 +00:00
PROMPT.md refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
README.md chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig) 2026-02-23 06:45:48 +00:00
RECENT.md refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
search.go fix: improve HTML escaping and modernise sort/search helpers 2026-03-09 08:30:01 +00:00
search_test.go feat: modernise to Go 1.26 iterators and stdlib helpers 2026-02-23 05:25:55 +00:00
TODO.md refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
video.go refactor(error-handling): replace fmt.Errorf and errors.New with coreerr.E() 2026-03-16 20:38:07 +00:00
video_test.go test: add comprehensive Phase 0 test suite — 67 tests, 90.9% coverage 2026-02-20 05:01:28 +00:00

Go Reference License: EUPL-1.2 Go Version

go-session

Claude Code JSONL transcript parser, analytics engine, and HTML timeline renderer. Parses Claude Code session files into structured event arrays (tool calls with round-trip durations, user and assistant messages), computes per-tool analytics (call counts, error rates, average and peak latency, estimated token usage), renders self-contained HTML timelines with collapsible panels and client-side search, and generates VHS tape scripts for MP4 video output. No external runtime dependencies — stdlib only.

Module: forge.lthn.ai/core/go-session Licence: EUPL-1.2 Language: Go 1.25

Quick Start

import "forge.lthn.ai/core/go-session"

sess, stats, err := session.ParseTranscript("/path/to/session.jsonl")
analytics := session.Analyse(sess)
fmt.Println(session.FormatAnalytics(analytics))

// Render interactive HTML timeline
err = session.RenderHTML(sess, "timeline.html")

// Search across all sessions in a directory
results, err := session.Search("~/.claude/projects/my-project", "git commit")

Documentation

  • Architecture — JSONL format, parsing pipeline, event types, analytics, HTML rendering, XSS protection
  • Development Guide — prerequisites, build, test patterns, coding standards
  • Project History — completed phases, known limitations, future considerations

Build & Test

go test ./...
go vet ./...
go build ./...

Licence

European Union Public Licence 1.2 — see LICENCE for details.