Skip to content

Keep an agent working toward a goal

On this page

A goal tells Codex or Claude to keep working toward an objective across responses: when one response finishes, the agent can start the next one itself, without another prompt from you. Use a goal for a task that needs repeated rounds of investigation, changes, and testing, such as finding and fixing a failure that is difficult to reproduce. The steps below are for Codex; Claude goals work differently, as described in Set a goal for Claude.

Set a useful goal

In a Codex thread, enter /goal followed by the outcome you want. You can also choose goal mode in the composer and type the objective there. For example, suppose checkout is failing in your app and you want Codex to keep working until purchases succeed again:

/goal Fix the failing checkout flow. Run the relevant tests and verify that a user can complete a purchase in local development.

Include how Codex should verify the result and any limits on the work, such as which files it may change or whether it may deploy.

To turn something you've already written into a goal, type / and choose Goal. When you send, Codex will use everything in the composer as the goal, including attached files and images. If the goal is over 4,000 characters, it will be saved to a file on the box, and the goal will point Codex to that file. If boxes.dev can't set the goal, it will show an error and keep your text and attachments so you can try again.

Follow progress

The goal panel shows the saved objective and its status. While it says Pursuing goal, you can still answer questions and provide information in the conversation.

Use Edit goal to change the objective, or Pause goal and Resume goal to control when Codex pursues it. For a goal saved to a file, the editor will show the file's full text, unless the file is larger than 1 MB. To replace the objective, enter /goal with the new objective and confirm Replace goal; you will keep the same thread. Clear goal will remove the saved objective.

If the status is Goal blocked, read Codex's explanation and resolve the reported blocker. Goal usage limited means your provider usage limit was reached, and Goal limited means the goal used up its own token budget; neither means the objective is complete. In each case, check the conversation and your remaining allowance, resolve what stopped the work, then choose Resume goal to continue.

Review before finishing

When the panel says Goal achieved, review the result and the checks Codex ran. For code changes, inspect the changed files and try the affected app behavior. If you need more work, set another goal or send a normal prompt.

Set a goal for Claude

In a Claude thread, enter /goal followed by the condition that should be true when the work is done. After each response, Claude will check the condition and keep working until it's met. For example:

/goal All checkout tests pass, and a test purchase completes in local development.

If you've already typed the condition, type / and choose /goal from the list. boxes.dev will move /goal to the start of the message and keep your text as the condition.

While a goal is set, the desktop app shows its condition in a Goal panel above the message box. Each time Claude checks the condition and decides to keep working, the panel shows its reason under the condition. To change the condition, choose Edit goal while the message box is empty. The box will fill with /goal and the current condition for you to edit and send.

To see the current goal, enter /goal by itself. To remove it, enter /goal clear. While Claude is working, choose Stop before you send any /goal message.

A condition can be up to 4,000 characters, and the paths of attached files count toward that limit. A /goal message can't include images or a Code review attachment, and a status check or /goal clear can't include any attachments. On a new devbox thread, /goal isn't available while the project has a First prompt prefix; choose Open Devbox lifecycle in the composer notice to change it.

To start work on a schedule, from an API request, or from an integration, use an automation.