Docs
Comment-triggered Work
Type an actionable comment in the Zero editor and Zero surfaces an inline approval offer. Nothing runs until you approve.
How it works
While editing a file in Zero, the editor scans the current line as you type. If the line is a comment in a supported language and the comment text starts with an actionable phrase, an inline tooltip appears:
// fix the auth timeout on refresh
┌──────────────────────────────────────┐
│ Hmm.. let me take over.. [Approve] [Decline] │
└──────────────────────────────────────┘If you click Approve, Zero creates a Work item using the comment text as the bounded intent, spawns an agent, and starts a session. If you click Decline or ignore the offer, nothing happens.
Trigger phrases
The comment text (after stripping the comment syntax) must start with one of these phrases to surface an offer:
| Phrase | Example |
|---|---|
fix | // fix the auth timeout on refresh |
refactor | // refactor this to use atomic CAS |
improve | // improve error messages here |
optimize / optimise | # optimize this query |
investigate | // investigate why this races |
explain | // explain what this loop does |
simplify | // simplify this branching |
add | // add retry logic here |
make | // make this idempotent |
find | // find where this leaks memory |
review | // review this section |
clean up | // clean up this state machine |
help me | // help me understand this diff |
please | // please fix the type error below |
Comment text must be at least 8 characters (after stripping the prefix).
Ignored patterns
These comment patterns are explicitly excluded and never surface an offer:
TODO:— task annotationsFIXME:— legacy fixme markersNOTE:— informational noteseslint-disable/eslint-enable— linter directivesprettier-ignore— formatter directivesCopyright— license headers
Supported languages
| Language | Line comment | Block comment |
|---|---|---|
| TypeScript / JavaScript | // | /* … */ |
| Rust | // | /* … */ |
| Python | # | — |
| Shell | # | — |
| YAML | # | — |
| HTML | — | <!-- … --> |
| Markdown | — | <!-- … --> |
| CSS | — | /* … */ |
Approval and Work creation
When you click Approve:
- Zero creates a Work item with the comment text as the title and intent.
- The active file path, language, line number, and surrounding context (±6 lines) are attached to the Work item.
- An agent is spawned via
POST /agentswith the comment as a prompt override. - A session starts in Plan mode — the agent forms a hypothesis and plan for operator review before any code executes.
Dismissed and approved state
Zero tracks which offers you've dismissed or approved using a stable fingerprint (project ID + file path + normalized comment text). Dismissed offers do not reappear for the same comment. Approved offers are also recorded so the same comment does not offer again.
State is stored locally in localStorage under:
zero.editor.takeover.dismissedzero.editor.takeover.approved