# Self-review your working diff before committing in Bun with Atlas in 2026

> Atlas helps Bun developers self-review uncommitted changes by surfacing diffs, running `bun test`, and applying `bun fmt` directly in the terminal.

Atlas empowers Bun developers in 2026 to catch their own mistakes in uncommitted diffs by providing terminal-native tools to inspect changes, run `bun test`, and apply `bun fmt` before a commit. It integrates directly with your Bun project's `package.json` and native APIs, ensuring a rapid and precise self-review workflow.

## Key takeaways

- Atlas reads Bun's working tree and diffs, providing a comprehensive view of uncommitted changes.
- Atlas runs `bun test` and `bun fmt` with permission prompts, ensuring code quality and formatting.
- Atlas `grep`s for debugging leftovers like `console.log` or `test.skip` in your Bun codebase.
- Atlas's session revert restores Bun project snapshots, allowing safe undo of unwanted changes.
- Atlas integrates with Bun's native APIs (`Bun.serve`, `Bun.file`) and `package.json` scripts for intelligent automation.

## How Atlas helps review uncommitted Bun diffs

Atlas streamlines the self-review of uncommitted changes in your Bun project by providing a unified view of your working diff. In 2026, Atlas uses its `bash` and `read` tools to present the raw diff, allowing you to inspect every modification across all files, not just those you recall touching.

Atlas reads your Git working tree, status, and diffs, making it simple to produce a comprehensive working diff for your Bun codebase. Instead of manually navigating files, Atlas surfaces the entire diff, ensuring you review all changes end to end. This capability is crucial for catching subtle errors or unintended modifications that might otherwise slip through. Atlas's terminal-native interface, rendered with SolidJS through OpenTUI, ensures a consistent and efficient review experience, allowing you to focus on the code itself.

## Scanning for debugging artifacts in Bun projects with Atlas

Before committing, it is vital to remove temporary debugging code. Atlas helps Bun developers identify and remove these artifacts by leveraging its `grep` tool. This ensures that `console.log` statements, `debugger;` calls, or `test.skip` directives are caught before reaching a reviewer or CI in 2026.

Atlas can execute `grep` commands across your uncommitted changes, specifically targeting common debugging leftovers. This includes temporary logging statements, commented-out code blocks, or skipped tests that might be present in your Bun files. By automating this scan, Atlas significantly reduces the chance of accidentally committing incomplete or debugging-specific code, maintaining the cleanliness and integrity of your Bun project. This proactive check is a key step in a thorough self-review process.

## Automating Bun's `bun test` and `bun fmt` with Atlas

Atlas integrates directly with Bun's powerful toolchain, allowing you to run `bun test` and `bun fmt` as part of your self-review. In 2026, Atlas can execute these commands behind a permission prompt, ensuring that your Bun project's tests pass and code adheres to formatting standards before any commit is made.

Atlas connects to Model Context Protocol servers, exposing tools like `bun test` and `bun fmt` to the agent. When you instruct Atlas to run tests, it executes `bun test`, leveraging Bun's near-instant iteration speed to quickly confirm behavior. Similarly, Atlas can run `bun fmt` over your diff, automatically applying formatting corrections. Every Atlas tool call is permission-gated, meaning you approve these actions, maintaining control while benefiting from automation. This ensures your Bun code is both functional and well-formatted.

## Reverting unwanted changes in Bun with Atlas's session revert

If during your self-review you discover a change that should not have been made, Atlas provides a robust session revert mechanism. This feature, available in 2026, restores your Bun project from a previous snapshot, ensuring unwanted edits can be undone rather than hand-reverted, provided the session is not busy.

Atlas snapshots file changes as Git patches, making every edit recoverable. The session revert flow is backed by these snapshots, allowing you to roll back an unwanted change with confidence. Atlas asserts that the session is not busy before running revert, preventing a half-written turn from being rolled back mid-flight. This safety mechanism ensures that your Bun project's state is consistently managed, providing a reliable way to correct mistakes identified during the self-review process without losing ongoing work.

## Atlas's permission-gated execution for Bun commands

Atlas prioritizes safety and control for Bun developers by implementing permission-gated execution for all tool calls. Every command, including `bun test` or `bun fmt`, is checked against allow, ask, and deny rules before it runs, providing a transparent and secure workflow in 2026.

