Trail
Open sourceWorks with Claude Code and Codex↗

Meet Trail

Your agents write the code. Trail keeps the conversation that wrote it: the prompt, the reasoning, the logs. Linked to every commit, one command away from any line.

$ trail why app/webhooks.py:9
/repos/payments-api/commit/fa76cc9d0eece4509d8d23659223290bc888f5d7Open full page ↗

The problem

Code review shows what changed. Not why.

More of your code is written by agents every week. The reasoning behind it, the dead ends, the logs it read and the runs it compared, lives in a chat window that is gone by Friday. Six months later git blame points at a commit that says “fix webhook”, and nobody remembers why.

git blame app/webhooks.py
a41c9e2mayawith db.transaction():
a41c9e2mayaif not db.processed_events…
a41c9e2mayareturn # already handled
9c03b1fsamcapture(order.payment_intent)
fix webhook
why?

The solution

A Trail behind every commit

Trail links each commit to the agent sessions that produced it, plus the logs and artifacts you choose, and stores them as one folder tree per repo.

1You commit

Like always. From your terminal, or the agent commits for you.

2Trail links the session

A git hook finds the Claude Code or Codex session that edited those files.

3Everything is kept

Conversation, diff, logs and artifacts go to your store, one folder per repo.

Trail / payments-api / session
A session in the Trail dashboard: the prompt, tool calls and the commit it produced
Trail-Sessionclaude:68969d63…
Make payment webhook idempotent

Hooks, not habits

Two git hooks find the session that edited the staged files and link it when you commit.

Make payment webhook idempotentTrail-Session: claude:7c1e…Trail-Link: localhost:8787/repos/payments-api/session/7c1e…

Ask any line why

Blame to commit to session to the exact prompt, reasoning and edit that wrote the line.

$ trail why train.py:3
a91f02c Lower LR and lengthen warmup · sam · claude
prompt The 7B LoRA fine-tune keeps blowing up around step 400.
reasoning 2e-4 only delays it. Go to 1e-4 and warmup 500.
artifacts logs/run-17.log, runs/run-19/metrics.json

Logs and artifacts ride along

Training logs, metrics, CI output, reports. Whatever you list in .trail.yaml is kept with the commit.

logs/run-17.logruns/run-19/metrics.jsonlogs/ci-flake-runs.txtreports/refund-abuse.mdconversation.md

Every person, every agent

Maya on Claude Code, Leo on Codex, Sam committing by hand. One history, sessions included.

MmayaclaudeMake payment webhook idempotent
LleocodexReject duplicate refunds
Ssamby handBump stripe to 9.2.0

Browse it like GitHub

Repos as folders, commits with their sessions and diffs, every conversation one click away.

Works where you already work

Claude CodeCodexgitGitHubSupabase StorageS3Local folder

Six commands

trail init

Writes .trail.yaml and installs two git hooks. That is the whole setup.

trail why file:line

Blame, then the commit, then the session: the prompt, the reasoning and the edit.

trail log

Commits in the Trail, with the sessions behind each one.

trail grep pattern

One search across every transcript, log and artifact.

trail show sha

Everything stored for a commit or a session.

trail ui

This dashboard, over your own store.

FAQs

Do I have to change how I work?+

No. Commit like you always do. The hooks find the Claude Code or Codex session that edited the staged files and link it to the commit.

Where is the data stored?+

Wherever you point it: Supabase Storage, any S3-compatible bucket, or a local folder. It is a plain folder tree you can grep.

What ends up in the commit itself?+

Two trailer lines: Trail-Session with the session id and Trail-Link to the dashboard. The transcript stays in your store, not in git.

Which agents does it support?+

Claude Code and Codex today. Each harness is a small parser, so adding another is a short change.

See the Trail behind a commit

Three demo repos, three people, Claude Code and Codex sessions.