Blog

The terminal setup for vibe coding, without losing the thread

The appeal of vibe coding is not writing the code. The thing that ends it is coming back an hour later and having no idea what any of it does.

· updated 20 August 2026

Vibe coding works right up until the state lives only in a conversation. The setup that keeps it working is three things: give every agent its own git branch on its own worktree so nothing you did not review reaches your main branch, keep the plan in a durable file outside the chat so a context compaction cannot erase it, and use scoped credentials so a fast, loose session cannot cause a slow, expensive incident.

What actually goes wrong

Vibe coding gets caricatured as not reading the code, which misses the real failure. The real failure is losing the thread. You describe what you want, the agent builds it, you steer, and it works. Then you take a call. When you come back, the agent has compacted its context, you cannot remember what you rejected and why, and the diff is four hundred lines you did not watch land.

That is a state problem, not a discipline problem, and you cannot fix it by being more careful. The state was only ever in a conversation, and conversations are not storage.

Keep the fast path away from your main branch

The whole point of vibe coding is going fast without weighing every line. That is a completely reasonable way to work, on a branch you can throw away.

So put every session on its own branch, on its own git worktree. A worktree is a separate working directory on the same repository, so the agent works at full speed in its own directory and your main working tree is untouched. Nothing reaches your branch until you merge it deliberately.

This also solves the two-agents-one-file problem for free, so if you like running a couple of sessions at once it is the same fix twice.

Make the plan survive the session

Before the agent starts building, get the plan out of the chat. Ask it to write down what it is about to do, what it is assuming, and what it decided against. In a file, in the repository.

It takes thirty seconds and it changes what happens when you come back. You read the plan rather than reconstructing it from a diff. A different agent can pick the work up. And when the context window compacts, which it will, the thing that made the session valuable is not in the part that got dropped.

This is the single habit that separates vibe coding that compounds from vibe coding you throw away.

Do not let a fast session touch a slow-to-fix credential

Moving fast is fine. Moving fast with a production database token exported into the shell is a different category of thing.

Give agent sessions scoped, short-lived credentials with the minimum permission they need, so the worst case is bounded and revocable. If you want the stronger version, use a vault that gives the secret to a single command's environment rather than the shell, so the agent gets the result and never the value. That is what Forkbench's Vault does, and it is our product so weigh it accordingly.

Either way, know the limit. This prevents accidental exposure through prompts, logs and scrollback. An agent you deliberately authorise to run a command could still print what it was handed.

If a key is already exposed in the project, the deeper walkthrough on what to do about it lives elsewhere.

Then let it rip

With those three in place, the loose part of vibe coding gets safer rather than more dangerous, because the blast radius is small and the record is outside the chat. Run two or three sessions, let them build, steer when they drift.

The one rule worth keeping strict: an agent reporting that something works is a claim, not a verification. Accepting it is your job, and it is the only part of this that should not be fast.

Related: Stop coding agents reading your .env file

Frequently asked

Keep reading