Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

jimmystridh/claude-code-vscode-patcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Claude Code VS Code Extension Patcher

A tool to patch the official Claude Code VS Code extension to automatically include command-line arguments when launching Claude Code.

🎯 What This Does

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 Problem

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-permissions to bypass file permission checks
  • Add --debug flags for troubleshooting
  • Pass any custom arguments that Claude Code supports

The Solution

This patcher modifies the extension's JavaScript code to inject your desired arguments into both execution paths:

  1. Shell Integration Path: When VS Code's terminal shell integration is available
  2. Fallback Path: When shell integration fails (after 3-second timeout)

πŸš€ Quick Start

Prerequisites

  • Node.js and npm installed
  • VS Code Extension CLI tool (vsce) - automatically installed by the script
  • curl and unzip utilities

Basic Usage

# 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 --help

πŸ“‹ Available Scripts

download-extension.sh

Downloads the official Claude Code extension from the VS Code Marketplace without any modifications.

./download-extension.sh

patch-claude-extension.sh

Main 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 --help

Options:

  • -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

πŸ”§ How It Works

Technical Details

The VS Code extension has two code paths for launching Claude Code:

  1. Shell Integration (executeCommand):

    // Before: let q="claude";
    // After:  let q="claude --dangerously-skip-permissions";
  2. Fallback (sendText):

    // Before: Q.sendText("claude")
    // After:  Q.sendText("claude --dangerously-skip-permissions")

Patching Process

  1. Download: Fetches the latest official extension from VS Code Marketplace
  2. Extract: Unpacks the .vsix file (which is essentially a ZIP archive)
  3. Patch: Applies surgical edits to the minified JavaScript code
  4. Version Bump: Automatically increments the version number
  5. Repackage: Creates a new .vsix file with the modifications
  6. Install: Optionally installs the patched extension

Safety Features

  • 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

⚠️ Security Considerations

What --dangerously-skip-permissions Does

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

Best Practices

  1. Only use in trusted environments where you control all code
  2. Understand what flags do before adding them
  3. Keep backups of important work
  4. Review generated extensions before installing

πŸ› Troubleshooting

Common Issues

Extension not installing:

# Try uninstalling the official version first
code --uninstall-extension anthropic.claude-code

Patch 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

Getting Help

  1. Check the examples directory for usage scenarios
  2. Run scripts with -h or --help for detailed options
  3. Look at the generated backup files to understand changes

πŸ“– Examples

See the examples/ directory for:

  • Common use cases and scenarios
  • Advanced configuration examples
  • Integration with development workflows
  • Troubleshooting specific issues

🀝 Contributing

Contributions welcome! This tool helps the Claude Code community by enabling command-line argument injection.

Areas for Improvement

  • Support for additional extension versions
  • Better error messages and recovery
  • More sophisticated argument validation
  • Integration with VS Code settings

πŸ“„ License

MIT License - see LICENSE file for details.

⚑ Why This Tool Exists

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 --debug or --verbose flags
  • 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.

About

A tool to patch the Claude Code VS Code extension to automatically inject command-line arguments like --dangerously-skip-permissions when launching Claude Code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages