Morgan Lunt 3b93169856
receipts: count only work that can be checked
The first cut measured the agent's activity and reported it as the
developer's. Rewrites the attribution so every number is one you could
defend to someone who pushed back on it.

What a number now means:

- Projects resolve to a git root, or to the directory the work happened
  in when there isn't one. Not basename(cwd), which turned a home
  directory into a 49% "project" and split one repo across several rows.
- A session's spend follows the files it touched, reads included, split
  across projects. Subagents share their parent's session, so their work
  lands on the same project with no special case.
- Claude Code's own machinery — scratchpad, tool-results, ~/.claude, and
  this report's own past output — is excluded. It was 82% of the reported
  line count.
- Commits are joined against git: authored under the identity git uses in
  that repo, AND touching a file Claude Code touched. The old identity
  grep counted a snapshot cron's 2,209 commits and claimed the developer
  committed on every active day they worked.
- Work with no project — web search, chat tools, dashboards — is named as
  research rather than filed under whatever directory the shell sat in.

What's gone, and why:

- The activity/spend breakdown. A turn's cost is ~90% context handling,
  half of it re-reading what earlier turns added, so charging it to
  whichever tool fired is a modeling choice rather than a measurement —
  and the choice decides the answer. On one real month three defensible
  weightings put web search at 11%, 28% or 51%. Per-project spend
  survives the same test and stays.
- The `git commit` counter. A Bash call carries no working directory, so
  a commit in a throwaway fixture repo can't be told from a real one.
  Measured 33 against 4.

Also: local calendar arithmetic (active days could exceed the window),
paths normalized so Windows doesn't silently count the scratchpad as the
user's work, HTML written 0600 and refusing symlinks, a CSV export with
formula injection neutralized, print output that stays vector text, and
perforated edges.

The report says which columns sum and which don't, and distinguishes "no
commits" from "git couldn't be read" — unknown is not zero.
2026-07-17 11:47:45 -07:00
..