A tool to patch the official Claude Code VS Code extension to automatically include command-line arguments when launching Claude Code.
This tool downloads, patches, and repackages the official Claude Code VS Code extension to automatically inject command-line arguments (like --dangerously-skip-permissions) when launching Claude Code from within VS Code.
The official Claude Code VS Code extension launches Claude Code without any way for users to provide command-line arguments. This means you cannot:
- Use
--dangerously-skip-permissionsto bypass file permission checks - Add
--debugflags for troubleshooting - Pass any custom arguments that Claude Code supports
This patcher modifies the extension's JavaScript code to inject your desired arguments into both execution paths:
- Shell Integration Path: When VS Code's terminal shell integration is available
- Fallback Path: When shell integration fails (after 3-second timeout)
- Node.js and npm installed
- VS Code Extension CLI tool (
vsce) - automatically installed by the script curlandunziputilities
# Use default argument (--dangerously-skip-permissions)
./patch-claude-extension.sh
# Custom arguments
./patch-claude-extension.sh --arg "--debug --verbose"
# Auto-install after patching
./patch-claude-extension.sh --install
# Custom arguments with auto-install
./patch-claude-extension.sh --arg "--debug" --install
# Get help
./patch-claude-extension.sh --helpDownloads the official Claude Code extension from the VS Code Marketplace without any modifications.
./download-extension.shMain patcher script that injects command-line arguments into Claude Code launches.
# Default usage (adds --dangerously-skip-permissions)
./patch-claude-extension.sh
# Custom arguments
./patch-claude-extension.sh --arg "--your-custom-args"
./patch-claude-extension.sh --arg "--debug" --install
./patch-claude-extension.sh --helpOptions:
-a, --arg ARG- Argument to inject (default: --dangerously-skip-permissions)-i, --install- Automatically install after patching-o, --output DIR- Output directory (default: current directory)-k, --keep-temp- Keep temporary working directory-h, --help- Show help message
The VS Code extension has two code paths for launching Claude Code:
-
Shell Integration (
executeCommand):// Before: let q="claude"; // After: let q="claude --dangerously-skip-permissions";
-
Fallback (
sendText):// Before: Q.sendText("claude") // After: Q.sendText("claude --dangerously-skip-permissions")
- Download: Fetches the latest official extension from VS Code Marketplace
- Extract: Unpacks the
.vsixfile (which is essentially a ZIP archive) - Patch: Applies surgical edits to the minified JavaScript code
- Version Bump: Automatically increments the version number
- Repackage: Creates a new
.vsixfile with the modifications - Install: Optionally installs the patched extension
- Backup Creation: Original files are backed up before modification
- Patch Verification: Confirms changes were applied correctly
- Version Management: Prevents conflicts with official updates
- Error Handling: Clear error messages and cleanup on failure
This flag tells Claude Code to skip file permission checks. Use with caution:
- β Safe: In trusted development environments
- β Safe: For personal projects and learning
β οΈ Caution: When working with sensitive codebases- β Avoid: In production environments
- Only use in trusted environments where you control all code
- Understand what flags do before adding them
- Keep backups of important work
- Review generated extensions before installing
Extension not installing:
# Try uninstalling the official version first
code --uninstall-extension anthropic.claude-codePatch verification failed:
- The official extension may have been updated
- Check if the script needs updating for new extension versions
VS Code not recognizing the extension:
- Make sure you restarted VS Code after installation
- Check that the extension appears in Extensions panel
- Check the examples directory for usage scenarios
- Run scripts with
-hor--helpfor detailed options - Look at the generated backup files to understand changes
See the examples/ directory for:
- Common use cases and scenarios
- Advanced configuration examples
- Integration with development workflows
- Troubleshooting specific issues
Contributions welcome! This tool helps the Claude Code community by enabling command-line argument injection.
- Support for additional extension versions
- Better error messages and recovery
- More sophisticated argument validation
- Integration with VS Code settings
MIT License - see LICENSE file for details.
The Claude Code VS Code extension is excellent, but it doesn't provide a way to pass command-line arguments to Claude Code. This limitation affects developers who need:
- Permission flexibility with
--dangerously-skip-permissions - Debug information with
--debugor--verboseflags - Custom configurations through command-line options
Rather than waiting for official support, this patcher provides an immediate solution while maintaining the full functionality of the original extension.
Note: This is an unofficial tool that modifies the official Claude Code extension. It's provided as-is for educational and development purposes.