Skip to content

code_changelog

code_changelog returns the commit history for a named function — not the entire file. It filters the git log to only commits that touched the function’s body, giving a precise history of when and why that specific logic changed.

code_changelog(name="PaymentService.charge")
code_changelog(name="AuthService.validate", limit=10)
ParameterTypeDefaultDescription
namestringrequiredFunction or method name
filestringFile path hint if the name is ambiguous
limitnumber5Max commits to return
PaymentService.charge — 3 commits
2024-11-12 alice "add idempotency key to prevent double charges"
2024-09-03 bob "increase timeout for slow card networks"
2024-07-18 alice "initial payment integration"
  • Understand why a function was written the way it is
  • Find who last changed a function before a bug appeared
  • See the evolution of business logic over time
ToolScope
git log src/services/payment.tsEvery commit that touched any line in the file
code_changelog(name="charge")Only commits that touched this function’s body

Function-level history is far more precise — a file may have dozens of commits, but only a few touch the function you care about.