# Direct the agent

Source: https://layerwise.app/docs/build-your-app/direct-the-agent

Plan before building, set a goal for longer work, queue follow-up requests, stop a turn, and answer the agent's questions.



The agent works through each message you send in the conversation. These controls change how it works: agree on a plan first, keep it going toward a larger goal, line up your next requests, and give it a decision when it asks for one.

## Open the command menu [#open-the-command-menu]

Type `/` at the start of the message box, or after a space, to open the command menu. It lists:

* **Commands** — **Plan mode** and **Goal**.
* **Skills** — the skills turned on for this project. See [Skills and MCP servers](./skills-and-mcp).

Keep typing to filter the list. Use the arrow keys to move, Enter or Tab to choose, and Esc to close the menu. **Plan mode** and **Goal*&#x2A; are also in the &#x2A;*+** menu beside the message box.

While the agent is working, the command menu lists only skills.

## Plan before building [#plan-before-building]

Turn on **Plan mode** when you want to agree on an approach before the agent changes the project. A **Plan** chip appears in the message box, and the agent answers with a plan for you to review.

When the plan is ready, Layerwise asks &#x2A;*Implement this plan?** Choose **Implement plan** to have the agent carry it out in the default mode, or **Cancel** to keep refining it. Plan mode stays on for the conversation until you choose **Exit Plan mode** on the chip.

## Set a goal [#set-a-goal]

Use a goal for work that needs many turns, such as “Build the complete onboarding flow and check every step at phone width.” The agent keeps working, turn after turn, until the goal is complete, you pause it, or it needs your input.

1. Type `/` and choose **Goal**. A **Goal** chip appears in the message box.
2. Describe the objective and send the message.

The goal bar above the message box shows the goal's status, its objective, and how long it has been running. Use it to:

* **Pause goal** or **Resume goal**.
* **Edit goal** to change the objective.
* **Clear goal** to remove it. A conversation has one goal at a time, so clear the current goal before starting another.
* **Show goal details** to see how many tokens the goal has used.

A message you send while the agent works on a goal steers the current work instead of waiting in the queue. Stopping the agent pauses the goal. A goal is also paused when Layerwise reloads the conversation, for example after a restart. Choose **Resume goal** to continue.

A goal does not stop after a set number of turns or minutes. Check its progress from time to time, and pause it if the work heads in the wrong direction.

## Queue your next request [#queue-your-next-request]

You can keep writing while the agent works. Messages you send are added to **Queued prompts** above the message box and run in the order you added them, each after the previous turn ends.

* Choose **Edit queued prompt** to change a prompt's text, or **Delete queued prompt** to remove it.
* To change the order, delete a prompt and send it again.
* Queued prompts are kept when you quit Layerwise.

If a turn fails or you stop it, the queue pauses and shows &#x2A;*Queue paused. Resume when you’re ready.** Choose **Resume queue** to continue. Sending another prompt also resumes it.

Wait for queued prompts to finish before you start a goal.

## Stop the agent [#stop-the-agent]

While the agent works and the message box is empty, choose **Stop** to end the current turn. The conversation marks the turn &#x2A;*Cancelled by you.** Changes the agent made before you stopped it remain in the project.

## Answer the agent's questions [#answer-the-agents-questions]

When a decision is yours to make, the agent asks instead of guessing. Its question takes the place of the message box until you answer; anything you had typed is kept.

* Choose one of the options, each with a short description. When **Other** is offered, choose it to write your own answer.
* Some questions ask for text. Secret values, such as API keys, use a masked field.
* When the agent asks several questions, they appear one at a time. Choose **Next** after each answer and **Submit** after the last one.

The agent waits until you submit your answers.
