Getting Started

Quick start

From zero to your first context bundle in five minutes.

1

Install CodeLedger

npm install -g @codeledger/cli
💡No global install required on your own machine — every command below also works with npx @codeledger/cli.
âš ī¸In a browser or cloud AI coding session (Claude Code on the web, Codex cloud, CI) skip npx — those sandboxes often can't reach the npm registry reliably. Run codeledger init once on your own machine first; it vendors a standalone binary into .codeledger/bin/ that works with zero network access once committed.
2

Initialize your repo

Run this once inside your repo. It creates a .codeledger/ directory, writes a default config, and seeds the memory ledgers.

npx @codeledger/cli init
â„šī¸.codeledger/ is safe to commit. Add .codeledger/cache/ to your .gitignore to skip the index cache.
3

Scan the repo

Builds the dependency graph, test map, churn history, and co-commit index. Takes 10–30 seconds on large repos.

npx @codeledger/cli scan

The scan output shows your repo's Coupling Index, Hotspot Score, and top risk drivers. Re-run after major refactors.

4

Activate for a task

Describe your task in plain English. CodeLedger scores every file and writes a ranked bundle to .codeledger/active-bundle.md.

npx @codeledger/cli activate --task "add rate limiting to the API gateway"
💡If you use Claude Code, the UserPromptSubmit hook does this automatically — you never need to type it yourself.
5

Read the bundle

The bundle lists files ranked by relevance score, with reasons and code excerpts. Start here instead of grepping the repo.

cat .codeledger/active-bundle.md

Typical bundles include 12–25 files out of thousands, covering 95%+ of the files you'll actually edit.

6

See your session recap

After you finish coding and commit, check how well the bundle predicted your actual edits.

npx @codeledger/cli session-summary
7

Optional: see it live, without a terminal open

Everything above works from the terminal alone. If you'd rather see status at a glance, the same local state is also available as a browser tab (codeledger panel serve) or a Chrome extension with a toolbar badge and a local review signal on GitHub PRs.

Panel & Chrome extension guide →