Products Marketplace Blog About Contact Sign in Download
lac agent PlanMode: Think Before You Touch a File

lac agent PlanMode: Think Before You Touch a File

Most AI coding tools just start writing the moment you press Enter. PlanMode in lac agent makes it stop, think, and show you the full plan first — before a single file gets touched.

The problem with "just start coding"

My old workflow with AI coding tools was pretty chaotic. I'd describe what I wanted, the model would immediately start writing files, and halfway through I'd realize it had picked the wrong architecture entirely. Now I'm stuck either guiding it back on track mid-stream or doing a full undo and starting over.

It's not that the AI is bad at coding. It's that it starts too fast. It commits to an approach before either of us has really thought it through.

PlanMode in lac agent fixes exactly this. It's a mode where the agent reasons through the whole task first — what files it needs to touch, what the structure should look like, what the order of operations is — before writing a single character to disk.

How PlanMode actually works

When you're inside a lac agent session, you can activate PlanMode before giving the agent a task. Instead of immediately opening files and generating code, the agent produces a written plan: which files it will create or modify, what changes it intends to make in each one, and why it's approaching it that way.

You read the plan. You can push back, ask it to reconsider a decision, or tell it to change the approach entirely. Only once you're happy with the plan do you let it execute.

The difference in output quality is noticeable. When the agent has already reasoned through the architecture before writing, it doesn't contradict itself three files in. It doesn't create a model in one place and forget to wire it to the router. It has a coherent picture of the whole task before any of it lands on disk.

When I actually reach for it

Not every task needs PlanMode. If I'm asking lac agent to rename a function or fix a type error, I want it to just do it. The overhead of reviewing a plan for a two-line change is pointless.

But for anything that touches more than two or three files — or anything where the architecture decision matters — PlanMode is worth the extra step. Some specific cases where I use it:

  • Adding a new feature that requires a new model, a controller, and route wiring
  • Refactoring a module that other parts of the codebase depend on
  • Any task where I'm not fully sure what the right approach is myself and want the agent to surface its assumptions before acting
  • Onboarding the agent to a new project where it hasn't built up context yet

That last one is worth pausing on. If you're starting fresh on a project, the agent's plan tells you a lot about how well it has understood your codebase. If the plan looks wrong — wrong file paths, wrong conventions, wrong library choices — you catch it before it does anything. That's much better than catching it after.

PlanMode pairs well with project memory

lac agent stores project context in a .lac-memory.json file at the root of your project. The agent reads this file at the start of every session, so it already knows your stack, your conventions, which files are important, and any notes you've left for it.

When PlanMode has this memory to draw on, the plans it produces are sharper. It won't suggest adding a dependency you already have under a different name. It won't propose a folder structure that contradicts the one you've already established. The plan reflects actual knowledge of the project, not just a generic guess.

If you haven't set up .lac-memory.json for your project yet, it's worth doing before you lean on PlanMode. The combination is where lac agent starts feeling less like an autocomplete tool and more like a collaborator that actually knows your codebase.

What the plan output looks like

The agent's plan isn't a vague summary. It's specific. You'll see something like:

  • A list of files it plans to create, each with a short explanation of what will go in it
  • A list of existing files it plans to modify, with notes on what changes and why
  • Any assumptions it's making — for example, that you're using a particular auth pattern or that a specific helper function already exists
  • The order it intends to work in, which matters when later files depend on earlier ones

That last point — execution order — is something I used to have to think about manually. With PlanMode, the agent reasons through dependencies between files and sequences the work itself. When it gets it wrong, you can correct it before any code is written. When it gets it right, you just approve and let it go.

Undo is still there if you need it

Even with PlanMode, the agent can still surprise you. Maybe the plan looked fine but the actual implementation of one file went sideways. That's what lac agent's undo is for — you can roll back individual file changes with a diff preview so you can see exactly what's being reverted.

PlanMode reduces the situations where you need undo, but undo is still the safety net underneath. The two features work well together. Plan carefully, execute, and if something goes wrong, revert cleanly.

Getting started

If you don't have lac-cli yet, the quickest install is:

pip install lac-cli

Then run lac agent from the root of any project. From there, activate PlanMode before your next big task and see what the agent maps out before it touches anything.

The practical tip: treat the plan as a real design document, not just a formality. Push back on it. Ask why it chose a particular approach. That back-and-forth before execution is where you catch the architectural mistakes that would otherwise cost you twenty minutes of cleanup later.

You can find more on lac agent and the rest of the toolkit over at lac-cli.

We use cookies to keep you signed in and to serve ads via Google AdSense. By continuing to use this site you agree to our Privacy Policy.