Modes & Sessions
buildwithnexus runs in one of three modes and remembers every run as a session. Modes decide how much autonomy the agent has; sessions let you stop and pick up exactly where you left off. Pick a mode from a subcommand or switch inside the REPL.
Plan Mode
Plan mode is for changes you want to see laid out before anything touches disk. buildwithnexus decomposes the task into an ordered list of concrete steps and shows it to you. Nothing runs until you approve. Once you do, it executes the steps — switching into the BUILD tool loop to carry each one out.
buildwithnexus plan "migrate the test suite to vitest"
Use it when the task is large or risky, when you want to vet the approach first, or when you'd rather review a plan than babysit each individual edit.
Build Mode
Build mode is the agentic core: a ReAct loop where the model alternates between reasoning and acting. Each turn it picks a tool, you see the call (and, for edits, an inline colored diff), the result feeds back into context, and the loop continues until the model calls finish. It's the default for buildwithnexus run.
buildwithnexus run "add a --verbose flag to the CLI"
The Tool Loop
Reads are free to run; the mutating tools — write_file, edit_file, run_command — are gated by the active permission mode (ask / auto / readonly). Sensitive paths and catastrophic commands always prompt, even under auto, and file tools stay confined to the working directory.
Brainstorm Mode
Brainstorm mode is plain conversation with the model — no tools, no file access, nothing written. Use it to think through a design, draft an approach, or ask questions without any risk of side effects.
buildwithnexus brainstorm "how should I structure the plugin API?"
Subagents
A long or branching task can blow past a single context window. spawn_subagent delegates a self-contained sub-task to a fresh context window — the subagent works in isolation and reports a result back to the parent, keeping the main transcript focused.
Sessions
Every run — whatever the mode — writes its full transcript to ~/.buildwithnexus/sessions. You can stop any time and resume later from the CLI or from inside the REPL.
buildwithnexus sessions # list saved sessions
buildwithnexus continue # resume the most recent
buildwithnexus resume <id> # resume a specific session
Auto-Compaction
Long sessions don't hit a wall. As the transcript approaches the model's context window, buildwithnexus auto-compacts — condensing earlier turns so the conversation keeps going without losing the thread.