Stop the Endless "Shall I Continue?" Pauses in Your Coding Agent

APIFreeKeyAnthropic · Updated 2026-11-22 · 9 min read

Robot waiting at a door with a clipboard, a metaphor for an agent asking permission
Agents often stop to ask even when the plan was already approved.

You hand a coding agent a clear plan, walk away for coffee, and come back to find it waiting politely: it finished one file, summarised what it would do next, and asked for your go-ahead. A frequent complaint after newer model releases is exactly this: the assistant keeps checking in, even when the instructions already said to finish the job. Other people report the opposite problem, an agent that runs on for an hour and rewrites things nobody asked it to touch.

This article is for students, hobbyists and solo builders who drive agents through an API or a CLI tool and want the agent to keep going for the right amount of time. You will learn why models pause, which pauses are useful safety brakes and which are just habits, and how to write instructions, tool settings and checkpoints that let a run finish without babysitting. The ideas apply to Claude-based agents and to open models such as free-ai alike.

Frequently asked questions

What is a permission loop in an AI agent?

It is a pattern where the agent completes a small piece of work and then stops to ask whether it should continue, instead of executing the rest of an already approved plan. Each pause ends the turn, so nothing happens until a human replies.

Is the model being lazy when it asks to continue?

Not really. Models are trained to be careful with actions that change files or systems, and long autonomous runs are where costly mistakes happen. Asking is a cautious default; it becomes a problem only when your instructions already granted permission and the agent ignores that.

How does a confirmation prompt differ from a real error?

A real error means a tool failed, a test broke or the model lacks information. A confirmation prompt arrives when nothing went wrong: the agent simply wants approval. Logging tool results lets you tell the two apart quickly.

Which is better: full autonomy or frequent check-ins?

Neither in general. Read-only exploration and edits inside a version-controlled folder can run freely, while deleting data, spending money or touching production should pause. The best setup grants autonomy per action type, not globally.

Do newer models pause more often than older ones?

Behaviour shifts between versions, and some users notice more check-ins after an upgrade. Vendors tune models for safety and honesty about progress, which can show up as more frequent status reports. Test your own prompts on each release instead of assuming.

Can a system prompt alone stop the pauses?

It usually helps a lot, especially when it states which actions are pre-approved and what counts as done. It is not a guarantee; combining it with an outer loop that answers routine questions automatically is more reliable.

Does an open model like free-ai behave the same way?

It has its own habits. As a roughly 35B open-weight model tuned to refuse less, it tends to proceed rather than ask, but it is also less precise on long multi-step plans than top commercial models, so checkpoints still matter.

Step by step

  1. Define done — Write one sentence that describes the finished state, such as all modules refactored and tests passing.
  2. List pre-approved actions — Name the actions the agent may take without asking and the ones that always require a stop.
  3. Add end markers — Ask the agent to end with DONE or NEED_HUMAN so your loop can tell a finish from a pause.
  4. Wrap with a nudge loop — Reply automatically to routine pauses a limited number of times, then hand over to a human.
  5. Set checkpoints and commit — Stop deliberately at module boundaries, review the diff and commit before letting the agent continue.

What a permission loop looks like in practice

The typical transcript is easy to recognise. You ask for a refactor across six modules. The agent reads the code, edits the first module, then writes a neat paragraph: what it changed, what it plans next, and a closing line such as "Let me know if you'd like me to proceed." In an interactive chat that is harmless. In a scripted run, where your code calls the API in a loop and only continues while the model requests tools, that final sentence ends the run.

The cost is not only time. Every resumed turn resends the whole conversation, so three unnecessary pauses on a long task can add a noticeable slice of input tokens. When you are on a small credit balance or a free daily quota, that matters.

The polite stop

The model ends with a question and no tool call. Your loop sees a normal finish reason and exits, believing the job is complete.

The plan recital

Instead of acting, the agent restates the plan in more detail and asks you to confirm it, even though you wrote the plan yourself one message earlier.

The partial batch

Given twenty items to process, it handles three, shows the results as a sample, and asks whether to continue with the rest.

Why models stop and ask

Assistant models learn from feedback that rewards checking in before risky actions. That is a sensible lesson: an agent that silently deletes a branch is worse than one that asks. The trouble is that the model cannot always tell a risky action from a routine one, especially when the prompt never says which is which.

Model updates also shift the balance. Release notes for agentic models often stress more honesty about progress and longer independent work, and these goals pull in different directions. An agent that is honest about uncertainty may report more often. When a new version feels chattier than the last, it is usually this trade-off rather than a bug.

Ambiguous scope

"Clean up the project" has no clear end. A model asked to do something open-ended will often stop early because it has no way to know when to finish.

Hidden stakes

If tools can run shell commands, the model knows that some commands are destructive. Without explicit guidance it treats every step as potentially dangerous.

Railway signals along a track representing checkpoints
Deliberate checkpoints work better than stopping after every step.

Write instructions that grant permission explicitly

The cheapest fix is a short block in the system prompt that answers the questions the agent would otherwise ask. Spell out what is pre-approved, what requires a stop, and what the finish line is. Models follow concrete lists far better than general encouragement like "be autonomous".

Keep the list honest. If you pre-approve everything, you lose the brake that protects you from a bad command. A good split is: reading, searching, editing files tracked by git and running tests are allowed; deleting untracked files, installing global packages, network calls to unknown hosts and anything touching credentials need a stop.

  • Pre-approved: read any file in the repository, run the test suite, edit tracked files, create new files under src/ and tests/.
  • Stop and ask: deleting files, changing CI configuration, adding dependencies, any command that uses sudo or touches secrets.
  • Done means: all listed modules refactored, tests pass, a final summary written. Do not ask whether to continue between modules.
  • If blocked: write what is missing in one sentence and stop; do not guess credentials or invent data.

