feat(checks): add tools-duplicate rule for within-field repeated tools - #43
Merged
Conversation
… tools When an author writes `allowed-tools: Read Edit Read`, combineTools silently drops the second Read. The new tools-duplicate check surfaces this as an explicit warning before the deduplication happens so authors learn about the redundant entry rather than having it silently disappear. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Me9172bjbsRuEnq6RV7JKP
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Me9172bjbsRuEnq6RV7JKP
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.
Summary
tools-duplicatecheck that warns when the same tool appears more than once within a singletools:orallowed-tools:field.tools-duplicateentry to the SARIFRULEScatalog so GitHub Code Scanning gets stable metadata for the rule.allowed-tools, duplicate in legacytoolsarray, message content, no-warn on clean lists, no-warn for cross-field duplication (already covered bytool-fields-ambiguous), and no-warn on invalid frontmatter.Motivation
combineToolssilently deduplicates tools across and within fields, so an author writingallowed-tools: Read Edit Readnever learns that their secondReadis a no-op. This check surfaces the problem explicitly before deduplication happens.Self-merge gate checklist
Generated by Claude Code