Skip to content

donapart/ClaudeSandman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ClaudeSandman

A VS Code extension that connects VS Code with Claude Code (Anthropic), allowing you to get AI-powered code assistance with a diff preview before applying changes.

Features

  • Run on Selection: Send selected code to Claude for modification
  • Run on Current File: Send the entire file to Claude for modification
  • Diff Preview: View changes side-by-side before accepting them
  • Two modes: Use either the Anthropic API or a local Claude CLI

Installation

  1. Install the extension from the VS Code Marketplace (or compile from source)
  2. Configure your settings (see below)

Configuration

Open VS Code settings (File > Preferences > Settings) and search for "Claude Code":

Required Settings

For API Mode (default):

For CLI Mode:

  • claudeCode.cliPath: Path to your Claude CLI executable
    • Default: /usr/local/bin/claude

Optional Settings

  • claudeCode.mode: Choose between api or cli (default: api)
  • claudeCode.model: The Claude model to use (default: claude-sonnet-4-5-20250929)

Example Configuration (settings.json)

{
  "claudeCode.mode": "api",
  "claudeCode.apiKey": "sk-ant-api03-...",
  "claudeCode.model": "claude-sonnet-4-5-20250929"
}

Usage

Running on Selection

  1. Select the code you want Claude to modify
  2. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  3. Run: Claude Code: Run on Selection
  4. Enter your task (e.g., "Add error handling", "Refactor this function")
  5. View the diff and decide whether to accept the changes

Running on Current File

  1. Open the file you want Claude to modify
  2. Open the Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
  3. Run: Claude Code: Run on Current File
  4. Enter your task
  5. View the diff and decide whether to accept the changes

Security

  • API keys are stored in VS Code settings (not in code)
  • CLI mode uses execFile (no shell interpolation)
  • Maximum response size: 200,000 characters
  • No automatic file modifications - all changes require manual review via diff

Development

Building from Source

# Install dependencies
npm install

# Compile TypeScript
npm run compile

# Watch mode for development
npm run watch

Packaging

# Install vsce if you don't have it
npm install -g @vscode/vsce

# Package the extension
vsce package

License

MIT

Credits

ClaudeSandman - Connecting VS Code with Claude Code by Anthropic

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors