Nexus CodeNexus Code is a Visual Studio Code extension and companion CLI that turns local AI coding tools into one coordinated chat cockpit. It can route prompts to installed CLI agents such as Gemini, Codex, Claude, Copilot, Aider, or a custom command, enrich prompts with workspace context, stream results back into VS Code, save implementation plans, apply approved plans, review branches, debug failures, and build project maps under The project is designed around a simple workflow:
Core FeaturesVS Code Chat Cockpit
Multi-Agent Provider RoutingNexus can route tasks to multiple local CLI providers:
Provider behavior includes:
Nexus Smart OrchestratorThe built-in Supported stages:
Mode-to-stage flow:
For coding modes, Nexus saves the generated plan instead of immediately modifying files. The user can then approve and apply it with Apply Plan. Plan-First WorkflowNexus supports a safer two-step coding workflow:
This reduces accidental edits because planning and code mutation are separated. Task ModesNexus supports these task modes:
Prompt EnhancementWhen prompt enhancement is enabled, Nexus builds a richer prompt before sending it to a CLI provider. Enhanced prompt context can include:
Prompt enhancement can be disabled with Project RulesCreate this file in the workspace root:
Its contents are automatically injected into enhanced prompts. Use it for project conventions such as architecture rules, coding standards, testing requirements, or forbidden commands. Project Map GenerationNexus can scan the workspace and generate a structured project map under Generated files include:
The scanner:
AI Project SummaryThe extension registers a project summary command that can ask a selected AI provider to summarize the generated project map. It can write:
Branch Review WorkflowReview mode is built for branch diff review. It can:
Debug WorkflowDebug mode prepares a specialized debugging context before running the selected agent. It can detect:
Debug prompts instruct the agent to identify the root cause, keep fixes small, add regression tests when relevant, rerun the failing command when available, and report verification results. Brainstorm WorkflowBrainstorm mode prepares a multi-agent ideation context. It can:
Conversation ContextNexus can include previous chat context in the enhanced prompt, making follow-up requests more useful while still routing through local CLI agents. Conversation features include:
Token Usage EstimatesNexus estimates token usage with It tracks:
The UI includes a conversation token bar and prompt inspection so users can see how much context Nexus added. Git Status After TasksWhen enabled, Nexus runs This helps users immediately inspect what an editing agent changed. Settings UINexus includes a settings panel with:
Default provider configuration enables Gemini and Codex and disables Claude, Copilot, and Aider until the user enables them. About PanelThe extension includes an About panel registered through the Command Guard for Custom ProvidersCustom provider execution validates configured commands before running them. This helps prevent invalid or unsafe custom command definitions from being launched accidentally. Output Parsing and NormalizationNexus includes provider-specific output parsers for:
The output layer normalizes streamed stdout/stderr into cleaner chat output and activity events. Live Pipeline EventsThe internal event bus forwards task and pipeline events to the webview. Supported event types include:
CLI CompanionThe package exposes a Available CLI commands:
|
| Setting | Default | Description |
|---|---|---|
nexus.defaultProvider |
nexus |
Default provider used when routing tasks |
nexus.customProvider.command |
"" |
Executable for the custom provider |
nexus.customProvider.args |
[] |
Arguments for the custom provider; use {{prompt}} in any argument |
nexus.enablePromptEnhancement |
true |
Adds workspace, rules, package, project, debug, review, and conversation context to prompts |
nexus.showRawOutput |
false |
Shows unfiltered stdout/stderr alongside parsed output |
nexus.runGitStatusAfterTask |
true |
Shows changed files after each task completes or stops |
Nexus also stores provider enablement in its own config service. The default provider config is:
{
"version": 1,
"providers": {
"gemini": { "enabled": true, "command": "gemini" },
"codex": { "enabled": true, "command": "codex" },
"claude": { "enabled": false, "command": "claude" },
"copilot": { "enabled": false, "command": "copilot" },
"aider": { "enabled": false, "command": "aider" }
}
}
Custom Provider
Configure a custom provider when you want Nexus to call your own local executable.
Example VS Code settings:
{
"nexus.customProvider.command": "my-agent",
"nexus.customProvider.args": [
"run",
"--prompt",
"{{prompt}}",
"--model",
"{{model}}"
]
}
The CLI fallback can also read:
NEXUS_CUSTOM_COMMAND=my-agent
NEXUS_CUSTOM_ARGS="run --prompt {{prompt}}"
Usage
Open Nexus Chat
- Open a workspace in VS Code.
- Open the Command Palette.
- Run Nexus: Open Chat.
- Open Settings if the setup banner appears.
- Click Scan for CLIs.
- Enable the providers you want to use.
- Choose a provider, mode, and model.
- Type a prompt and send it.
Generate a Project Map
Use Scan Project mode in the UI, or run:
nexus map
Plan Before Editing
- Select provider
Nexus. - Select
Build Agent,Debug Agent,Test Agent, orCode Reviewermode. - Send a task.
- Review
.nexus/plan.mdafter Nexus saves it. - Click Apply Plan to run the implementation stage.
Review a Branch
- Select
Code Reviewermode. - Choose or refresh the base branch.
- Optionally edit
.nexus/agents/code-review.md. - Send the review task.
Debug a Failure
Paste terminal output, a stack trace, or a compiler/test error into Debug mode.
Examples:
npm run compile fails with TS2345 in src/core/types.ts
vitest run failed. no-edit. Explain the root cause and propose a patch.
Development
Scripts
| Script | Purpose |
|---|---|
npm run compile:extension |
Compile the VS Code extension TypeScript |
npm run compile:webview |
Build the React/Vite webview UI |
npm run compile |
Build both extension and webview |
npm run build:cli |
Compile the CLI entrypoint |
npm run watch |
Watch extension TypeScript compilation |
npm run watch:webview |
Watch webview build |
npm run test:webview |
Run Vitest tests |
Project Structure
src/
application/ Use cases, orchestration, pipeline steps
application/nexus/ Nexus smart routing, plan store, mode/stage policy
cli/ `nexus` command implementation
config/ Default config and config service
context/ Prompt context, workspace scanning, project map, rules, review prompt
core/ Agent interfaces, task types, event bus, pipeline contracts
debug/ Debug signal parser and debug prompt builder
git/ Branch, diff, status, and review context helpers
infrastructure/ AI runner integration for project summaries
output/ Output normalization and provider parsers
providers/ Claude, Codex, Gemini, Copilot, Aider, Custom, Nexus agents
runner/ Process runner and command guard
settings/ Settings and About panels
tokens/ Token estimation
webview/ VS Code webview provider, controller, protocol, handlers
webview-ui/ React UI components, i18n, theme, client state
media/
agents/ Bundled agent markdown templates
nexus.svg Activity Bar icon
out/ Compiled extension output
Architecture
Nexus follows a layered design:
VS Code Webview UI
|
ChatController + handlers
|
Pipeline steps + prompt builders
|
AgentRouter / NexusOrchestrator
|
Provider adapters
|
ProcessRunner
|
Local CLI tools
Important architectural concepts:
AgentTaskrepresents one unit of work.AgentCapabilitiesdescribes whether an agent can edit files, run shell commands, search the web, or stream output.AgentRegistrystores all available providers.AgentRouterselects a provider for direct execution.NexusOrchestratorcoordinates staged Nexus workflows.RunAgentUseCaseexecutes a task and publishes lifecycle events.ProcessRunnerlaunches and controls local CLI processes.EventBusdecouples backend execution from UI updates.- Pipeline steps prepare mode-specific context before execution.
Safety Model
Nexus is designed to reduce risky edits by separating intent, context, planning, and execution.
Safety-related behavior includes:
- Plan-first workflow for Nexus coding modes.
- Explicit Apply Plan step before code mutation.
- Stop button for active processes.
- Custom project rules via
.nexus/rules.md. - Review mode focused on concrete diff-grounded issues.
- Debug mode with
no-editsupport. - Command validation for custom providers.
- Git status shown after tasks.
- Generated
.nexus/.gitignoreto avoid committing scan cache/debug artifacts accidentally.
Generated .nexus Files
| Path | Created By | Description |
|---|---|---|
.nexus/rules.md |
User | Optional project rules injected into prompts |
.nexus/plan.md |
Nexus plan stage | Latest saved plan |
.nexus/runs/<task-id>/plan.md |
Nexus plan stage | Per-run saved plan |
.nexus/project-map.md |
Scan Project / CLI map | Project overview |
.nexus/file-tree.txt |
Scan Project / CLI map | Scanned file list |
.nexus/workspace-units.json |
Scan Project / CLI map | Detected project units |
.nexus/scan-cache.json |
Scan Project / CLI map | Scan cache metadata |
.nexus/project-summary.json |
AI summary command | Structured AI project summary |
.nexus/project-summary.raw.txt |
AI summary command | Raw summary output for debugging |
.nexus/agents/code-review.md |
Review mode | Editable code review agent template |
.nexus/agents/brainstorm/*.md |
Brainstorm mode | Editable brainstorm agent personas |
Current Limitations
- Nexus depends on local CLI tools being installed and authenticated separately.
- Web search support depends on the selected provider capability.
- Token usage is estimated with
gpt-tokenizer; it is not provider-billed usage. - The project map scanner is intentionally bounded by depth and file-count limits.
- The
nexusprovider is an orchestrator and does not directly build a shell command. - Some registered commands may be invoked internally even when not all are listed in
package.jsoncontributions.
License
See LICENSE.