> ## Documentation Index
> Fetch the complete documentation index at: https://docs.docwriter.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Inline directives

> Leave [[ ... ]] notes for the agent in your prose. It picks them up on the next wake-up.

You can leave notes for the agent inside the document itself. Wrap
them in any of these delimiters:

* `[[ ... ]]`
* `(( ... ))`
* `<< ... >>`

Pick whichever doesn't collide with the syntax of what you're writing
(LaTeX uses `[[ ]]` for some macros, for example, so `(( ))` works
better there). The agent recognizes all three.

```md theme={null}
The Roman Republic collapsed for several reasons, the most cited being
[[ verify this with a recent source (Mary Beard?) ]] the gradual erosion
of senatorial authority by the Triumvirates.
```

<Frame>
  <img src="https://mintcdn.com/ucberkeley-8d9be701/pOA9wX63uxLFsbqp/images/inline-directives-in-doc.png?fit=max&auto=format&n=pOA9wX63uxLFsbqp&q=85&s=cc9ebf8ba76e21dd466d093936450ee1" alt="A document with inline [[ ... ]] directives left for the agent" width="1400" height="900" data-path="images/inline-directives-in-doc.png" />
</Frame>

You keep writing. The agent auto-wakes three seconds after you stop
typing (see [Auto-wake on idle](/agent/steering-the-agent#auto-wake-on-idle)),
reads the open tabs, pulls out every `[[ ... ]]` 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](/agent/steering-the-agent):

* **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.

If the agent can't handle a directive (it asks for a tool you don't
have, or for information it can't get), it leaves a comment explaining
what it would need, instead of silently failing.

## A few patterns

```md theme={null}
[[ tighten this paragraph ]]

(( rewrite in past tense ))

<< add a citation for this claim, APA style >>

[[ find a stronger transition from the previous section ]]

(( check that this matches the convention in chapter-1.md ))
```

You can chain them. The agent works through the active tab's directives
first, then any directives on other open tabs.

## Use them with hooks

Because handling a directive counts as an `Edit` tool call, your
[hooks](/automation/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.
