🔥 Forge Code VSCode Extension
AI software engineering agent integration for VS Code
Seamlessly integrate Forge Code AI assistant into your VS Code workflow with intelligent file referencing.


This VS Code extension provides seamless integration with Forge Code, an AI software engineering agent that runs in your terminal. The extension enables quick copying of file references in the exact format that Forge understands, streamlining your AI-assisted development workflow.
Features
- Copy File References: Copy file references with line selections to clipboard
- Keyboard Shortcut: Quick access with
CTRL+U (all platforms)
- Installation Prompt: Suggests Forge installation if not detected
Requirements
- Forge Code must be installed and available in your PATH
- VS Code 1.102.0 or higher
Installation
Step 1: Install Forge Code
Option A: NPX (Quick Start)
cd your/project/directory
npx forgecode@latest
Option B: Global Installation
npm install -g forgecode
# or visit https://forgecode.dev for other installation methods
Step 2: Install VS Code Extension
- Install this extension from the VS Code marketplace
- Start using Forge directly from VS Code!
Usage
Keyboard Shortcuts
- CTRL+U: Copy file reference to clipboard (uses
forge.fileReferenceFormat setting)
Context Menu Commands
Right-click in any editor to access:
- Copy Absolute Path: Always copy with absolute path, regardless of settings
- Copy Relative Path: Always copy with workspace-relative path, regardless of settings
These commands are available in the editor context menu (right-click) and provide direct control over the path format, independent of the forge.fileReferenceFormat setting.
The extension generates references in the exact format that Forge understands:
@[<filepath>:<line start>:<line end>]
Examples:
- Single line:
@[src/components/Button.tsx:10:10]
- Line range:
@[src/components/Button.tsx:10:20]
- No selection:
<absolute filepath> (just the full path to the file)
How to Use
Method 1: Keyboard Shortcut
- Select code in any file
- Press CTRL+U
- File reference is copied to clipboard (format based on
forge.fileReferenceFormat setting)
- Paste in any terminal where Forge is running
- Select code in any file (or just open a file)
- Right-click in the editor
- Choose either:
- Copy Absolute Path - Forces absolute path
- Copy Relative Path - Forces relative path
- File reference is copied to clipboard
- Paste in any terminal where Forge is running
Configuration
Access settings via File → Preferences → Settings → Extensions → Forge
Available Settings
- forge.showInstallationPrompt (default:
true): Show installation prompt when Forge is not detected
- forge.autoPaste (default:
true): Automatically paste file references into terminals
- forge.pasteDelay (default:
5000): Delay in milliseconds to allow Forge to start before auto-pasting file references (only works when autoPaste is enabled)
- forge.openTerminal (default:
once): Open terminal when copying file references
once - Open terminal once and reuse it for subsequent operations
never - Never open terminal, only copy file reference to clipboard
- forge.fileReferenceFormat (default:
absolute): Path format for file references
absolute - Use absolute file paths (e.g., /Users/name/project/src/file.ts)
relative - Use workspace-relative paths (e.g., src/file.ts)
- forge.notifications: Control which popup notifications to show
info (default: true) - Show informational notifications
warning (default: true) - Show warning notifications
error (default: true) - Show error notifications
Examples
With Absolute Paths (default)
# Select lines 10-20 in Button.tsx and press CTRL+U
# Result: @[/Users/name/project/src/components/Button.tsx:10:20] copied to clipboard
# Select single line 15 in App.tsx and press CTRL+U
# Result: @[/Users/name/project/src/App.tsx:15:15] copied to clipboard
# No selection, just press CTRL+U in any file
# Result: @[/Users/name/project/src/file.ts] copied to clipboard
# Select lines 10-20 in Button.tsx and press CTRL+U
# Result: @[src/components/Button.tsx:10:20] copied to clipboard
# Select single line 15 in App.tsx and press CTRL+U
# Result: @[src/App.tsx:15:15] copied to clipboard
# No selection, just press CTRL+U in any file
# Result: @[src/file.ts] copied to clipboard
# Paste in your Forge terminal:
forge @[src/components/Button.tsx:10:20] explain this code
Troubleshooting
Forge Not Installed
If you see an installation prompt, you have several options:
Option 1: NPX (Quick Start)
cd your/project/directory
npx forgecode@latest
Option 2: Global Installation
npm install -g forgecode
# Then verify installation
forge --version
Option 3: Other Methods
- Visit forgecode.dev for Homebrew, direct download, and other installation options.
- Follow the setup instructions for your platform.
Getting Started with Forge
# Navigate to your project
cd path/to/your/project
# Start Forge (interactive REPL)
forge
For complete documentation, visit forgecode.dev/docs.
License
Apache 2.0 - See the LICENSE file for details.