agentdiff icon indicating copy to clipboard operation
agentdiff copied to clipboard

Should ledger.jsonl be committed to the repo?

Open codeprakhar25 opened this issue 7 months ago • 1 comments

Question / Discussion

Currently agentdiff init sets up hooks that write attribution data to .agentdiff/ledger.jsonl inside the target repo, and this file gets committed as part of normal git history.

Concerns with the current approach:

  • Adds noise to every commit (auto-amend includes the ledger update)
  • Contributors may not want attribution data stored in their repo
  • Makes git log --oneline harder to read
  • Larger repos accumulate a growing JSONL file

Alternatives worth considering:

  • Store the ledger outside the repo (e.g. ~/.agentdiff/<repo-hash>/ledger.jsonl)
  • Use git notes (git notes add) to attach attribution metadata to commits without touching the working tree
  • Store in a dedicated orphan branch (refs/agentdiff/ledger)
  • Keep current approach but make it opt-in via AUTO_AMEND_LEDGER=1 (already supported)

Trade-offs: The in-repo approach makes attribution portable — clone the repo, get the history. Out-of-repo approaches are cleaner but lose portability.

Would love input from anyone using agentdiff in a team setting.

codeprakhar25 avatar Apr 06 '26 07:04 codeprakhar25

this is worked on as of now it should not be directly commited!

codeprakhar25 avatar Apr 28 '26 06:04 codeprakhar25