Build an outer loop that answers routine questions

Even with a good prompt, some pauses slip through. A small wrapper can detect a turn that ends without a tool call but with an unfinished checklist, and reply automatically with a fixed nudge. This keeps a human out of the loop for trivial confirmations while still stopping for real questions.

The example below uses the OpenAI-style client against the keyless endpoint of this site, which is a convenient place to test the pattern without spending credit. It is a sketch, not a full agent: the important part is the decision about when to nudge and when to stop for real.

Use explicit end markers

Asking the model to end with a fixed token such as DONE or NEED_HUMAN turns a fuzzy judgement into a simple string check that your code can trust most of the time.

Cap the nudges

Limit automatic replies to a handful of turns. If the agent still has not finished, something is wrong with the task or the plan, and a human should look.

from openai import OpenAI

client = OpenAI(base_url="https://api.apifreekeyanthropic.com/v1", api_key="none")

SYSTEM = ("You are a coding agent. Pre-approved: reading files, editing tracked files, "
          "running tests. Do not ask whether to continue between items. "
          "When every item is done, end your message with the line DONE. "
          "If you truly need a human decision, end with the line NEED_HUMAN.")

messages = [{"role": "system", "content": SYSTEM},
            {"role": "user", "content": "Rename the helper get_cfg to load_config in modules a, b and c. Show each edit."}]

for turn in range(6):
    reply = client.chat.completions.create(model="free-ai", messages=messages, max_tokens=1500)
    text = reply.choices[0].message.content or ""
    messages.append({"role": "assistant", "content": text})
    if text.strip().endswith("DONE") or text.strip().endswith("NEED_HUMAN"):
        break
    # Routine pause: nudge once per turn instead of waking a human.
    messages.append({"role": "user", "content": "Approved. Continue with the remaining items without asking."})

print(messages[-1]["content"])
Checklist on a desk with ticked items
A clear definition of done removes many unnecessary pauses.

Checkpoints beat blanket autonomy

The opposite failure, an agent that never stops, is just as expensive. Long unattended runs drift: an early wrong assumption gets baked into every later edit. Rather than choosing between constant pauses and none at all, design deliberate checkpoints where the agent stops on purpose, ideally at natural boundaries such as a passing test suite or a finished module.

A checkpoint should produce something you can review in a minute: a diff summary, test output, and a list of open questions. Commit at each checkpoint so a bad stretch can be rolled back cheaply. With that safety net, you can safely give the agent more freedom between checkpoints.

Time or step budgets

Tell the agent it has, for example, ten tool calls before it must report. Budgets keep runs bounded without forcing a stop after every action.

Test-gated progress

Let the agent continue only while tests pass. A failing test is a natural moment to stop and summarise rather than plough on.

Tool settings matter as much as prompts

Many CLI agents and IDE extensions have their own approval modes, separate from anything the model decides. If the tool is set to require confirmation for every file write, no prompt will remove those pauses. Check the agent's settings for allow-lists of commands and directories, and prefer granting narrow permissions over a single "auto-approve everything" switch.

Sandboxing is the other half. Running the agent inside a container or a throwaway clone of the repository lets you approve far more actions without worrying about your real files. See our guide on surviving breaking changes in AI dev tools for why pinning those tool versions also keeps approval behaviour stable.

Narrow allow-lists

Approve specific commands such as the test runner and the linter by name, and specific folders for writes. A wildcard approval is convenient until the day it runs the wrong script.

Toy excavator inside a glass terrarium as a sandbox metaphor
Sandboxing lets you approve more actions safely.

When the pause is the right call

Some questions deserve a human. If the agent discovers that the task conflicts with existing behaviour, that the tests themselves look wrong, or that finishing would require a dependency you did not approve, stopping is correct. Train yourself to read the reason for each pause before nudging it away.

This is also where commercial frontier models tend to shine. Top Claude models are generally better than a mid-size open model at noticing that a plan is flawed before acting on it. If your agent tasks involve subtle architecture decisions, paying for the stronger model may save more time than any prompt trick. Note that this site is not affiliated with Anthropic, and free-ai is an independent open-weight model, not a Claude model.

Good reasons to stop

Conflicting requirements, missing credentials, destructive operations, ambiguous acceptance criteria and failing tests the agent did not cause.

Testing agent behaviour without burning credit

Tuning an agent prompt takes many short runs, and each run on a paid model costs money. A practical approach is to iterate on the control flow, the end markers and the nudge logic against a free endpoint first, then do final validation on the model you will actually use. The keyless API on this site gives each IP 10,000 requests or 10,000,000 tokens a day, with one request per second and two in parallel, which is plenty for loop experiments.

Keep in mind that behaviour does not transfer perfectly. An open model may pause less but also follow complex plans less exactly. Treat free runs as tests of your plumbing, and re-check prompt wording on the target model. Our article on one giant prompt versus small steps covers how to split work so each step is easy to verify, and why agent benchmarks contradict model rankings explains why your own small test set beats leaderboard claims.

Stone cairns marking a mountain trail
Review points along the way keep long runs from drifting.
Try the free API

Send a first prompt from the chat box on the home page: no key, no account and no card, just your browser.

Read also