tattletale
Paste this to your coding agent:
Set up https://github.com/getsentry/tattletale to send my coding-agent sessions to a new Sentry project.
Tattles on your coding agents. tattletale sends your Claude Code, Codex, OpenCode and Pi sessions to a Sentry
project as agent traces:
- one conversation per session;
- a span per model call, with exact input, cache and output tokens;
- tool calls, with arguments, results and sizes;
- subagents nested under the tool call that launched them;
- compactions.
Then you, or an agent, can find where tokens go in Sentry's Explore → Conversations and span queries.
All it needs is the DSN of the Sentry project to send to. It runs on Node 22.18 or later and has no
runtime dependencies.
Experimental. Published on npm as @sentry/tattletale.
Quick start
npx @sentry/tattletale setup --dsn '<SENTRY_DSN>' # optionally scope it, see below
npx @sentry/tattletale install # hook into Claude Code, Codex, OpenCode and Pi
npx @sentry/tattletale status
install sets up whichever of the four agents you have (or pick with --claude, --codex, --opencode,
--pi). Codex asks you, once, to approve the new hooks under /hooks. OpenCode gets a plugin file in
~/.config/opencode/plugins/ and Pi an extension in ~/.pi/agent/extensions/; both pick it up in sessions started
afterwards. New sessions show up in Sentry within minutes.
Or let your agent do it
The plugin ships a setup skill (skills/setup-tattletale/SKILL.md). Tell
Claude Code or Codex: "set up tattletale, send to , only for the terra repo". The skill
covers getting a DSN (including through the Sentry MCP), choosing the scope, installing and verifying.
Choose which sessions are sent
By default every session is sent. Narrow it with setup; matching uses each session's working directory.
| You want | Run |
|---|
| Only the terra repo, in any folder or worktree | setup --dsn … --repo getsentry/terra |
| Only sessions under a folder | setup --dsn … --include ~/code/terra |
| A few repos or folders | repeat --repo / --include |
| Everything except personal stuff | setup --dsn … --ignore ~/personal |
| Only counts and timings, no prompts or code | add --content metadata |
| Back to everything | setup --everything |
Rules:
- Folder rules match that folder and everything below it;
~/code/terra does not match ~/code/terraform.
- Repo rules (
--repo or --include repo:owner/name) match on the folder's git origin remote, so
worktrees anywhere count. --repo terra matches any owner.
- Ignore rules always win.
Spans carry vcs.repository.name, so you can also slice by repo in Sentry.
Replay past sessions
New sessions are sent automatically. To send older ones, use replay (alias backfill). Do a dry run first:
npx @sentry/tattletale verify --days 7 # local token reconciliation, sends nothing
npx @sentry/tattletale replay --days 7 --dry-run # what would be sent from the last week
npx @sentry/tattletale replay --since 2026-10-01 --until 2026-10-15
npx @sentry/tattletale replay --session 4d64aace # one session (ID or prefix)
npx @sentry/tattletale replay ~/Downloads/old-transcripts # files or folders, e.g. from another machine
- Never doubles. Spans already in Sentry are skipped, so replaying the same range twice sends nothing new.
- Your scope still applies. Sessions outside your folder and repo rules are skipped.
- Oldest first. Sessions are replayed in age order, so an original session claims history that a later
fork copied.
- Files and folders count as finished. Explicit files or folders are treated as complete sessions. Folders
are searched for
*.jsonl and *.jsonl.zst, with Codex archives included, and for OpenCode exports
(ses_*.json, as written by opencode export). Without paths, OpenCode sessions are read from its database.
Pi sessions are recognized by their file names (<timestamp>_<id>.jsonl).
Limits:
- Sentry retention. Sentry drops spans older than the project's retention at ingest.
- Claude Code cleanup. Claude Code deletes transcripts after 30 days by default. Set
cleanupPeriodDays
higher in ~/.claude/settings.json to keep more history replayable.
npx @sentry/tattletale --help lists every command.
Development
pnpm install
pnpm check # tsc (strict) + oxlint + oxfmt --check + tests
pnpm build # dist/ (what npm ships; Node won't strip types under node_modules)