Penny docs

Penny runs next to the coding agents you already use. It reads the session files they keep on your machine and answers questions they don't: what you used, who wrote a line, and where the last session left off. It also keeps every agent on the same project notes.

Install

Penny needs Node.js 20 or newer.

npm install -g penny-code     # installs the `penny` command
penny                         # run it inside a project

Or try it without installing: npx penny-code. There's nothing to configure and no account. Penny finds Claude Code sessions in ~/.claude and Codex sessions in ~/.codex; set CLAUDE_CONFIG_DIR or CODEX_HOME if you've moved them.

The overview

Running penny with no arguments prints one screen: this week's usage per agent, the agent sessions that worked in the current folder, any open handoff, whether your project notes are in sync, and a short list of next steps. It's the quickest way to see what Penny knows.

Usage and limits

penny usage              # last 7 days
penny usage --days 30
penny usage --json

For each agent you get the number of sessions, the tokens used, the last five hours, and the session that used the most.

  • Codex records your plan's rate limits in its session files, so Penny shows each window (for example the 5-hour and weekly limits), how much of it is used, and when it resets. Lines turn yellow at 80%.
  • Claude Code doesn't store plan limits locally. Use /usage inside Claude Code for those; Penny shows tokens and what they'd cost at API prices.
On a subscription you don't pay per token, but your limits are measured in tokens. The dollar figure is a yardstick for how heavy a session was, not a bill.

For a breakdown of Claude Code by project, model and day, run penny cc spend, or open the Spend Explorer and drop in your transcripts. It runs entirely in your browser.

AI blame

penny blame src/orders.ts          # summary: which sessions wrote this file
penny blame src/orders.ts:40-80    # line by line
penny blame src/orders.ts --days 30 --json

Each time Claude Code or Codex edits a file, its session log records the lines it added and the prompt it was answering. Penny reads those logs (the last 90 days by default) and matches the lines in your file today against them. Each matched line is credited to the most recent edit that introduced exactly that text.

  • It works retroactively, on code written before you installed Penny.
  • Lines you've since changed by hand don't match, so they aren't claimed.
  • Blank lines, lone braces and other very short lines are skipped. They'd match everywhere and say nothing.
  • Sessions whose logs have been deleted can't be traced.

Shared notes

Every agent reads its own instructions file: Claude Code reads CLAUDE.md, Codex and OpenCode read AGENTS.md, and so on. Penny keeps your project notes in .penny/memory.md and writes them into each of those files.

penny memory add "use pnpm, never npm"
penny memory                     # list notes and where they're synced
penny memory remove 2
penny memory sync --all          # also write GEMINI.md, Cursor and Copilot files
penny memory check               # exits 1 if any file is out of date (for CI)

Notes go inside a marked block, between <!-- penny:memory:start --> and <!-- penny:memory:end -->. Everything else in the file is left as it is.

FileRead byWritten
CLAUDE.mdClaude Codealways
AGENTS.mdCodex, OpenCode, Cursor and othersalways
GEMINI.mdGemini CLIif it exists, or with --all
.cursor/rules/penny.mdcCursorif .cursor/ exists, or with --all
.github/copilot-instructions.mdGitHub Copilotif it exists, or with --all

Handoffs

A handoff is a one-page Markdown note in .penny/handoffs/: the task, which agent did it, why it stopped, the files it changed, the commands it ran, and the last thing the agent said. It lets the next session start from a page instead of from nothing, or instead of re-reading a whole transcript.

penny handoff                      # from the latest session in this folder
penny handoff --from codex --note "refund test still failing"
penny pickup --to claude           # or codex, gemini
penny pickup --print               # print the prompt to paste anywhere

penny pickup starts the agent you name with the newest open handoff as its first message, then marks the handoff as picked up. With Claude Code you can also have a handoff written automatically whenever a session that changed files ends; see below.

Claude Code extras

penny cc install --budget 2     # status line, $2 spending cap, auto-handoffs
penny cc budget 5               # change the cap
penny cc budget off             # remove the cap
penny cc status                 # what's installed
penny cc uninstall              # remove everything Penny added

