| name | factory-stop |
| description | Gracefully stop a running Factory session by writing the stop signal, checking active worktrees, and explaining how to resume. Use when you want the current loop to finish cleanly and then halt. |
Factory Stop
Gracefully stop the Factory.
Steps
1. Create Stop Signal
Create the .factory/STOP file in the repository root:
mkdir -p .factory
echo "Stop requested at $(date -u +%Y-%m-%dT%H:%M:%SZ)" > .factory/STOP
The orchestrator checks for this file between cycles and will stop gracefully after completing its current cycle.
2. Check for Active Worktrees
List any active worktrees:
git worktree list
If there are worktrees under .factory/worktrees/, report them. The orchestrator should clean them up on exit, but if the factory crashed, the user may want to clean them manually:
git worktree prune
3. Report
Factory stop signal sent.
The factory will stop after completing its current cycle.
If the factory is not running, this signal will prevent the next factory run from starting until removed.
To resume: delete .factory/STOP
To clean up orphaned worktrees: git worktree prune
4. Remove Stop Signal (if asked to resume)
If the user says they want to resume or restart, remove the stop file:
rm -f .factory/STOP