.codemachine folder in your project. This folder tracks everything about your workflow session—what’s running, what’s finished, and how to pick up where you left off.
The .codemachine Folder
.codemachine
agents
agent-config.json
planner.md
coder.md
reviewer.md
inputs
specification.md
artifacts
prompts
memory
directive.json
logs
template.json
What each folder and file contains
What each folder and file contains
How Progress is Tracked
Thetemplate.json file is the heart of workflow tracking. It remembers:
Current Position
Which step is running and which steps are done
Session Info
IDs needed to resume interrupted steps
Your Choices
Selected track and conditions from onboarding
Recovery Data
Everything needed to continue after a crash
template.json Schema
State Transitions
Manipulating Workflow Progress
You can manually control workflow execution by editingtemplate.json. This is useful for:
- Re-running a specific step
- Resetting the workflow to an earlier point
- Skipping steps that already completed
Revert to a Previous Step
ThecompletedSteps object tracks finished steps by index. To go back to a step, remove it (and all steps after it) from completedSteps.
Example: You have steps 0, 1, 2 completed and want to re-run step 2:
Reset Entire Workflow
To start from the beginning, clearcompletedSteps:
template.json file to reset everything.
Workflow Lifecycle
Here’s what happens as your workflow runs:Workflow Starts
CodeMachine creates the
.codemachine folder and initializes template.json with your selected options.Step Begins
The current step is marked as “in progress” so CodeMachine knows where you are.
Agent Runs
The agent executes with its prompts. Session info is saved for potential recovery.
Step Completes
The step is marked complete with a timestamp, and CodeMachine moves to the next step.
Workflow Ends
All steps are marked complete. The workflow is finished.
What Happens If Something Goes Wrong?
CodeMachine automatically saves your progress. If your workflow crashes or you close the terminal, you can pick up right where you left off.
- CodeMachine finds the
.codemachinefolder - It reads
template.jsonto see which step was running - It offers to resume from that step (or the last completed one)
Agent Directives
Agents can control what happens next by writing todirective.json. This is how agents communicate with the workflow.
- Continue
- Loop Back
- Wait for User
- Call Another Agent
- Stop
- Error
User Controls
You can control workflow execution with keyboard shortcuts:Execution Logs
Thelogs/ folder contains detailed records of every agent run:
registry.db - Execution History
registry.db - Execution History
A SQLite database tracking every agent execution:
- Agent name and engine used
- Start time, end time, and duration
- Status (running, completed, failed, skipped)
- Token usage and cost estimates
- Error messages if something went wrong
Agent Log Files
Agent Log Files
Each agent gets its own log file (
agent-*.log) containing:- The full prompt sent to the agent
- The agent’s complete response
- Any errors or warnings during execution
Cleaning Up
To start fresh, you can safely delete the.codemachine folder: