Problem
In cmd/hooks.go:231, for repos under 5000 files, showDiffVsMain runs codemap --diff and pipes directly to stdout without the 60KB hard cap.
The tree output path captures into a buffer and truncates, but the diff path does not. On a branch with many changed files in a medium-sized repo, this could produce unexpectedly large output.
Suggested fix
Capture codemap --diff output into a buffer and apply the same limits.MaxContextOutputBytes truncation used for tree output.
Context
Flagged during review of #22. Low risk since it only applies to repos under 5000 files, but inconsistent with the tree output which has the hard cap.
Problem
In
cmd/hooks.go:231, for repos under 5000 files,showDiffVsMainrunscodemap --diffand pipes directly to stdout without the 60KB hard cap.The tree output path captures into a buffer and truncates, but the diff path does not. On a branch with many changed files in a medium-sized repo, this could produce unexpectedly large output.
Suggested fix
Capture
codemap --diffoutput into a buffer and apply the samelimits.MaxContextOutputBytestruncation used for tree output.Context
Flagged during review of #22. Low risk since it only applies to repos under 5000 files, but inconsistent with the tree output which has the hard cap.