# Atlas for Bun: Terminal-Native AI Coding in 2026

> Atlas reads Bun-native APIs such as Bun.serve, Bun.file, and bun:sqlite, replaces a Node compatibility shim with the native Bun API, and confirms the behavior with bun test.

Atlas is a terminal-native AI coding agent that pairs with Bun, where the runtime, bundler, package manager, and test runner are one binary and iteration is nearly instant. Run atlas in a project with a bun.lock and a package.json, and Atlas reads your Bun-native APIs such as Bun.serve, Bun.file, and bun:sqlite along with the scripts in package.json. Atlas computes a unified diff for every file edit and surfaces it for approval before writing, so replacing a Node compatibility shim with the native Bun API is a change you read first.

## Why Bun developers use Atlas

Bun developers use Atlas because Bun's speed changes what an agent can do. bun test takes almost no time, so in 2026 Atlas can iterate on a real failure instead of proposing one large speculative change, and it reads your Bun-native APIs (Bun.serve, Bun.file, bun:sqlite) and the scripts in package.json first.

An agent's usefulness is bounded by how fast it can check itself. In ecosystems where the test suite takes four minutes to start, an agent guesses. With Bun, the runtime, bundler, package manager, and test runner are one binary, so the edit, run, and read-the-failure loop is tight enough that Atlas converges by iteration. Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion, so a question like where do we still use a Node shim returns the actual import sites rather than every file that mentions node.

## Replacing Node compatibility shims with native Bun APIs

Ask Atlas to replace a Node compatibility shim with the native Bun API and confirm behavior with a test. Most Bun projects carry 3 kinds of leftover from a Node port: an http server that should be Bun.serve, a fs read that should be Bun.file, and a driver that bun:sqlite already covers.

Bun runs Node code, which is why the shims survive. A project ships, the Node-shaped modules keep working, and nobody revisits them. The native equivalents are usually shorter and closer to the runtime: Bun.serve for the HTTP entry point, Bun.file for reads, bun:sqlite for local storage. Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so it finds those import sites by declaration and rewrites the call sites together. Atlas drafts a plan in a read-only plan agent and asks before switching to a build agent, so you see the full list of shims before one line changes.

## Iterating fast with bun test

Atlas runs bun test behind a permission prompt, which takes almost no time and lets it iterate quickly on a failure. Bun packs 4 tools into one binary, the runtime, bundler, package manager, and test runner, so Atlas can edit, run bun test, read the failing assertion, and correct itself before you finish the first diff.

Fast tests change agent behavior for the better. Rather than writing a large change and hoping, Atlas can make a small edit, run bun test, and use the actual failure output as its next input. The permission prompt still applies, so bun test runs only because you allowed it, and Atlas fans out work to subagents that can run in the foreground or in parallel background sessions when several packages in a workspace need the same shim removed. Every edit that survives the loop still arrives as a unified diff for approval.

## Working in a Bun project day to day

Working in Bun day to day with Atlas means 2 files carry the project: package.json and bun.lock. Atlas reads the scripts in package.json alongside your bun.lock, so a request like add a route to the server lands in the Bun.serve fetch handler you already have rather than a Node http server it invented.

Bun projects tend to be lean: a package.json with a handful of scripts, a bun.lock, and code that leans on the runtime instead of a dependency for each primitive. Atlas reading those scripts is what keeps its shell commands honest, because it runs the script you defined rather than guessing at a test command. Atlas lets you switch the active model and provider on the fly with favorites and recents, which is convenient when a quick handler edit and a larger migration off a Node shim want different models.

## Review and safety in a Bun repo

Every Atlas tool call is permission-gated against 3 rules, allow, ask, and deny, so in a Bun repo bun test can be allowed while a script that deploys or writes to a real bun:sqlite database file stays on ask. Atlas snapshots file changes as git patches so edits can be diffed and rolled back.

Speed and safety are separate concerns, and Bun only gives you the first. Atlas supplies the second: gated tool calls, a unified diff for every file edit, and git patch snapshots so a bad refactor is one rollback away. Atlas reads git branches, status, and diffs, and can stage and create commits on your behalf, so after bun fmt has run over the diff the commit contains only the shim removals and the tests that prove they behave the same.

## Getting started

1. Run atlas in a project with a bun.lock and a package.json.
2. Let Atlas read your Bun-native APIs (Bun.serve, Bun.file, bun:sqlite) and the scripts in package.json.
3. Ask Atlas to replace a Node compatibility shim with the native Bun API and confirm behavior with a test.
4. Let Atlas run bun test behind a permission prompt, which takes almost no time and lets it iterate quickly on a failure.
5. Have Atlas run bun fmt over the diff before you approve the commit.

## FAQ

### how to use an AI coding agent with bun

Run atlas in a project with a bun.lock and a package.json. Atlas reads your Bun-native APIs (Bun.serve, Bun.file, bun:sqlite) and the scripts in package.json, then proposes edits as unified diffs.

### how do I migrate node code to native bun APIs

Ask Atlas to replace a Node compatibility shim with the native Bun API and confirm behavior with a test, so an http server becomes Bun.serve and a local database becomes bun:sqlite.

### can an AI agent run bun test

Yes. Atlas runs bun test behind a permission prompt, which takes almost no time and lets it iterate quickly on a failure rather than guessing at a fix.

### does an AI coding agent format bun code

Atlas runs bun fmt over the diff before you approve the commit, so review is about the logic rather than the whitespace.

### is it safe to let an AI agent run commands in a bun project

Every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs, so bun test can be allowed while deploy scripts stay on ask or deny.

### can I undo an AI refactor in a bun repo

Yes. Atlas snapshots file changes as git patches so edits can be diffed and rolled back, and every edit is shown as a unified diff first.

---

Canonical HTML: https://runatlas.sh/resources/languages/bun
Source of truth: aeo_pages row `/resources/languages/bun` (segment: Languages) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
