fix: render array CLI params as repeatable flags in tool guidance#318
Merged
zbigniewsobiecki merged 1 commit intodevfrom Feb 16, 2026
Merged
fix: render array CLI params as repeatable flags in tool guidance#318zbigniewsobiecki merged 1 commit intodevfrom
zbigniewsobiecki merged 1 commit intodevfrom
Conversation
Claude Code agents were passing --items as a single JSON array string (e.g. --items '["Step 1", "Step 2"]'), creating one malformed checklist item instead of individual items. This happened because buildToolGuidance() rendered array params as `--items <array>`, giving no indication that repeated flags are needed. - Extract formatParam() helper from buildToolGuidance() to reduce cognitive complexity and handle array-type params - Array params now render as `--item <string> (repeatable)` instead of `--items <array>` - Rename CLI flag from --items to --item (singular) to match convention - Rename tool manifest param from items → item to match the CLI flag - Add test coverage for array parameter rendering (required + optional) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 16, 2026
Merged
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
--items '["Step 1", "Step 2"]'(JSON array as single arg) instead of--item "Step 1" --item "Step 2"(repeated flags)formatParam()helper frombuildToolGuidance()to reduce cognitive complexity and cleanly handle array-type parameter rendering--itemsto--item(singular) to match the repeated-flag convention, with matching tool manifest updateTest plan
--item <string> (repeatable)(required)[--tag <string> (repeatable)]formatParam()extraction)🤖 Generated with Claude Code