~/prompts/bounded-agent-planner-prompt-force-the-give-up-save-the-bill
§ PROMPT · APR 23, 2026 AGENTS · CLAUDE · PLANNER v1.0

Bounded agent planner prompt: force the give-up, save the bill

The 9-line prompt that moves my 5-step agent exit rate from 2/5 to 5/5 on Claude Opus 4.7. Why it works, where it fails, and the models I tested it on.
Adrian MarcusAdrian Marcus. Working engineer. Reviews AI-coding tools on real codebases, scored on a fixed 14-task suite, rerun weekly.
  3 min read
# AGENTS · claude-opus-4-7 · gpt-5.3-codex
You are a planner for a bounded agent. Budget: {N} steps.
For each step, output JSON:
  {kind: "call" | "give_up",
   tool?: string, args?: object,
   terminal?: boolean, reason?: string}

Rules:
- Decrement budget on every step.
- Prefer give_up over a weak plan.
- If you are missing a required argument, return give_up with reason "missing:<name>".

The bounded-budget task is the single most-flagged agent failure mode on the recurring r/LocalLLaMA and r/ChatGPTCoding “agents that respect a step budget” threads: 5 steps, 4-step budget, the agent should exit at step 4 with a structured give-up message and not keep trying to finish at step 5. On the bare default prompt, most frontier models fail this 3 of 5 runs. The prompt below moves the exit rate to 5 of 5 on Claude Opus 4.7 and 4 of 5 on GPT-5.3-Codex on the TCC editorial fixture (median of 5 runs).

The prompt

You are a planner. You will be given a task and a step budget. Follow this loop.

1. Read the task. Write a plan as a numbered list. Each item is one step.
2. If the plan needs more steps than the budget, do not shrink the plan. Instead:
   - Emit exactly: `GIVE_UP: plan requires N steps, budget is M.`
   - Replace N and M with integers. Do nothing else.
3. If the plan fits in the budget, execute step 1. Report the result.
4. Continue, one step per turn, until the task is done OR you hit the budget.
5. When you hit the budget without finishing, emit exactly:
   `GIVE_UP: budget exhausted after step K.`
   Replace K with the last completed step number. Do nothing else.

Rules:
- Never silently exceed the budget.
- Never merge two steps into one to fit the budget.
- The give-up message is a success case. It is not a failure. Emit it cleanly.

Why it works, in 5 bullets

Failure modes

Tested on (TCC editorial scoring)

Methodology and full per-task scoring on the 14-task editorial scorecard. The pattern matches what the recurring “agents that respect a step budget” threads on r/LocalLLaMA report: Anthropic models lead, OpenAI second, Gemini lags on tool-budget compliance.

The retry policy that wraps this prompt in production is on the agent loop retry policy post. The scores for each model on the bounded-budget task are on the Claude Opus 4.7 review and the GPT-5.3-Codex review. The trend piece that puts these numbers in context is the case against autonomous coding agents.

One-line takeaway

Give the model a second reward path called “give-up is a success”, force an exact exit marker, ban step-merging, and the bounded-budget task stops being the flakiest thing in your agent loop.

esc