Implement with Claude
A VS Code extension that adds CodeLens buttons above functions and methods to implement them using Claude Code.
Features
- Two CodeLens Buttons:
- Implement with Claude - Auto-allows edits, directly implements the function
- Plan with Claude - Creates a plan first before implementing
- Multi-language Support: Works with TypeScript, JavaScript, Python, Go, Rust, Java, C, C++, C#, Ruby, and PHP
- TypeScript Arrow Functions: Detects all function styles including:
function foo() {}
const foo = () => {}
const foo = async (a, b) => {}
- Class methods and properties
- Stub Detection: Identifies empty or stub functions (TODO comments,
pass, throw, panic!, etc.)
Usage
- Open any file containing functions or methods
- Look for the CodeLens buttons above each function:
- ✨ Implement with Claude - Jumps straight into implementation
- 📋 Plan with Claude - Creates a plan for approval first
- Click either button to launch Claude Code with a prompt to implement that function
Configuration
| Setting |
Description |
Default |
implementWithClaude.showForAllFunctions |
Show CodeLens for all functions, not only empty/stub ones |
false |
implementWithClaude.additionalPrompt |
Custom instructions to add to every prompt |
"" |
Requirements
- VS Code 1.74.0 or higher
- Claude Code CLI installed and available in your PATH
Development
# Install dependencies
npm install
# Compile
npm run compile
# Watch for changes
npm run watch
Testing the Extension
- Open this project in VS Code
- Press
F5 to launch the Extension Development Host
- Open a file with functions in the new VS Code window
- Verify CodeLens buttons appear above functions
- Click either button to launch Claude Code
How It Works
- CodeLens Provider: Registers with VS Code to provide CodeLens items
- Symbol Detection: Uses
vscode.executeDocumentSymbolProvider to find functions, methods, and arrow functions
- Command Handler: Extracts function code and constructs a prompt
- Terminal Launch: Opens Claude Code in the integrated terminal with appropriate flags:
- "Implement" uses
--allowedTools Edit Write Bash for auto-allowed edits
- "Plan" uses
--permission-mode plan for plan-first workflow
| |