SANIX — Agentic Neural Intelligence eXecutor for VS Code
SANIX is a self-directing, multi-provider, memory-aware, sub-agent-capable agentic CLI that rivals Claude Code, Cursor Agent, and Hermes combined. This package brings it into the editor you already live in, with a sidebar chat webview, inline edit, and deep integration with the SANIX CLI session store.
Table of Contents
Features
Requirements
InstallationFrom the Marketplace (recommended)
From a
|
| Command | Description |
|---|---|
SANIX: Open Chat |
Reveals and focuses the SANIX sidebar chat webview. |
SANIX: Send Selection to Chat |
Sends the active editor's selection to the chat sidebar. |
SANIX: Inline Edit (Cmd+K) |
Opens an input box; the LLM's response replaces the selection. |
SANIX: Run Agent... |
QuickPick of the 22 SANIX agents; runs the chosen one. |
SANIX: Run UltraWorker |
Prompts for a goal; runs the UltraWorker orchestrator. |
SANIX: Explain Selection |
Sends the selection to sanix explain. |
SANIX: Fix Issues in File |
Runs sanix fix on the active file. |
SANIX: Generate Commit |
Runs sanix commit (dry-run first; user confirms). |
SANIX: Doctor (Health Check) |
Runs sanix doctor and shows the JSON report. |
SANIX: Sessions — List |
QuickPick of all sessions; pick one to switch. |
SANIX: Sessions — Switch |
InputBox for a session id to switch to directly. |
SANIX: Show Cost (Today) |
Shows today's USD cost in an info message + status bar. |
Configuration
Open settings (Cmd/Ctrl+,) and search for sanix:
| Setting | Type | Default | Description |
|---|---|---|---|
sanix.cliPath |
string |
"" |
Absolute path to the sanix CLI binary. Empty = auto-detect on PATH. |
sanix.defaultModel |
string |
"anthropic:claude-sonnet-4" |
Default model in provider:model format. |
sanix.streamOutput |
boolean |
true |
Token-by-token streaming in the webview. |
sanix.maxInlineSelectionChars |
number |
8000 |
Max chars sent to inline edit (Cmd+K). Larger selections are truncated. |
sanix.autoApplyDiffs |
boolean |
true |
Auto-apply ```diff fenced blocks via WorkspaceEdit (single Ctrl+Z undo). |
sanix.showStatusBar |
boolean |
true |
Show the SANIX status bar item. |
sanix.theme |
enum |
"auto" |
Webview theme: auto (follow VS Code) / light / dark. |
sanix.costWarningThresholdUsd |
number |
5.0 |
Daily cost (USD) at which the status bar turns amber. |
sanix.costCriticalThresholdUsd |
number |
20.0 |
Daily cost (USD) at which the status bar turns red. |
sanix.intelligencePipeline |
boolean |
true |
Route /intel-prefixed messages through the V16 pipeline. |
sanix.enableVision |
boolean |
true |
Allow image input (drag-and-drop into the chat webview). |
Slash Commands
Type these in the chat input box:
| Command | Action |
|---|---|
/clear |
Clear all chat history (does not affect the SANIX CLI session store). |
/agent <name> <prompt> |
Run a named agent (e.g. /agent coder refactor this function). |
/session |
List all SANIX sessions. |
/session <id> |
Switch the active session. |
/cost |
Show today's running cost (USD + token breakdown). |
/model <provider:model> |
Override the model for the next message. |
/provider <name> |
Override the provider for the next message. |
/intel <task> |
Run the V16 10-step intelligence pipeline on the task. |
/help |
Show this list inside the chat. |
Inline Edit (Cmd+K)
- Select some text in any editor.
- Press Cmd+K (Mac) or Ctrl+K (Windows/Linux).
- Type an instruction (e.g. "rename
footobarand add error handling"). - Press Enter.
- The selection is replaced with the LLM's output. A single Cmd+Z undoes the edit.
Selections longer than sanix.maxInlineSelectionChars (default: 8000) are truncated with a /* …truncated… */ marker so you don't accidentally send a 50,000-line file to the model.
Diff Applier
When SANIX returns a message that contains a ```diff fenced block, the extension parses it and (if sanix.autoApplyDiffs is true) applies the changes immediately via a single vscode.WorkspaceEdit. A single Ctrl+Z undoes the entire change.
The parser:
- Reads the
+++ b/path/to/file.tsheader to determine the target file. - For each
@@ ... @@hunk, finds the removed-text block in the file viaString.indexOfand replaces it with the added-text block. - If the removed block isn't found (e.g. context drift), the added block is appended at EOF with a warning.
- New files (where
+++points to/dev/nullis NOT supported; we treat+++ /dev/nullas "skip") — actually no, we skip--- /dev/nullas the source.
Each chat message that contains a diff also gets an Apply Diff button so you can re-apply or apply after editing the response.
The two contributed theme colors sanix.diffAdded and sanix.diffRemoved can be customized in your settings.json:
"workbench.colorCustomizations": {
"sanix.diffAdded": "#81b71b",
"sanix.diffRemoved": "#e06c75"
}
Status Bar
A single status-bar item appears in the bottom-right corner (next to the language indicator). Its icon, color, and tooltip change based on the current state:
| State | Icon | Color | When |
|---|---|---|---|
idle |
$(sanix-idle) |
default | No active stream |
running |
$(loading~spin) |
default | A non-streaming command is in flight |
streaming |
$(pulse) |
green (added) | Token-by-token streaming is active |
cost-warning |
$(warning) |
amber | Today's cost ≥ sanix.costWarningThresholdUsd |
cost-critical |
$(error) |
red (error bg) | Today's cost ≥ sanix.costCriticalThresholdUsd |
error |
$(bug) |
red (error bg) | The last CLI invocation failed |
Click the item to open the chat sidebar. The tooltip shows the current state plus the active session id. The item also displays the day's running cost (USD) and the active session id when present.
Set sanix.showStatusBar to false to hide the item entirely.
V16 Intelligence Pipeline
The V16 intelligence pipeline is a 10-step, speed-first execution engine that powers the SANIX CLI's intelligence run command. It makes at most 2 LLM calls per task — one for generation, and zero or one for a verification fix if the first output fails the quality gate. Every local operation (pattern match, context index, error-pattern lookup, quality review) runs in under 100 ms.
The pipeline steps:
- Pattern match — 32 built-in solution patterns; if one matches the task, instantiate it (0 LLM calls).
- Plan — local
plan()returns aCotPlanwith steps + variable slots. - Context inject — BM25 + IDF over a 12-language symbol index; library docs cached at
~/.sanix/docs-cache/. - Examples — 56-example TF-IDF bank (local hashing; no Xenova/transformers dependency).
- Assemble — merge plan + context + examples into one comprehensive prompt, leaving
{{BODY:name}}placeholders. - Generate — LLM call #1. Fill the placeholders.
- Verify — run
tsc --noEmit+eslint --format json+ tests in parallel; collect errors. - Fix — LLM call #2 (only if step 7 found errors). Send only the error list + the failing output.
- Quality gate — 234-rule review (parallel) + 17-rule OWASP security scan + complexity check.
- Escalate — if the quality score is below 50, escalate via the 6-level chain: Ollama → Groq → DeepSeek → GPT-4o-mini → Sonnet → Opus.
To invoke the pipeline from the chat webview, prefix your message with /intel :
/intel Add a /health endpoint to this Express app with tests, docs, and a CI step
The extension will call sanix intelligence run and stream the final output into the chat.
Programmatic API
Other VS Code extensions can call SANIX via the exported API:
import * as vscode from "vscode";
const sanixExt = vscode.extensions.getExtension<{
ask(prompt: string, opts?: { model?: string; cwd?: string }): Promise<string>;
runAgent(agent: string, prompt: string, opts?: { cwd?: string }): Promise<string>;
runUltraWorker(goal: string, opts?: { cwd?: string }): Promise<string>;
vision(imagePath: string, prompt: string, opts?: { model?: string }): Promise<string>;
runIntelligencePipeline(task: string, opts?: { cwd?: string }): Promise<string>;
getCostToday(): Promise<number>;
getActiveSession(): Promise<SanixSession | null>;
switchSession(sessionId?: string): Promise<SanixSession | null>;
}>("istiak-ahamed.sanix");
const sanix = sanixExt?.exports;
if (sanix) {
const answer = await sanix.ask("What does this codebase do?");
const summary = await sanix.runAgent("reviewer", selectedCode);
const plan = await sanix.runIntelligencePipeline("Migrate this app to TypeScript");
const cost = await sanix.getCostToday();
}
The full SanixSession type is exported from @sanix/vscode/types. The API surface is intentionally small — anything not exposed here can be invoked by shelling out to the sanix CLI.
Keybindings
| Keybinding | Command | When |
|---|---|---|
Cmd/Ctrl+K |
sanix.inlineEdit |
editorTextFocus |
Cmd/Ctrl+Shift+S |
sanix.sendToChat |
editorHasSelection |
Cmd/Ctrl+Shift+Alt+S |
sanix.openChat |
always |
These are the defaults — you can rebind them in your keybindings.json (Cmd/Ctrl+Shift+P → Preferences: Open Keyboard Shortcuts).
Theme Colors
| Color ID | Light default | Dark default | Description |
|---|---|---|---|
sanix.diffAdded |
#587c0b |
#81b71b |
Color used for added lines in SANIX-applied diffs. |
sanix.diffRemoved |
#ad0707 |
#e06c75 |
Color used for removed lines in SANIX-applied diffs. |
Override them in settings.json:
"workbench.colorCustomizations": {
"sanix.diffAdded": "#50c878",
"sanix.diffRemoved": "#ff6b6b"
}
Troubleshooting
"SANIX: command not found"
The extension couldn't find the sanix CLI on PATH. Either install it (npm install -g @sanix/cli) or set sanix.cliPath to the absolute path of the binary (which sanix on Mac/Linux, where sanix on Windows).
Chat sidebar shows nothing
- Verify the CLI works:
sanix ask "hello"in your terminal. - Check the SANIX config:
sanix config— make sure a provider is configured. - Open the Output panel (
Cmd/Ctrl+Shift+U) and select the SANIX channel to see logs. - Reload the window (
Cmd/Ctrl+Shift+P→Developer: Reload Window).
Diffs aren't being applied
- Check that
sanix.autoApplyDiffsistrue. - Check that the LLM actually returned a
```diffblock (open the chat sidebar and look for the fenced code block). - Use the Apply Diff button on the message to apply manually.
Cost thresholds aren't triggering
The status-bar cost is polled every 5 minutes. If you want a faster update, run SANIX: Show Cost (Today) manually.
Inline edit (Cmd+K) doesn't replace the selection
Make sure you have an active selection (highlight some text first). The command is gated on editorTextFocus so it won't fire in terminal or output panels.
Contributing
SANIX is developed in the open at https://github.com/istiak-ahamed/sanix. PRs welcome!
- Clone the monorepo.
bun install(ornpm install).cd packages/vscode && npm install.- Press
F5in VS Code to launch an Extension Development Host with the extension loaded. - Make changes, reload the host to test.
- Run
npm run packageto produce a.vsixfor local testing before opening a PR.
See PUBLISHING.md for the full release process.
License
MIT © 2026 Istiak Ahamed. See LICENSE.