> For the complete documentation index, see [llms.txt](https://docs.codemate.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.codemate.ai/cora/modes/marshal.md).

# Marshal

The mode that plans, checks, builds, and verifies so nothing falls through the cracks.

Marshal mode is CORA's structured execution mode. Instead of deciding on the fly what to do next, Marshal mode locks in a fixed sequence of stages **Plan, Reflect, Implement, Review**, and a final **Assessment** and works through them one at a time. It will not skip a stage, rush into code, or silently paper over a problem. Every step is visible, every transition is intentional.

#### When to use Marshal Mode

Marshal mode is built for tasks where doing it wrong is expensive where a missed edge case, an overlooked dependency, or an incorrect assumption could mean hours of rework.

Use Marshal mode when:

* You're making changes that touch multiple files, systems, or features at once
* The task is complex enough that you want a written plan before any code is written
* You've been surprised before by Auto mode making changes you didn't expect or didn't fully review
* You're working on something that matters a critical feature, a migration, a refactor with wide blast radius
* You want full visibility into what CORA is doing and why, at every step

If your task is small or well-scoped `fix this bug`, `refactor this function`, `explain this code` a direct mode like Code or Plan is faster. Marshal mode adds structure that pays off on complex work, not simple tasks.

#### How Marshal Mode works

Marshal mode runs through five stages in order. It will not move to the next stage until the current one is complete.

**1. Plan** CORA reads the codebase, asks questions if needed, and writes a clear implementation plan. Nothing is changed. The goal is to understand the full scope before touching anything.

**2. Reflect** CORA re-reads its own plan and stress-tests it. It looks for gaps, risks, edge cases, and anything that could go wrong. The plan is revised until it's solid.

**3. Implement** CORA executes the plan writing code, making changes, updating files. It follows the plan exactly as written.

**4. Review** CORA checks its own work against the plan. If something doesn't match or a problem is found, it loops back to Implement and fixes it before continuing.

**5. Assessment** A final, thorough review pass. CORA checks for regressions, missed cases, and anything that slipped through. Once this stage passes, the task is complete.

> You can see which stage CORA is in at any point during the task. If you don't like what you see in the Plan or Reflect stage, push back or redirect before CORA starts making changes that's the right time to course-correct.

***

#### Auto Mode vs Marshal Mode

Auto mode is the right default for most tasks. It reads the prompt, figures out the best approach, and sequences things on its own planning when needed, jumping straight to code when not. It's flexible and fast, which is exactly what you want for everyday work.

Marshal mode trades that flexibility for certainty. Every task starts with a written plan. That plan gets stress-tested before a single file is touched. Code only gets written once the plan is locked. Then it's reviewed, fixed if needed, and verified one final time. If you've ever had Auto mode surprise you mid-task with a change you didn't expect, Marshal mode is how you prevent that you see the full picture and sign off before execution begins.

***

#### Running Marshal Mode

Marshal mode works best when you describe the full scope upfront. The more context you give, the stronger the plan.

```
Migrate our authentication system from session-based to JWT. Update all protected routes,
add refresh token support, and make sure nothing breaks in the existing user flow.
```

```
Add a multi-tenant billing system. Each organization should have its own subscription, 
usage tracking, and invoice history. Don't touch the existing single-user billing until 
the new system is verified.
```
