fix: enforce 10-file cap across all transcript lines in precompact#140
Merged
claude[bot] merged 1 commit intomainfrom Feb 27, 2026
Merged
fix: enforce 10-file cap across all transcript lines in precompact#140claude[bot] merged 1 commit intomainfrom
claude[bot] merged 1 commit intomainfrom
Conversation
The break in the inner word loop only exited that loop, allowing filesInFocus to grow unboundedly across many transcript lines. Add a guard at the top of the outer loop to stop processing once the 10-file cap is reached. Fixes #137 Co-Authored-By: Grey Newell <greyshipscode@gmail.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug where filesInFocus in cmd/precompact.go could exceed the intended 10-file cap when processing long transcripts.
The break inside the inner strings.Fields word loop only exited that inner loop. The outer loop over transcript lines continued processing, appending unique file paths from subsequent lines even after the cap was reached.
Fix: Added a guard at the top of the outer loop to stop processing once len(filesInFocus) >= 10.
Closes #137
Generated with Claude Code