A full agent that lives in your Activity Bar. It reads your project, edits files, runs commands, searches the web and keeps one persistent conversation per folder — with tool calling and live streaming.
Bring your own model. Cloud, or a model on your laptop. One protocol: the OpenAI Chat Completions API.
Retry-with-backoff in src/llm/http.ts, then run the suite.
Build · deepseek-v4.1-flash · 6.9k in · 74 out · ⚡ 6.1k · elapsed 2.3s · first token 676ms
▸ Thinking…
No retry on this path: a 429 or a 5xx goes straight back to the user. The loop has to stay on the client so the budget is ours, and it has to stop before the turn's deadline.
▾Readsrc/llm/http.ts
Input
{
"path": "src/llm/http.ts",
"offset": 42,
"limit": 9
}
Output
async request(url: string, init: RequestInit) {
for (let attempt = 0; ; attempt++) {
const res = await fetch(url, init);
if (res.ok || !isRetryable(res.status)) return res;
await sleep(Math.min(2000, 250 * 2 ** attempt));
}
▸Shellnpm test
Test Files 133 passed (133)
Tests 2988 passed (2988)
Duration 20.39s
Build · 257.4k in · 775 out · ⚡ 257.3k · elapsed 9.8s
FocusCollapse allFollow
Insert prompt in QUEUE
Ask Harny… (Enter to send, Esc to abort)
Build⌄ Parallel AI Model:deepseek-v4.1-flash · 1M · out 32k⌄⚙
Tokens259.3k/ 616k/1M(42%)⚡ 259.2k(100%)Compact
Auto 80% ctx · keep 10%⚙
DEMO / ONE SESSION
The site you are reading, built by the agent.
“Harny creates its own website” — the session that produced this page, recorded end to end.
Every design decision in Harny answers a failure mode of agents that write into your repo without asking. Here is what that buys you.
Two stages: preview, then apply
In Analyze, every file-modifying tool runs in dry-run — it returns the exact diff and writes nothing. You see what would change before anything is touched. Switch to Build when you are happy.
safetydiffs
Bring your own model
OpenAI, Anthropic, OpenRouter, or a model on your own machine with Ollama, LM Studio or llama.cpp. One dropdown, per session.
Real parallelism
Turn on Parallel and the agent becomes an orchestrator: it splits the task into independent sub-tasks and runs them as sub-agents — each with its own stream and its own stop button.
You are never locked out
Keep typing while it works. Enter queues, ⌘/Ctrl+↵ steers mid-flight. Esc stops everything.
Long sessions keep working
When the context fills, Harny compacts at turn boundaries, keeps the recent part verbatim and carries the state of the work forward.
Nothing is hidden
Every turn shows real token usage and timings. Every tool call shows its input, its output and its diff. Reasoning streams as it happens. Focus opens every section as the agent enters it and leaves it open — the run stays readable top to bottom, and you can steer the moment something looks wrong. Collapse all is the one word for the opposite.
Your history lives outside your project
Sessions are stored in a central SQLite database — not in your repo. Agent tools can never read or corrupt transcripts, and cleaning your project never deletes your chat history.
02 / ANALYZE & BUILD
Look before you leap.
A run is born with its mode and keeps it to its last tool result. The pills explain why instead of swallowing the click — Stop is the way to interrupt.
New sessions start in Analyze — your first run is a preview, not a surprise.
Only the write is withheld: reads, greps and searches still run.
When previews are ready, the host asks once whether to switch to Build.
Mode and Parallel are locked while a run is going.
AnalyzeBuild
HARNY ?+⚙
▸Sessions?+⚙
Harny Dev ×
How does the retry guard look today?
Analyze · deepseek-v4.1-flash · 4.1k in · 26 out · elapsed 1.1s
▸Readsrc/llm/http.ts
if (res.ok) return res;
throw new Error(`HTTP ${res.status}`)
Add retry-with-backoff to src/llm/retry.ts.
Analyze · deepseek-v4.1-flash · 6.2k in · 41 out · elapsed 1.4s
▾Writesrc/llm/retry.ts+24−0
Input
{
"path": "src/llm/retry.ts",
"content": "export const isRetryable = …"
}
Diff
@@ -0,0 +1,22 @@
Analyze · nothing written — 1 file awaits Build
FocusCollapse allFollow
Insert prompt in QUEUE
Ask Harny… (Enter to send, Esc to abort)
Analyze⌄ Parallel AI Model:deepseek-v4.1-flash · 1M · out 32k⌄⚙
Tokens6.2k/ 616k/1M (1%)Compact
Auto 80% ctx · keep 10%⚙
Switch to Build?
Changes were prepared as previews — nothing has been written to disk yet. Switch to Build to apply them. Tip: restart the chat — a clean Build context applies more reliably than continuing this Analyze transcript.
CancelSwitch to Build
03 / PARALLEL
One orchestrator. Many hands.
Disjoint files run in parallel. Overlapping writers — or a writer and a reader of the same resource — are serialized automatically, because every Delegate declares its resources honestly.
ORCHESTRATORDelegate ×3depth cap 1 · concurrency capped
agent · testsstreaming
Write vitest coverage for src/sessions/compactor.ts
ReadWriteShell
agent · docsstreaming
Update README.md compaction section + table
ReadEdit
agent · typesqueued
Fix tsconfig strict errors in src/core/llm
ReadEditShell
Stop aborts the whole run. ⏹ stops one bubble — running or queued behind the cap.
A stopped sub-agent reports aborted, so the orchestrator never treats it as done.
Sub-agents inherit the loop guard, the tool budget and the skills catalog.
WATCH / PARALLEL RUN
The diagram above, running for real: one orchestrator, three delegates, overlapping files serialized on the fly.
The context window is visible in the transcript: a divider marks where the context begins, and the checkpoint is one card with its summary attached.
CONTEXT FILL82%
✦ checkpoint
summary in windowkept verbatimusable headroom
Turn boundaries
The cut falls between complete turns — your input → the final answer, everything in between — and inside one only when that turn alone exceeds the budget.
Land at 10%
The trigger defaults to 80% of the usable context; the most recent share stays verbatim. Two independent knobs, one honest preview of the plan.
State carried forward
A later compaction updates the previous summary instead of summarizing a summary — a fact is not lost per generation.
Masked, never rewritten
Old tool outputs go as one-line stubs that name the tool. The transcript, the store and any branch keep everything.
Rejection is data
A context-length error triggers one compaction and a retry — and the limit the provider states is adopted as the session window.
Wire rules first
Eight rules are checked before the wire. A violation is refused by name, instead of poisoning every later request.
YOU Add a retry helper and wire it into the HTTP client.
✦ CHECKPOINT
Done:withRetry() in src/llm/retry.ts, exported.
Open: call sites — http.ts:42, models.ts:88.
Next: run npm test, expect 2 failures.
Facts: cap 2000ms; retry on 429 and 5xx.
18 messages above · kept in the session, out of the context window
EVIDENCE / TWO BILLING PERIODS
Two months of the same subscription, the same model, the same kind of work. The one thing that changed is how much context rides on every request.
Before95%used · forecast 116% — the limit arrives before the cycle endsAfter44%used · forecast 94% — the same month lands under the limit
Not a cheaper model. Both periods are ~100% DeepSeek V4.1 Flash: the tokens went down, the model did not.
A window that stops compounding. Every turn re-sends the whole context, so the same 100k costs the same tokens on turn one and on turn forty. A summary in the window — instead of the turns it absorbed — plus old tool output masked to one-line stubs is what makes the next request smaller rather than bigger.
The advice is the mechanism. Pasted logs, whole files and re-reads are what fill a window; the checkpoint keeps the facts, and the cycle closes at 94% instead of overshooting at 116%.
WATCH / CONTEXT COMPACTION
The meter above, filling up for real: the cut between complete turns, the checkpoint card, the window moving on.
Every tool is a class in its own file behind a small interface. Adding one is registering it — the agent and the providers never change. MCP servers arrive as mcp__<server>__<tool>.
Harny tells you what it is about to do, then does it in front of you. The answer, the tools and the controls share one column, top to bottom: nothing floats over the lines you are reading, and the panel never jumps under your hand.
Build · 73.1k in · 29 out · elapsed 8.7s · first token 812ms
The retry is in and the parser takes it now. Running the suite, then the changelog entry.
● Working...
FocusCollapse allFollow
Follow only exists while Harny is working. When nothing is running it is off and dark: nothing is arriving, so there is nothing to follow. During a run, on, it keeps the newest line in view; off, it stays where you left it and never pulls you back. The only thing that can hold it is your finger on the conversation — let go, and it comes home. One switch, one behaviour, no surprise jumps.
Focus opens sections — it never closes them. The section Harny walks into opens on its own and stays open: nothing shuts under your cursor, and turning Focus on folds nothing away. To close the lot there is one word, Collapse all.
07 / THE GUARD
It never just stops. It steers.
Small and local models fail in three shapes: reasoning that chases its own tail, the same tool call retried verbatim, an answer that repeats itself. The guard cuts the stream and injects a Nudge — a correction aimed at the loop, so the model gets out of it instead of being shut down.
Thinking · repetition 0.83 · cut mid-stream Let me check the config file. I need to check the config file first. The config file is what I need to check, so let me check the config file. I should check the config file…
✦ Nudge — typed into the transcript, then sent back Your reasoning is LOOPING: the same content is repeating over and over without progress. STOP reasoning now. Either call the next tool, or write your final answer to the user.
Next turnReadharny.json — a different action, and the run continues
the second nudge is the last · a loop that survives both is stopped, and the transcript names it
Dedup, not just detection. An identical failing call is refused instead of re-run and its previous result comes back; the same call retried with identical arguments points the model at Glob, Grep and Read — the classic Shell loop ends there.
Both readings of a loop are caught: back-to-back (A/A/A) and alternating (A/B/A/B, the sub-agent web loop), because a rolling window counts occurrences, not just neighbours.
The answer can be guarded too — opt-in, with its own threshold, so a final reply that starts repeating is cut short instead of paid for to the end.
Sub-agents inherit the guard of their session, with the same options read at each run: a flaky model is flaky in every bubble.
08 / MCP
Install once. Scope per conversation.
A server is a fact about the machine; which of its tools a conversation may use is that conversation's decision. Every tool arrives as mcp__<server>__<tool> — and none of them runs in Analyze unless you say so.
A server, not an extension
stdio — command, arguments, environment — or http — url, headers. Added from the panel or straight into config.json, listed with its status, reconnected after a crash, and switched off without being deleted.
Switched on per session
A new conversation starts with every MCP server off. Switch on the one this task needs, and switch off single tools — of a server or a built-in — without touching the conversation next door.
per sessionno recompile
Analyze is denied by default
Read-only in Analyze is an include list, not an exclusion: only the tools you declare can run there. A tool the server adds tomorrow is not silently allowed to write during a preview — and the declaration is per session, like everything else.
analyzeToolsread-only
// config.json — install is machine-level, the scope is per session
{
"mcpServers": {
"files": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."],
// ⟵ the ONLY tools of this server allowed in Analyze
"analyzeTools": ["read_file", "list_directory"]
}
}
}
09 / SKILLS
A catalog, not a prompt. Read on demand.
A skill is a folder with a SKILL.md, in .agents/skills, .claude/skills or .pi/skills — project or user level. The system prompt carries only its name and description; the body is read when the skill is activated, and not before.
/prompt — the menu opens on the first character
/skill pdfFill and read PDF forms
/skill code-reviewReview a diff against our rules
/skillsList what is installed
↑↓ move · ↵ insert · Esc close
Called by name, at the start of the prompt./skill <name> <task> injects that skill's instructions ahead of your task — the model's own activation decision is bypassed, so “do it this way” is an instruction, not a hope.
Or the model picks it up alone: the catalog in the system prompt is enough to notice that a skill matches the task, and the body is loaded only then. That is what keeps fifty skills from costing fifty prompts.
/skills lists what is installed, with the description it was installed with. A skill with disable-model-invocation is manual only: the model never reaches for it.
Sub-agents inherit the catalog, so delegated work can activate a skill too — and the orchestrator can point a sub-task at one by name.
10 / ONE PROTOCOL
Speak one protocol. Talk to anything.
Harny is openai-compatible by design, so anything that implements /v1/chat/completions works. Model lists can be declared by hand or discovered from the server — including each model's real context window.
HARNYAgent looptools · streaming · compaction
POST /v1/chat/completions
OpenAIreasoning_effort
AnthropicOpenAI-compatible endpoint
OpenRouterreasoning · enabled
Ollamalocal · no key
LM Studiolocal server
llama.cpp / MLXjinja · enable_thinking
OpenCode Gothinking · on / off
Anything elseany host speaking the protocol
Switch models from one dropdown, per session. Keys live in Harny's own data folder — never in your project.
11 / UNDER THE HOOD
SOLID first. Testable to the core.
The core layer has zero VS Code imports — every collaborator is created in the composition root and injected through constructors. Which is why the suite has 3000+ unit tests.
src/
├─ extension.ts # wires every dependency
├─ core/ # VS Code-free domain layer
│ ├─ config/ events/ history/
│ ├─ llm/ # provider, SSE, context-overflow
│ ├─ agent/ # loop, LoopGuard, orchestration
│ ├─ sessions/# sqlite + FTS5, Compactor
│ ├─ skills/ mcp/ storage/
│ └─ tools/ # 13 tools, one file each
├─ chat/ # webview provider + client
└─ logger.ts
tests/ # vitest, guards, mutation matrices
3000+unit tests
8wire rules checked pre-flight
12mutation matrices
Versioned schema, migrations on open (PRAGMA user_version).
Atomic turn groups — a malformed conversation never reaches the provider.
It sits in the Activity Bar. Sessions are per workspace.
02
Open exactly one folder
Or let the panel do it: with no folder open it lists every workspace's sessions.
03
Add a provider
The gear at the right end of the AI Model row → + New → paste your key → Test connection.
04
Type a request, press Enter
New sessions start in Analyze, so your first run is a preview, not a surprise.
VS Code extension API 1.101+VSCodium 1.101+Node 22.5+ for node:sqliteLicense MIT
STEP 03 / THREE REAL SETUPS
The same dialog, three very different hosts.
A local llama.cpp server with no key, an OpenCode Go gateway that wants a session header, OpenRouter with its own reasoning switch. One form every time: name, base URL, optional key, and how to ask that host for reasoning.
Providers & ModelsEvery provider is active: pick a model from the chat's model dropdown.
Providers+ New
local llama-cppopencode-goopenrouter
Namelocal llama-cpp
Base URLhttp://localhost:8090/v1
API Key (optional — leave empty for local hosts)•••••••
ReasoningUnspecified (provider default)
Session header (optional)e.g. x-opencode-session
Test connectionDelete
CancelSave
LOCALllama.cpp / MLX
http://localhost:8090/v1 — the key stays empty: the model runs on this machine, so nothing leaves it.
Providers & ModelsEvery provider is active: pick a model from the chat's model dropdown.
Providers+ New
local llama-cppopencode-goopenrouter
Nameopencode-go
Base URLhttps://opencode.ai/zen/go/v1
API Key (optional — leave empty for local hosts)•••••••••••••••••••••••••••••••••••••
ReasoningType (DeepSeek / Anthropic toggle)
Session header (optional)x-opencode-session
Test connectionDelete
CancelSave
GATEWAYOpenCode Go
https://opencode.ai/zen/go/v1 — reasoning as a type (on / off), and a session header so routing and the prompt cache survive the turn.
Providers & ModelsEvery provider is active: pick a model from the chat's model dropdown.
Providers+ New
local llama-cppopencode-goopenrouter
Nameopenrouter
Base URLhttps://openrouter.ai/api/v1
API Key (optional — leave empty for local hosts)••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
ReasoningReasoning (OpenRouter)
Session header (optional)e.g. x-opencode-session
Test connectionDelete
CancelSave
AGGREGATOROpenRouter
https://openrouter.ai/api/v1 — its own reasoning object, passed through as declared: one provider, every model behind it.
Keys sit in Harny's data folder, never in the project. Export models configuration writes the whole set to one JSON file — key included — and Import merges it back on another machine.