The Fear of AI Coding

Building complex projects with AI coding agents requires multiple rounds of conversation and iteration.

What scares you?

  • Round 1: The AI changes 30 files, 300 modifications. You get exhausted reviewing by the 50th change.
  • Round 2: You ask the AI to continue, and it rewrites the code you just reviewed.
  • Round 3: The latest changes break the logic. You want to revert to the last “good” state, but there’s no reliable checkpoint.
  • Round N: The codebase is in chaos, spiraling out of your control.

The core pain point: In multi-round iterations, AI can write code, but you don’t know how to take over safely and efficiently.

Existing AI IDEs offer a pile of features but give you no control.

Even worse: Code written by AI is pushed directly to teammates for review, without the owner even reading it line by line. The owner must be the first reviewer. AI is an assistant, not a replacement.

These issues became increasingly apparent during the development of Databend. With nearly 1.9 million lines of Rust code and numerous modules, the usage of AI coding agents is skyrocketing. Letting AI change things at will? Unimaginable. Restricting it too much? Slows down iteration.

We need to find a balance between pure vibe coding (letting AI write freely) and traditional coding (hand-written): AI assists powerfully, humans control strictly, ensuring code quality matches human standards.

“If a workman wishes to do a good job, he must first sharpen his tools.” So, I developed Snowtree: To let you trust AI with your code.

Snowtree is a desktop application that manages multiple AI coding agent sessions. It uses worktree isolation + incremental review to put you back in control of AI-generated code.

It solves three core problems: isolating git code to reduce interference, keeping AI agent capabilities up-to-date, and safe handover during multi-round iterations.

Snowtree

What Does Snowtree Do?

In one sentence: A complete loop from isolated environment to PR.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│ Worktree │────▶│ AI Coding │────▶│ Changes │
│ Isolation │ │ Codex/Claude│ │ Code Diffs │
└─────────────┘ └─────────────┘ └─────────────┘

┌───────────────────────────────────────┘

┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Review │────▶│Stage/Restore│────▶│ Commit │
│ Line-by-Line│ │ Keep/Discard│ │ Snapshot │
└─────────────┘ └─────────────┘ └─────────────┘


┌─────────────┐
│ Create/ │
│ Sync PR │
└─────────────┘

The Complete Workflow:

  1. Worktree Isolation: Create an independent git worktree for each AI session, zero interference with the main repo
  2. AI Coding: Invoke Codex or Claude Code CLI in the isolated environment
  3. Changes Generated: After AI completes, all code changes are displayed automatically
  4. Line-by-Line Review: Review each hunk to see exactly what AI changed
  5. Stage or Restore: Stage hunks you approve, Restore (discard) ones you don’t
  6. Commit: Commit staged code to create a trusted snapshot
  7. Create/Sync PR: One-click to create or sync to a remote PR

This is Snowtree’s core value: Pipeline AI’s free creativity with human’s strict control.

Three Core Design Philosophies

1. Parallel Isolation Based on Git Worktree

We are used to git branches, but you can only develop on one branch at a time.

Imagine this: Codex is refactoring a module when a critical bug report comes in. Stop and wait for the AI? Or commit and switch branches?

The Snowtree Solution: A separate worktree for each AI session.

1
2
3
4
5
6
7
8
9
main-repo/
├── .git/
├── src/
└── ...

~/.snowtree/worktrees/
├── session-1-refactor/ # Codex is refactoring a module
├── session-2-bugfix/ # Claude is fixing a critical bug
└── session-3-feature/ # Another AI agent developing a new feature

Snowtree Chat

Completely isolated, no interference. AI can change whatever it wants without affecting your main workspace or clashing with other sessions. When done, merge and delete the worktree. Clean and simple.

2. Native AI Coding Agent Capabilities, No Wrappers

Many AI IDEs wrap or “improve” AI coding agents, resulting in:

  • Always lagging behind the official versions (Claude Code and Codex update frequently and know best how to adapt to their models).
  • Missing out on the latest features.
  • Custom implementations that are worse than the original.

Philosophy: Maximize the use of native CLIs, zero encapsulation.

Directly invoke the local Claude Code and Codex CLIs, launching real processes via PTY, capturing output without altering behavior.

Do one thing only: Manage sessions and workflows, don’t reinvent the AI coding agent.

3. Humans Must Control AI Code: Review-Stage-Commit Workflow

The core of the core.

My practical experience: After every round of conversation, if it looks good, commit immediately to prevent the next round of AI changes from breaking things without a way back.

This is essentially an incremental snapshot approach: stage what you confirm immediately, and only review the new changes each time.

Traditional Workflow:

1
2
3
AI modifies code → Review everything at once → commit

Too much, can't handle the review

Snowtree Workflow: Incremental review + snapshot

1
2
3
4
5
Round 1: AI modifies code → Review → Approve → Stage (snapshot)

Round 2: AI continues → Review only increments → Approve → Stage

Round N: Repeat... → All passed → Commit → Create/Push PR

Snowtree Diff Review

Core: Stage = Snapshot.

Code that is Approved is staged immediately, saved in the staging area. The AI can continue to modify freely, and I only review the new increments. You can even commit midway and sync to a GitHub PR. Foolproof.

Key Advantages:

  • Batch Review: Review a few files at a time, don’t get overwhelmed.
  • Line-by-Line Control: Don’t stage code you don’t like; continue the conversation and have the AI rewrite it.
  • Safe Iteration: staged = snapshot. No matter how the AI changes things later, previous work is safe.

Who is this for?

Developers who are experienced and want to seriously review AI code.

Open Source

Project URL: https://github.com/bohutang/snowtree (Apache 2.0)

Core: Minimalist, Native, Controllable.


Inspired by the design style of excellent IDEs like Zed/OpenCode, based on their code, distilled alternately by Codex and Claude Code, combined with my product philosophy.