Install adds three entries to ~/.claude/settings.json (or .claude/settings.local.json with --project), after backing up the file:

  • A status line with the session's cost at API prices, its context size and, with a cap, a bar. An existing status line is kept unless you pass --force.
  • A spending cap (a PreToolUse hook). At 80% it asks Claude to prioritize finishing. At the cap it denies tool calls with an instruction to wrap up and summarize, so the session ends with a summary instead of a half-made change.
  • Auto-handoffs (a SessionEnd hook). When a session that edited files ends, a handoff is written to the project.

Restart Claude Code afterwards. Uninstall removes only Penny's entries and leaves your other settings as they were.

Every hook fails open. If anything goes wrong inside Penny, it lets Claude Code carry on rather than block your work.

Claude Code plugin (no terminal needed)

If you use Claude Code in the desktop app, or would rather not open a terminal, install Penny as a plugin. Type these in Claude Code:

/plugin marketplace add sarthwa8/penny
/plugin install penny@penny

Penny's features then become slash commands, and Claude explains the results in plain language:

CommandWhat it does
/penny:overviewUsage this week and what's going on in this project
/penny:usageUsage per agent, the last five hours, Codex limits
/penny:blame [file]Which AI session wrote a file's lines. With no file, lists files an AI edited
/penny:notes [add "…"]One set of project notes for every agent
/penny:handoffWrite a handoff note from the latest session
/penny:pickupContinue the latest handoff in this session
/penny:budget [usd|off]Per-session spending cap

The plugin also writes a handoff automatically when a session that changed files ends. It uses your installed penny command if there is one, otherwise npx penny-code, so it needs Node.js 20 or newer. If you also ran penny cc install, run penny cc uninstall so the hooks don't run twice.

Supported agents

AgentUsage, blame, handoffsShared notes
Claude Codeyesyes
Codex CLIyes, including plan limitsyes
OpenCodenot yetyes, via AGENTS.md
Cursornot yetyes
Gemini CLInot yet; can pick up handoffsyes
GitHub Copilotnot yetyes

Reading another agent's sessions needs its log format to be stable and documented. If you'd like one added, open an issue.

Penny's own agent

Penny also ships a small coding agent of its own, built on the Claude Agent SDK, for people who pay per token with an API key and want hard cost control. It's optional; nothing above needs it.

export ANTHROPIC_API_KEY=sk-ant-...
penny agent --budget 1             # interactive session capped at $1
penny agent --plan                 # read-only plan with a cost estimate, then approve
penny agent -p "summarize src/" --budget 0.25 --json
penny estimate "add rate limiting to login"   # cost ceilings, no API call
penny demo                         # scripted tour, no key needed

Budgets warn at 80%, give the agent one wrap-up turn at 100%, then halt and write a handoff. A loop guard pauses the agent when the same call keeps failing, and /undo restores files changed since your last prompt. Every turn's cost is recorded in ~/.penny/ledger.jsonl, hash-chained so edits are detectable; penny spend and penny doctor read it.

Command reference

pennyOne-screen overview for this project.
penny usageWhat each agent used, and plan limits where recorded. --days, --json.
penny blame <file>Which AI session wrote each line. file:10-40 for line by line.
penny memoryadd, remove, sync, check. --all for every file.
penny handoffWrite a handoff from the latest session here. --from, --note.
penny pickupContinue the newest handoff. --to claude|codex|gemini, --print.
penny handoffsList handoff notes; --show prints the newest.
penny cc …install, uninstall, budget, spend, status for Claude Code.
penny agentPenny's own budgeted coding agent.
penny estimateCost ceilings for a task, without an API call.
penny spend, sessionsSpend and sessions from Penny's own agent.
penny modelsBuilt-in prices. Override in ~/.penny/pricing.json.
penny doctorChecks your setup and the ledger's integrity.

Privacy

Penny has no telemetry and no server. It reads your agents' session files locally and writes only to your project's .penny/ folder, the instruction files you ask it to sync, and (if you install the extras) Claude Code's settings. The Spend Explorer reads files in your browser and uploads nothing. Commit .penny/ to share notes and handoffs with your team, or add it to .gitignore.