🔥 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)
- AI Commit Messages: Generate intelligent commit messages using Forge AI
- 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 the editor, on files, or on folders in the file explorer to access the Forge Code menu with the following commands:
- Start New Session: Create a new Forge terminal session
- Copy Absolute Path: Copy file reference with absolute path, regardless of settings
- Copy Relative Path: Copy file reference with workspace-relative path, regardless of settings
All Forge commands are organized under the Forge Code menu in both the editor and file explorer context menus for easy access.
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
- Navigate to "Forge Code" menu
- Choose one of the copy options:
- 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
- Right-click on any file or folder in the file explorer
- Navigate to "Forge Code" menu
- Choose one of the copy options:
- 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
AI Commit Message Generation
Generate intelligent commit messages with a single click:
- Make changes to your code and stage them (or leave unstaged)
- Click the Forge icon in the Source Control view toolbar
- AI generates commit message based on your changes
- Review and commit manually when ready
The AI analyzes:
- Your git diff (staged or unstaged changes)
- Recent commit messages (to match your style)
- Current branch name
- Project context
Configuration
Access settings via File → Preferences → Settings → Extensions → Forge
Available Settings
- 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
This is proprietary software. All rights reserved.