Harness VS Code Extension
The Harness VS Code Extension brings Harness CI/CD pipeline monitoring, log viewing, deployment approvals, and AI-assisted debugging directly into Visual Studio Code. You can track pipeline executions, inspect logs, and approve deployments without leaving your IDE.
Looking for the Harness AI Code Agent (AI code completions and chat)? That feature has been updated. Go to Harness AI overview to find current AI-assisted development tools.
Before you begin
- VS Code: Version 1.85.0 or later.
- Harness account: An active Harness account with project access.
- Personal Access Token (PAT): Generated in your Harness account. Go to Manage API keys to create one.
Install the extension
- Open the Extensions view in VS Code (
Cmd+Shift+Xon macOS orCtrl+Shift+Xon Windows/Linux). - Search for Harness.
- Select the Harness extension published by Harness, Inc.
- Select Install.
Alternatively, install from the command line:
code --install-extension harness-inc.harness-vscode
Or go to the VS Code Marketplace and select Install.
Configure the extension
- Select the Harness icon in the VS Code Activity Bar.
- Run the command Harness: Configure API Key from the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P). - Enter your Harness instance URL (default:
https://app.harness.io). - Enter your PAT. The extension automatically extracts your account ID from the token.
- Select your organization and project.
Use environment variables (CI/CD-friendly)
Set the following environment variables before launching VS Code to skip the credential prompts:
export HARNESS_API_KEY="your-pat"
export HARNESS_BASE_URL="https://app.harness.io"
export HARNESS_ACCOUNT_ID="your-account-id"
Set harness.authSource to env in your VS Code settings to activate environment variable authentication.
Monitor pipelines
The extension adds two views to the Harness Activity Bar panel:
- Pipelines: Browse all accessible pipelines. Search, filter by status, and pin favorites.
- Executions: View full execution history filtered by pipeline or status.
Both views refresh automatically on a configurable interval (default: 10 seconds). The extension pauses polling when the sidebar is hidden or VS Code loses focus to conserve resources.
View pipeline logs
Select any execution to open step-level logs in a dedicated editor tab with syntax highlighting. Failed steps are highlighted for quick triage.
Re-run a failed stage or test
Right-click a failed stage or test in the Executions view and select Re-run Failed Stage or Re-run Test via Harness to trigger a retry without leaving VS Code.
Export an execution
Select Export Current Execution to JSON from the Command Palette to export the latest execution details for offline debugging or sharing with your team.
Manage approvals
When a pipeline reaches an approval gate, the extension surfaces an inline prompt in the Executions view. Select Approve or Reject to respond without opening the Harness UI.
Supported approval types:
- Harness native approvals
- Jira approvals
- ServiceNow approvals
Use AI-assisted debugging
The extension automatically injects pipeline context (pipeline name, execution status, step logs, branch and commit) into AI assistants when a failure is detected.
Supported AI platforms:
| Platform | Mode | Configuration |
|---|---|---|
| Claude Code | CLI: fully automated; Extension: semi-automated | Active Claude Code session required |
| GitHub Copilot | Auto-detected via VS Code platform | Uses .vscode/mcp.json |
| Cursor | Auto-detected with auto-paste | Go to Harness AI Cursor Plugin to configure the Cursor integration |
Configure MCP scope for Claude Code
The extension can write MCP configuration at two scopes:
| Scope | Path | Sharing |
|---|---|---|
| Project | .mcp.json in workspace root | Commit to share with your team |
| Global | ~/.claude.json | Personal only, applies to all projects |
Configuration reference
| Setting | Type | Default | Description |
|---|---|---|---|
harness.baseUrl | string | https://app.harness.io | Harness instance URL. Supports on-premises deployments. |
harness.accountIdentifier | string | "" | Account ID. Auto-extracted from PAT if left empty. |
harness.authSource | enum | pat | Authentication source: pat or env. |
harness.orgIdentifier | string | default | Organization identifier. |
harness.projectIdentifier | string | "" | Project identifier. |
harness.pollingIntervalSeconds | number | 10 | Pipeline status refresh interval in seconds (5–120). |
harness.defaultView | enum | thisCommit | Default sidebar view: thisCommit or allExecutions. |
harness.logLevel | enum | info | Log verbosity: off, error, warn, info, or debug. |
Switch projects per workspace
Run Harness: Switch Project (This Workspace) from the Command Palette to set a different org and project for the current workspace. This override is stored in workspace settings and does not affect other projects.
Troubleshooting
Next steps
- Go to Harness AI Cursor Plugin to set up AI pipeline management in Cursor.
- Go to Harness MCP Server to configure the Harness MCP server for your AI assistant.
- Go to Manage API keys to create or rotate your PAT.