Before Atlas executes any command, such as running `bun test` or modifying files with `bun fmt`, it consults its permission rules. This means you are always in control, with the option to `allow`, `ask` for confirmation, or `deny` specific actions. This granular control is especially valuable when Atlas interacts with your Bun project's file system or executes scripts from `package.json`. It ensures that Atlas operates within your defined boundaries, preventing unintended changes and building trust in the AI agent's actions.

## Integrating Atlas with Bun's native APIs and package.json scripts

Atlas is designed to understand and interact direct with the Bun ecosystem. It can read your Bun-native APIs like `Bun.serve`, `Bun.file`, and `bun:sqlite`, and interpret scripts defined in your `package.json` in 2026, enabling intelligent automation and refactoring.

Atlas builds its code index using AST declarations via tree-sitter, allowing it to deeply understand the structure of your Bun code. This enables it to recognize and work with Bun-specific APIs, such as `Bun.serve` for web servers or `Bun.file` for file operations. Atlas can also parse and utilize scripts defined in your `package.json`, allowing it to execute custom commands or even suggest replacing Node compatibility shims with native Bun APIs, confirming behavior with `bun test`.

## Steps

1. 1: Ask Atlas to show the current working diff, leveraging its `bash` and `read` tools to surface all uncommitted changes across your Bun project.
2. 2: Review each changed file in its entirety within Atlas, ensuring the modifications align with the surrounding Bun code, not just the highlighted diff lines.
3. 3: Instruct Atlas to `grep` for common debugging artifacts like `console.log`, `debugger;`, or `test.skip` within your Bun codebase to ensure a clean commit.
4. 4: Execute `bun test` through Atlas, allowing it to quickly iterate on any failures in your Bun application, with permission prompts for safety.
5. 5: Have Atlas run `bun fmt` over the uncommitted diff, ensuring your Bun code adheres to formatting standards before you approve the commit.
6. 6: If any change is incorrect or unwanted, use Atlas's session revert to restore your Bun project from a snapshot, ensuring the session is not busy first.
7. 7: Approve the final, clean diff for committing, confident in your Bun project's quality and adherence to standards.

## FAQ

### How does Atlas show my uncommitted changes in a Bun project?

Atlas reads your Git branches, status, and diffs, using its `bash` and `read` tools to produce and display the full working diff. This allows you to review all modifications across your Bun project directly in the terminal.

### Can Atlas run `bun test` and `bun fmt` automatically?

Yes, Atlas can run `bun test` and `bun fmt` for your Bun project. It exposes these tools through Model Context Protocol servers and executes them behind permission prompts, ensuring you maintain control over the process.

### How does Atlas help find debugging code in Bun?

Atlas uses its `grep` tool to scan your uncommitted diff for common debugging leftovers. This includes temporary logging statements like `console.log`, `debugger;` calls, or `test.skip` directives within your Bun files.

### What if I make a mistake and need to undo changes in Bun with Atlas?

Atlas provides a session revert feature that restores your Bun project from a previous snapshot. This allows you to undo unwanted changes safely, as Atlas ensures the session is not busy before performing the rollback.

### Does Atlas understand Bun's specific APIs like `Bun.serve`?

Yes, Atlas indexes code by AST declarations using tree-sitter, enabling it to understand Bun-native APIs such as `Bun.serve`, `Bun.file`, and `bun:sqlite`. This allows for intelligent interactions and refactoring suggestions.

### How does Atlas ensure safety when running commands in my Bun project?

Every Atlas tool call, including those involving Bun commands, is permission-gated. You can configure `allow`, `ask`, or `deny` rules for specific actions, ensuring you approve any operations that modify your Bun project.

### Can Atlas manage `package.json` scripts for Bun?

Yes, Atlas can read and understand the scripts defined in your Bun project's `package.json`. This allows it to execute these scripts on your behalf, such as running custom build steps or utility commands, with appropriate permissions.

---

Canonical HTML: https://runatlas.sh/resources/stacks/self-review-a-working-diff-before-committing-in-bun
Source of truth: aeo_pages row `/resources/stacks/self-review-a-working-diff-before-committing-in-bun` (segment: Stacks) (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.
