{"slug": "show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms", "title": "Show HN: Harny – AI coding agent for VSCodium/VS Code tuned for small/local LLMs", "summary": "A developer released Harny, an AI coding agent extension for VSCodium and VS Code that runs in the Activity Bar and connects to any model through the OpenAI Chat Completions API, including local models served by Ollama, LM Studio or llama.cpp. Harny adds a two-stage Analyze/Build workflow in which file-modifying tools run in dry-run and return exact diffs before anything is written, plus a Parallel mode that splits tasks into sub-agents and context compaction at turn boundaries for long sessions. The developer reports the agent's own test suite passing 2,988 tests across 133 files in 20.39 seconds, and states that session transcripts are stored in a central SQLite database outside the project so agent tools cannot read or corrupt them.", "body_md": "A full agent that lives in your Activity Bar. It reads your project, edits files,\nruns commands, searches the web and keeps one persistent conversation per folder — with tool calling\nand live streaming.\n\nBring your own model. Cloud, or a model on your laptop. One protocol: the\nOpenAI Chat Completions API.\n\nRetry-with-backoff in src/llm/http.ts, then run the suite.\n\nBuild · deepseek-v4.1-flash · 6.9k in · 74 out · ⚡ 6.1k ·\nelapsed 2.3s · first token 676ms\n\n▸ Thinking…\n\nNo retry on this path: a 429 or a 5xx goes straight back to the user. The loop has to\nstay on the client so the budget is ours, and it has to stop before the turn's deadline.\n\n▾Readsrc/llm/http.ts\n\nInput\n\n```\n{\n  \"path\": \"src/llm/http.ts\",\n  \"offset\": 42,\n  \"limit\": 9\n}\n```\n\nOutput\n\n``` js\n  async request(url: string, init: RequestInit) {\n    for (let attempt = 0; ; attempt++) {\n      const res = await fetch(url, init);\n      if (res.ok || !isRetryable(res.status)) return res;\n      await sleep(Math.min(2000, 250 * 2 ** attempt));\n    }\n```\n\n▸Shellnpm test\n\n```\nTest Files  133 passed (133)\n     Tests  2988 passed (2988)\n  Duration  20.39s\n```\n\nBuild · 257.4k in · 775 out · ⚡ 257.3k · elapsed 9.8s\n\nFocusCollapse allFollow\n\nInsert prompt in QUEUE\n\nAsk Harny… (Enter to send, Esc to abort)\n\nBuild⌄\nParallel\nAI Model:deepseek-v4.1-flash · 1M · out 32k⌄⚙\n\nTokens259.3k/ 616k/1M(42%)⚡ 259.2k(100%)Compact\n\nAuto 80% ctx · keep 10%⚙\n\nDEMO / ONE SESSION\n\nThe site you are reading, built by the agent.\n\n“Harny creates its own website” — the session that produced this page, recorded\nend to end.\n\nEvery design decision in Harny answers a failure mode of agents that write into your repo without\nasking. Here is what that buys you.\n\nTwo stages: preview, then apply\n\nIn Analyze, every file-modifying tool runs in dry-run — it returns the\nexact diff and writes nothing. You see what would change before anything is touched. Switch to\nBuild when you are happy.\n\nsafetydiffs\n\nBring your own model\n\nOpenAI, Anthropic, OpenRouter, or a model on your own machine with Ollama, LM Studio or llama.cpp.\nOne dropdown, per session.\n\nReal parallelism\n\nTurn on Parallel and the agent becomes an orchestrator: it splits the task into\nindependent sub-tasks and runs them as sub-agents — each with its own stream and its own stop button.\n\nYou are never locked out\n\nKeep typing while it works. Enter queues, ⌘/Ctrl+↵ steers\nmid-flight. Esc stops everything.\n\nLong sessions keep working\n\nWhen the context fills, Harny compacts at turn boundaries, keeps the recent part verbatim and\ncarries the state of the work forward.\n\nNothing is hidden\n\nEvery turn shows real token usage and timings. Every tool call shows its input, its output and its\ndiff. Reasoning streams as it happens. Focus opens every section as the agent\nenters it and leaves it open — the run stays readable top to bottom, and you can steer the\nmoment something looks wrong. Collapse all is the one word for the opposite.\n\nYour history lives outside your project\n\nSessions are stored in a central SQLite database — not in your repo. Agent tools can never read or\ncorrupt transcripts, and cleaning your project never deletes your chat history.\n\n02 / ANALYZE & BUILD\n\nLook before you leap.\n\nA run is born with its mode and keeps it to its last tool result. The pills explain why instead of\nswallowing the click — Stop is the way to interrupt.\n\nNew sessions start in Analyze — your first run is a preview, not a surprise.\n\nOnly the write is withheld: reads, greps and searches still run.\n\nWhen previews are ready, the host asks once whether to switch to Build.\n\nMode and Parallel are locked while a run is going.\n\nAnalyzeBuild\n\nHARNY\n?+⚙\n\n▸Sessions?+⚙\n\nHarny Dev ×\n\nHow does the retry guard look today?\n\nAnalyze · deepseek-v4.1-flash · 4.1k in · 26 out · elapsed 1.1s\n\n▸Readsrc/llm/http.ts\n\n```\n  if (res.ok) return res;\n  throw new Error(`HTTP ${res.status}`)\n```\n\nAdd retry-with-backoff to src/llm/retry.ts.\n\nAnalyze · deepseek-v4.1-flash · 6.2k in · 41 out ·\nelapsed 1.4s\n\n▾Writesrc/llm/retry.ts+24−0\n\nInput\n\n``` js\n{\n  \"path\": \"src/llm/retry.ts\",\n  \"content\": \"export const isRetryable = …\"\n}\n```\n\nDiff\n\n```\n@@ -0,0 +1,22 @@\n```\n\nAnalyze · nothing written — 1 file awaits Build\n\nFocusCollapse allFollow\n\nInsert prompt in QUEUE\n\nAsk Harny… (Enter to send, Esc to abort)\n\nAnalyze⌄\nParallel\nAI Model:deepseek-v4.1-flash · 1M · out 32k⌄⚙\n\nTokens6.2k/ 616k/1M (1%)Compact\n\nAuto 80% ctx · keep 10%⚙\n\nSwitch to Build?\n\nChanges were prepared as previews — nothing has been written to disk yet.\nSwitch to Build to apply them.\nTip: restart the chat — a clean Build context applies more reliably than continuing this Analyze transcript.\n\nCancelSwitch to Build\n\n03 / PARALLEL\n\nOne orchestrator. Many hands.\n\nDisjoint files run in parallel. Overlapping writers — or a writer and a reader of the same resource — are\nserialized automatically, because every Delegate declares its resources honestly.\n\nORCHESTRATORDelegate ×3depth cap 1 · concurrency capped\n\nagent · testsstreaming\n\nWrite vitest coverage for src/sessions/compactor.ts\n\nReadWriteShell\n\nagent · docsstreaming\n\nUpdate README.md compaction section + table\n\nReadEdit\n\nagent · typesqueued\n\nFix tsconfig strict errors in src/core/llm\n\nReadEditShell\n\nStop aborts the whole run. ⏹ stops one bubble — running or queued behind the cap.\n\nA stopped sub-agent reports aborted, so the orchestrator never treats it as done.\n\nSub-agents inherit the loop guard, the tool budget and the skills catalog.\n\nWATCH / PARALLEL RUN\n\nThe diagram above, running for real: one orchestrator, three delegates, overlapping files\nserialized on the fly.\n\nThe context window is visible in the transcript: a divider marks where the context begins, and the\ncheckpoint is one card with its summary attached.\n\nCONTEXT FILL82%\n\n✦ checkpoint\n\nsummary in windowkept verbatimusable headroom\n\nTurn boundaries\n\nThe cut falls between complete turns — your input → the final answer, everything in between — and\ninside one only when that turn alone exceeds the budget.\n\nLand at 10%\n\nThe trigger defaults to 80% of the usable context; the most recent share stays verbatim.\nTwo independent knobs, one honest preview of the plan.\n\nState carried forward\n\nA later compaction updates the previous summary instead of summarizing a summary — a fact is\nnot lost per generation.\n\nMasked, never rewritten\n\nOld tool outputs go as one-line stubs that name the tool. The transcript, the store and any branch\nkeep everything.\n\nRejection is data\n\nA context-length error triggers one compaction and a retry — and the limit the provider states is\nadopted as the session window.\n\nWire rules first\n\nEight rules are checked before the wire. A violation is refused by name, instead of poisoning\nevery later request.\n\nYOU\nAdd a retry helper and wire it into the HTTP client.\n\n✦ CHECKPOINT\n\nDone:withRetry() in src/llm/retry.ts, exported.\n\nOpen: call sites — http.ts:42, models.ts:88.\n\nNext: run npm test, expect 2 failures.\n\nFacts: cap 2000ms; retry on 429 and 5xx.\n\n18 messages above · kept in the session, out of the context window\n\nEVIDENCE / TWO BILLING PERIODS\n\nTwo months of the same subscription, the same model, the same kind of work. The one thing\nthat changed is how much context rides on every request.\n\nBefore95%used · forecast 116% — the limit arrives before the cycle endsAfter44%used · forecast 94% — the same month lands under the limit\n\nNot a cheaper model. Both periods are ~100% DeepSeek V4.1 Flash: the tokens\nwent down, the model did not.\n\nA window that stops compounding. Every turn re-sends the whole context, so the same\n100k costs the same tokens on turn one and on turn forty. A summary in the window — instead\nof the turns it absorbed — plus old tool output masked to one-line stubs is what makes the\nnext request smaller rather than bigger.\n\nThe advice is the mechanism. Pasted logs, whole files and re-reads are what fill a\nwindow; the checkpoint keeps the facts, and the cycle closes at 94% instead of\novershooting at 116%.\n\nWATCH / CONTEXT COMPACTION\n\nThe meter above, filling up for real: the cut between complete turns, the checkpoint card, the\nwindow moving on.\n\nEvery tool is a class in its own file behind a small interface. Adding one is registering it — the agent\nand the providers never change. MCP servers arrive as mcp__<server>__<tool>.\n\nHarny tells you what it is about to do, then does it in front of you. The answer, the tools and\nthe controls share one column, top to bottom: nothing floats over the lines you are reading,\nand the panel never jumps under your hand.\n\nBuild · 73.1k in · 29 out · elapsed 8.7s · first token 812ms\n\nThe retry is in and the parser takes it now. Running the suite, then the changelog entry.\n\n● Working...\n\nFocusCollapse allFollow\n\nFollow only exists while Harny is working. When nothing is running it is off and dark:\nnothing is arriving, so there is nothing to follow. During a run, on, it keeps the newest\nline in view; off, it stays where you left it and never pulls you back. The only thing that\ncan hold it is your finger on the conversation — let go, and it comes home. One switch, one\nbehaviour, no surprise jumps.\n\nFocus opens sections — it never closes them. The section Harny walks into opens on its\nown and stays open: nothing shuts under your cursor, and turning Focus on folds nothing away.\nTo close the lot there is one word, Collapse all.\n\n07 / THE GUARD\n\nIt never just stops. It steers.\n\nSmall and local models fail in three shapes: reasoning that chases its own tail, the same tool call\nretried verbatim, an answer that repeats itself. The guard cuts the stream and injects a\nNudge — a correction aimed at the loop, so the model gets out of it\ninstead of being shut down.\n\nThinking · repetition 0.83 · cut mid-stream\nLet me check the config file. I need to check the config file first. The config file is what I need to\ncheck, so let me check the config file. I should check the config file…\n\n✦ Nudge — typed into the transcript, then sent back\nYour reasoning is LOOPING: the same content is repeating over and over without progress.\nSTOP reasoning now. Either call the next tool, or write your final answer to the user.\n\nNext turnReadharny.json — a different action, and the run continues\n\nthe second nudge is the last · a loop that survives both is stopped, and the transcript names it\n\nDedup, not just detection. An identical failing call is refused instead of re-run and its\nprevious result comes back; the same call retried with identical arguments points the model at\nGlob, Grep and Read — the classic Shell loop ends there.\n\nBoth readings of a loop are caught: back-to-back (A/A/A) and alternating (A/B/A/B, the sub-agent\nweb loop), because a rolling window counts occurrences, not just neighbours.\n\nThe answer can be guarded too — opt-in, with its own threshold, so a final reply that starts\nrepeating is cut short instead of paid for to the end.\n\nSub-agents inherit the guard of their session, with the same options read at each run: a flaky\nmodel is flaky in every bubble.\n\n08 / MCP\n\nInstall once. Scope per conversation.\n\nA server is a fact about the machine; which of its tools a conversation may use is that conversation's\ndecision. Every tool arrives as mcp__<server>__<tool> — and none of them runs in\nAnalyze unless you say so.\n\nA server, not an extension\n\nstdio — command, arguments, environment — or http — url, headers. Added from\nthe panel or straight into config.json, listed with its status, reconnected after a crash,\nand switched off without being deleted.\n\nSwitched on per session\n\nA new conversation starts with every MCP server off. Switch on the one this task needs, and\nswitch off single tools — of a server or a built-in — without touching the conversation next door.\n\nper sessionno recompile\n\nAnalyze is denied by default\n\nRead-only in Analyze is an include list, not an exclusion: only the tools you declare can run\nthere. A tool the server adds tomorrow is not silently allowed to write during a preview — and the\ndeclaration is per session, like everything else.\n\nanalyzeToolsread-only\n\n```\n// config.json — install is machine-level, the scope is per session\n{\n  \"mcpServers\": {\n    \"files\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@modelcontextprotocol/server-filesystem\", \".\"],\n      // ⟵ the ONLY tools of this server allowed in Analyze\n      \"analyzeTools\": [\"read_file\", \"list_directory\"]\n    }\n  }\n}\n```\n\n09 / SKILLS\n\nA catalog, not a prompt. Read on demand.\n\nA skill is a folder with a SKILL.md, in .agents/skills,\n.claude/skills or .pi/skills — project or user level. The system prompt carries\nonly its name and description; the body is read when the skill is activated, and not before.\n\n/prompt — the menu opens on the first character\n\n/skill pdfFill and read PDF forms\n\n/skill code-reviewReview a diff against our rules\n\n/skillsList what is installed\n\n↑↓ move · ↵ insert · Esc close\n\nCalled by name, at the start of the prompt./skill <name> <task> injects\nthat skill's instructions ahead of your task — the model's own activation decision is bypassed,\nso “do it this way” is an instruction, not a hope.\n\nOr the model picks it up alone: the catalog in the system prompt is enough to notice that a\nskill matches the task, and the body is loaded only then. That is what keeps fifty skills from costing\nfifty prompts.\n\n/skills lists what is installed, with the description it was installed with.\nA skill with disable-model-invocation is manual only: the model never reaches for it.\n\nSub-agents inherit the catalog, so delegated work can activate a skill too — and the\norchestrator can point a sub-task at one by name.\n\n10 / ONE PROTOCOL\n\nSpeak one protocol. Talk to anything.\n\nHarny is openai-compatible by design, so anything that implements /v1/chat/completions works.\nModel lists can be declared by hand or discovered from the server — including each model's real context\nwindow.\n\nHARNYAgent looptools · streaming · compaction\n\nPOST /v1/chat/completions\n\nOpenAIreasoning_effort\n\nAnthropicOpenAI-compatible endpoint\n\nOpenRouterreasoning · enabled\n\nOllamalocal · no key\n\nLM Studiolocal server\n\nllama.cpp / MLXjinja · enable_thinking\n\nOpenCode Gothinking · on / off\n\nAnything elseany host speaking the protocol\n\nSwitch models from one dropdown, per session. Keys live in Harny's own data folder — never in your\nproject.\n\n11 / UNDER THE HOOD\n\nSOLID first. Testable to the core.\n\nThe core layer has zero VS Code imports — every collaborator is created in the composition\nroot and injected through constructors. Which is why the suite has 3000+ unit tests.\n\n```\n# composition root\nsrc/\n├─ extension.ts          # wires every dependency\n├─ core/                 # VS Code-free domain layer\n│  ├─ config/  events/  history/\n│  ├─ llm/     # provider, SSE, context-overflow\n│  ├─ agent/   # loop, LoopGuard, orchestration\n│  ├─ sessions/# sqlite + FTS5, Compactor\n│  ├─ skills/  mcp/    storage/\n│  └─ tools/   # 13 tools, one file each\n├─ chat/                 # webview provider + client\n└─ logger.ts\ntests/                    # vitest, guards, mutation matrices\n```\n\n3000+unit tests\n\n8wire rules checked pre-flight\n\n12mutation matrices\n\nVersioned schema, migrations on open (PRAGMA user_version).\n\nAtomic turn groups — a malformed conversation never reaches the provider.\n\nIt sits in the Activity Bar. Sessions are per workspace.\n\n02\n\nOpen exactly one folder\n\nOr let the panel do it: with no folder open it lists every workspace's sessions.\n\n03\n\nAdd a provider\n\nThe gear at the right end of the AI Model row → + New → paste your key → Test connection.\n\n04\n\nType a request, press Enter\n\nNew sessions start in Analyze, so your first run is a preview, not a surprise.\n\nVS Code extension API 1.101+VSCodium 1.101+Node 22.5+ for node:sqliteLicense MIT\n\nSTEP 03 / THREE REAL SETUPS\n\nThe same dialog, three very different hosts.\n\nA local llama.cpp server with no key, an OpenCode Go gateway that wants a session header,\nOpenRouter with its own reasoning switch. One form every time: name, base URL, optional key,\nand how to ask that host for reasoning.\n\nProviders & ModelsEvery provider is active: pick a model from the chat's model dropdown.\n\nProviders+ New\n\nlocal llama-cppopencode-goopenrouter\n\nNamelocal llama-cpp\n\nBase URLhttp://localhost:8090/v1\n\nAPI Key (optional — leave empty for local hosts)•••••••\n\nReasoningUnspecified (provider default)\n\nSession header (optional)e.g. x-opencode-session\n\nTest connectionDelete\n\nCancelSave\n\nLOCALllama.cpp / MLX\n\nhttp://localhost:8090/v1 — the key stays empty: the model runs on this machine,\nso nothing leaves it.\n\nProviders & ModelsEvery provider is active: pick a model from the chat's model dropdown.\n\nProviders+ New\n\nlocal llama-cppopencode-goopenrouter\n\nNameopencode-go\n\nBase URLhttps://opencode.ai/zen/go/v1\n\nAPI Key (optional — leave empty for local hosts)•••••••••••••••••••••••••••••••••••••\n\nReasoningType (DeepSeek / Anthropic toggle)\n\nSession header (optional)x-opencode-session\n\nTest connectionDelete\n\nCancelSave\n\nGATEWAYOpenCode Go\n\nhttps://opencode.ai/zen/go/v1 — reasoning as a type (on / off), and a session\nheader so routing and the prompt cache survive the turn.\n\nProviders & ModelsEvery provider is active: pick a model from the chat's model dropdown.\n\nProviders+ New\n\nlocal llama-cppopencode-goopenrouter\n\nNameopenrouter\n\nBase URLhttps://openrouter.ai/api/v1\n\nAPI Key (optional — leave empty for local hosts)••••••••••••••••••••••••••••••••••••••••••••••••••••••••••\n\nReasoningReasoning (OpenRouter)\n\nSession header (optional)e.g. x-opencode-session\n\nTest connectionDelete\n\nCancelSave\n\nAGGREGATOROpenRouter\n\nhttps://openrouter.ai/api/v1 — its own reasoning object, passed through\nas declared: one provider, every model behind it.\n\nKeys sit in Harny's data folder, never in the project. Export models configuration writes the\nwhole set to one JSON file — key included — and Import merges it back on another machine.", "url": "https://wpnews.pro/news/show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms", "canonical_source": "https://harny.dev/", "published_at": "2026-11-24 08:26:49+00:00", "updated_at": "2026-11-24 08:42:22.375022+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "large-language-models", "ai-products"], "entities": ["Harny", "VSCodium", "VS Code", "OpenAI Chat Completions API", "Ollama", "LM Studio", "llama.cpp", "deepseek-v4.1-flash"], "also_reported_by": [], "takeaway": "Harny runs every file-modifying tool in a dry-run Analyze mode that returns the exact diff without writing, and only applies changes after the user switches to Build.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms", "markdown": "https://wpnews.pro/news/show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms.md", "text": "https://wpnews.pro/news/show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms.txt", "jsonld": "https://wpnews.pro/news/show-hn-harny-ai-coding-agent-for-vscodium-vs-code-tuned-for-small-local-llms.jsonld"}}