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.
$curl -fsSL https://backstory.sh/install | bash
$bs ingest
Installs Bun if needed · macOS, Linux, and probably Windows.
Reference
Commands
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.
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.
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.
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.
Index
Query
Explore
Hooks & dashboard
Every read command accepts --json for scripts and coding agents.
Typed API
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");