You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a /goal composer command that works with any provider #1960
I want to give an agent a goal instead of a single prompt. I type /goal <text> in the composer. The agent keeps working, in loops, until it meets the goal or asks me for help. I want this for any model from any provider, not only for one provider.
What happens today
bb has no /goal command. Each prompt is one turn. To get goal-style behavior I must write my own instructions in every prompt, or use a workflow script.
What you would expect
The composer accepts /goal <text> as a slash command. The command shows in the slash-command list.
bb sends the goal as a turn with a server-owned instruction block that tells the agent to work until the goal is done, verify the result, and report.
The thread shows the goal in the timeline as a goal card, with a done / not done state.
It works with every provider (Claude Code, Codex, Pi, ACP providers), because the server owns the instruction and not the provider.
It is also available from the CLI and the SDK, for example bb thread message --goal "<text>" or a /goal prefix in the message text.
Cursor GUI shipped a /goal command recently; that is the reference.
Context and alternatives
Workaround today: the workflows plugin, or a custom instruction in each prompt.
The server already owns product policy for turns, so the goal instruction belongs to the server (see AGENTS.md, Server And Daemon).
Source: user feedback collected on 2026-08-19.
Checks
I searched open and closed issues for the same request.
If an agent wrote this, the body ends with > AGENT GENERATED: by <model>.
Evidence that might help decide scope. Tested at main @ 9b8c1d3 with Claude Code 2.1.280.
Why /goal doesn't show for Claude Code threads today. The send-menu Goal action comes from each provider's composerActions, and the / typeahead lists only built-ins, skills, and .claude/commands files, so neither surface offers goal for Claude Code.
) and Codex sets the goal itself. The goal card is fed by Codex's thread/goal/updated and thread/goal/cleared notifications, which carry objective, status (active | paused | budgetLimited | complete), and budget (
Claude Code has a native /goal in headless mode, and bb already passes it through. Repro:
claude -p --model claude-haiku-4-5-20251001 --output-format stream-json --verbose --max-turns 4 "/goal reply with the single word ok"
init.slash_commands includes goal.
The first assistant message is synthetic (model: "<synthetic>") with text Goal set: reply with the single word ok and a structured local_command_run: {"command":"goal","args":"reply with the single word ok"}, so the objective is available without parsing text.
The model then answers and the result is success. I saw no goal progress, completion, or clear event in the stream; only the set is observable.
Same behavior when the prompt is sent as a stream-json user message (--input-format stream-json), which is how bb's SDK session sends turns (
). So typing /goal … in a Claude Code thread today most likely sets a native goal that bb can't show or clear.
Unverified: I didn't run this inside a bb thread end to end, and I didn't check what /goal clear emits.
Trimmed stream-json output
{"type":"system","subtype":"init","claude_code_version":"2.1.280","model":"claude-haiku-4-5-20251001","slash_commands":[…,"goal",…],…}
{"type":"assistant","message":{"model":"<synthetic>","role":"assistant","stop_reason":"end_turn","content":[{"type":"text","text":"Goal set: reply with the single word ok"}],…},"local_command_run":{"command":"goal","args":"reply with the single word ok"},…}
{"type":"assistant","message":{"model":"claude-haiku-4-5-20251001","content":[{"type":"text","text":"ok"}],…},…}
{"type":"result","subtype":"success","is_error":false,"num_turns":1,"result":"ok",…}
That leaves two ways to cover Claude Code:
Native, per provider (like Codex): add "goal" to Claude Code's composerActions, map local_command_run.command === "goal" to goal state, and implement thread/goal/clear. Small on the input side. The catch is state: Claude Code emits nothing for progress or completion, so the card could only go from active to cleared, never to complete. The goal card is also keyed to provider-codex/goal today, so this needs a provider-neutral goal state; a thread/goal/updated event type exists (
Server-owned, as this issue proposes: one implementation for every provider, with bb owning the instruction block and the done state. Two things to decide: how bb detects "done" without a provider signal, and what to send Codex, whose app-server treats a literal /goal … line as a native goal.
#3411 mentions a local prototype with native Codex goal create/resume/clear and asks whether that should be split under this issue; whichever direction you pick here answers that too.
Which direction do you want? I can build either one.
Activity
mistakeknot commentedon Sep 23, 2026
Evidence that might help decide scope. Tested at
main@ 9b8c1d3 with Claude Code 2.1.280.Why
/goaldoesn't show for Claude Code threads today. The send-menu Goal action comes from each provider'scomposerActions, and the/typeahead lists only built-ins, skills, and.claude/commandsfiles, so neither surface offersgoalfor Claude Code.["plan"]:bb/plugins/provider-claude-code/server.ts
Line 74 in 9b8c1d3
["plan", "goal"]:bb/plugins/provider-codex/server.ts
Line 70 in 9b8c1d3
bb/apps/server/src/services/providers/plugin-provider-registration.ts
Lines 137 to 153 in 9b8c1d3
threadGoalClear: false, so the goal card's clear action can't work for it:bb/plugins/provider-claude-code/src/bridge/bridge.ts
Line 1982 in 9b8c1d3
How Codex goals work today. bb passes the
/goal …text to codex app-server unchanged (bb/plugins/provider-codex/src/session-params.ts
Lines 563 to 580 in 9b8c1d3
thread/goal/updatedandthread/goal/clearednotifications, which carry objective, status (active | paused | budgetLimited | complete), and budget (bb/plugins/provider-codex/src/delta-translation.ts
Lines 1089 to 1112 in 9b8c1d3
bb/packages/domain/src/thread-timeline-goal.ts
Lines 3 to 19 in 9b8c1d3
provider-codex/goalextension kind (bb/apps/server/src/services/threads/thread-runtime-display.ts
Lines 404 to 407 in 9b8c1d3
bb/packages/agent-runtime/src/runtime-thread-goal-state.ts
Lines 64 to 71 in 9b8c1d3
Claude Code has a native
/goalin headless mode, and bb already passes it through. Repro:init.slash_commandsincludesgoal.model: "<synthetic>") with textGoal set: reply with the single word okand a structuredlocal_command_run: {"command":"goal","args":"reply with the single word ok"}, so the objective is available without parsing text.success. I saw no goal progress, completion, or clear event in the stream; only the set is observable.--input-format stream-json), which is how bb's SDK session sends turns (bb/plugins/provider-claude-code/src/bridge/sdk-session.ts
Lines 300 to 307 in 9b8c1d3
/plan, and only in plan mode (bb/plugins/provider-claude-code/src/session-params.ts
Lines 202 to 213 in 9b8c1d3
/goal …in a Claude Code thread today most likely sets a native goal that bb can't show or clear./goal clearemits.Trimmed stream-json output
That leaves two ways to cover Claude Code:
"goal"to Claude Code'scomposerActions, maplocal_command_run.command === "goal"to goal state, and implementthread/goal/clear. Small on the input side. The catch is state: Claude Code emits nothing for progress or completion, so the card could only go from active to cleared, never tocomplete. The goal card is also keyed toprovider-codex/goaltoday, so this needs a provider-neutral goal state; athread/goal/updatedevent type exists (bb/packages/domain/src/provider-event.ts
Lines 526 to 540 in 9b8c1d3
bb/packages/domain/src/legacy-thread-events.ts
Lines 68 to 90 in 9b8c1d3
/goal …line as a native goal.#3411 mentions a local prototype with native Codex goal create/resume/clear and asks whether that should be split under this issue; whichever direction you pick here answers that too.
Which direction do you want? I can build either one.