local prompt provenance

Every commit has
a backstory.

A local CLI that connects your Codex and Claude Code prompts to the commits, branches, and pull requests they produced.

backstory — install
$curl -fsSL https://backstory.sh/install | bash
$bs ingest

Installs Bun if needed · macOS, Linux, and probably Windows.

Commands

Index
bs ingest
Parse Codex & Claude Code sessions into the local index, then correlate with Git. --full rebuilds, --since <iso> limits, --author <email> sets who counts as you.
Query
bs commit [rev]
Prompts behind a commit. Defaults to HEAD.
bs pr <number>
Prompts behind a GitHub PR. --repo owner/name to target another repo.
bs branch <name>
Prompts on a branch.
bs search <text>
Full-text search across every prompt.
Explore
bs sessions
List recent sessions. --limit N, --repo owner/name.
bs session <id>
Every prompt in one session.
bs stats
Totals by provider and repo.
Hooks & dashboard
bs hook install
Install a git post-commit hook for exact prompt→commit links.
bs hook status
Check which exact-linking hooks are active.
bs web
Open the web dashboard. --port N, --no-open.

Every read command accepts --json for scripts and coding agents.

Or use it in code

import { Backstory } from "@backstory/cli";

using bs = Backstory.open();
await bs.ingest();

const { sessions } = bs.commitReport("HEAD");
const hits = bs.search("deployment");