One command. Agent stops. Memory rolled back. Like it never happened.
When an agent goes off-track — running the wrong task, stuck in a loop, or executing something you didn't intend — agent-interrupt kills it cleanly and rewinds its memory to before it received that task.
After installing, run once to set up all your agents:
bash
python -X utf8 scripts/install.py
Then just tell your assistant:
text
kill dev1
kill all
interrupt-logs/ for recoveryNo need to remember exact agent IDs. It understands names:
text
kill dev1 → matches zero_dev1
kill pm → matches zero_pm
kill 开发工程师 ��� matches by Chinese name
kill all → interrupts every agent except main
For agents running long scripts, use run.py wrapper so they can be killed precisely:
bash
# Instead of: python your_script.py
python -X utf8 scripts/run.py --agent <your_agent_id> -- python your_script.py
install.py automatically adds this protocol to all your agents' AGENTS.md files.
New agents added later are picked up automatically via a background watcher.
Every rollback is backed up:
text
~/.openclaw/agents/<id>/interrupt-logs/rollback-YYYYMMDD-HHMMSS.jsonl
Append the backup lines back to the transcript to restore.
ScriptPurposeinterrupt.pyKill + rollback (main script)install.pyOne-time setup for all agentsrun.pyWrapper for precise kill supportwatch.pyAuto-injects new agents (runs via cron)mark.pyManual PID registration (advanced)
Works on Windows, Linux, macOS. No external dependencies beyond Python stdlib.