Skip to content

Conversation

@dario-github
Copy link

Summary

  • Changed --tools to --allowedTools (correct camelCase format)
  • Changed --allowed-tools to --allowedTools
  • Fixes "unknown option '--tools'" error in Claude CLI 1.0.48+

Problem

The extension was using incorrect CLI flags:

  • --tools (doesn't exist)
  • --allowed-tools (wrong format)

The correct flag is --allowedTools (camelCase).

Test plan

  • Verified with claude --help that --allowedTools is the correct flag
  • Test "Edit with AI" workflow in Cursor/VSCode

🤖 Generated with Claude Code

- Changed --tools to --allowedTools (correct camelCase format)
- Changed --allowed-tools to --allowedTools
- Fixes "unknown option '--tools'" error in Claude CLI 1.0.48+

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@breaking-brake
Copy link
Owner

Thank you for catching this CLI flag issue!

I did some additional investigation into the Claude Code CLI flags from official documentation and found some important details.

Investigation Results

Findings

Flag Status Purpose
--tools ✅ Valid Restricts which tools are available to the AI
--allowedTools ✅ Valid Tools that execute without permission prompts
--allowed-tools ❌ Invalid Correct format is --allowedTools (camelCase)

Key Difference

# --tools: Only Bash,Edit,Read are available (other tools are hidden)
claude -p --tools "Bash,Edit,Read" "query"

# --allowedTools: All tools available, but only specified ones run without prompts
claude -p --allowedTools "Bash,Edit,Read" "query"

Issue with Current PR

Change Assessment
--allowed-tools--allowedTools ✅ Correct fix
Removing --tools Incorrect - this flag is valid and serves a different purpose

Suggested Fix

Both flags should be used together to maintain the original intent (tool restriction + auto-approval):

if (allowedTools && allowedTools.length > 0) {
  args.push('--tools', allowedTools.join(','));
  args.push('--allowedTools', allowedTools.join(','));  // Fixed to camelCase
}

Sources

I will submit a corrected fix.

@breaking-brake
Copy link
Owner

I've created #366 (with @dario-github specified as Co-Authored-By).

Feel free to either update this PR or confirm that the content of PR #366 looks good to you - whichever you prefer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants