[[ ... ]](( ... ))<< ... >>
[[ ]] for some macros, for example, so (( )) works
better there). The agent recognizes all three.
![A document with inline [[ ... ]] directives left for the agent](https://mintcdn.com/ucberkeley-8d9be701/pOA9wX63uxLFsbqp/images/inline-directives-in-doc.png?fit=max&auto=format&n=pOA9wX63uxLFsbqp&q=85&s=cc9ebf8ba76e21dd466d093936450ee1)
[[ ... ]] it finds, treats each
one as a task in a queue, and handles them (proposing edits, posting
comments, or running tools as appropriate). When it acts on a directive,
it deletes the directive text from the document so the prose closes
back up.
If you don’t want to wait the three seconds, Cmd/Ctrl+Enter in the
editor triggers the same wake-up immediately. Clicking the agent pill
at the top of the history pane does the same.
Why this exists
Talking to the agent through the chat popover is great when you have a clear, immediate request. But the requests that actually come up while writing are often local and contingent: “fact-check this,” “I’m not sure about this transition,” “rewrite this once I figure out the rest of the section.” Stopping to type those into a chat box pulls you out of the flow. Directives are a way to write the request where the request applies (in the document, at the spot it matters), and pick it up later, in batch.How they’re handled
The agent’s behavior depends on the autonomy level:- Conservative. The agent only edits when a directive is present or the user has made a specific request. Directives are the main way to get edits at this level.
- Balanced. Directives are handled first; the agent may also pick up obvious problems in the prose.
- Aggressive. Directives are still handled, but the agent is also proactive about improvements you didn’t write a directive for.
A few patterns
Use them with hooks
Because handling a directive counts as anEdit tool call, your
hooks fire. If you have pdflatex wired up, the
PDF rebuilds. If you have an auto-commit hook on Stop, the change
pushes to git when the agent finishes the turn.
The practical workflow: write your draft with directives sprinkled
through it, walk away, come back, wake the agent, and watch a batch
of small concrete changes land, each one already built and committed
by the time you start reviewing.