Codesteward/Session Summarizer

Every coding session,
summarized automatically

Turns raw audit events into structured summaries — key decisions, files changed, bugs resolved, and security-relevant actions — using local or hosted LLMs. No manual review needed.

OllamaOpenAIAnthropicruns on CPU
Pipeline Output
ExtractMergeSynthesizeSession Summary11 categoriesper chunkdedup & unionno LLMLLM synthesistags + narrative
Session #a3f8 — summarized
auth-refactorbug-fixtests-added
Refactored session middleware to use JWT validation. Fixed token refresh race condition. Added integration tests for auth flow.

Works with your preferred model

Claude
GPT
Mistral
Llama
Phi
Ollama

Audit logs are complete but unreadable

The audit proxy captures everything — every thinking block, every tool call, every narration. But raw event streams are too dense for human consumption. A single coding session can produce hundreds of events spanning hours of work. Nobody reads those.

The audit data is there. The insight isn't. Without summarization, audit logs become write-only storage — useful for compliance, useless for understanding what actually happened.

11 structured fact categories

Every session is decomposed into structured facts before synthesis — no information is lost to narrative compression.

Files changed

File paths and what changed in each

Decisions

Architectural and implementation choices with reasoning

Bugs resolved

Bug descriptions and how they were fixed

Security relevant

Changes to auth, permissions, validation, secrets

Errors encountered

Errors hit during the session and resolution status

Rollback risks

Migrations, schema changes, hard-to-reverse actions

Dependencies

Packages added, removed, or upgraded and why

Test actions

Tests added, modified, removed, or skipped

Constraints

Problems, blockers, or limitations encountered

Tradeoffs

What was skipped or deferred and why

Boundaries

Explicit rules, invariants, must/must-not constraints

Extract. Merge. Synthesize.

Short sessions get single-pass summarization. Long sessions use a chunked pipeline that extracts facts per chunk, merges them deterministically, then synthesizes.

01

Discover

Polls ClickHouse for sessions that have been inactive for at least the cooldown period. Sessions still in progress are never touched.

02

Compress

Raw events are compressed into a token-efficient timeline — timestamps, tool names, file paths. Secrets are stripped before anything reaches the LLM.

03

Extract

For long sessions, each chunk is sent to the LLM to extract 11 categories of structured facts. Short sessions go directly to synthesis.

04

Merge

Facts from all chunks are merged deterministically — set union with deduplication. No LLM involved, no information lost.

05

Synthesize

Merged facts are sent to the LLM to produce the final summary with tags, key decisions, and a human-readable narrative.

06

Store

Summary and chunk extractions are written to ClickHouse with revision tracking. Re-summarization preserves history.

Built for production audit workflows

Local-first inference

Runs on Ollama with CPU-friendly models out of the box. Audit data never leaves your infrastructure.

Hosted LLM support

Swap to OpenAI or Anthropic with one env var. Use GPT-4o-mini or Claude Haiku for faster, higher-quality summaries.

Version-gated re-summarization

Bump the version string to re-summarize all sessions with a new model or updated prompts. Old summaries are preserved as revisions.

Resumed session detection

When a developer resumes a session after a break, the summarizer detects new events and produces an updated summary automatically.

Multi-language token budgeting

Language-aware character budgets for 28 languages. German, Chinese, Japanese sessions get correct token estimates.

Secret stripping

Regex-based secret detection strips credentials before any text reaches the LLM. Tool inputs are never sent — only extracted file paths.

Docker Compose. That's it.

Prerequisites: a running ClickHouse with audit proxy events, and Docker.

# 1. Apply the migrations
clickhouse-client --host <host> --query "$(cat migrations/001_session_summaries.sql)"
clickhouse-client --host <host> --query "$(cat migrations/002_session_chunk_extractions.sql)"

# 2. Start the summarizer + Ollama
docker compose up -d

# The model is auto-pulled on first startup
# Summaries appear in audit.session_summaries
Audit data stays local by default. With Ollama, all inference runs on your infrastructure. No data is sent to external APIs unless you explicitly configure a hosted provider.

Structured insight from every coding session.

See the documentation for configuration and deployment options.