7 min read

H29
Playbook · Agent UX & Human Interaction

Terminal & CLI Agent UX

In a terminal, the approval prompt is the safety control and the thing blocking all work. That is one channel too few.

Anthropic's own figure for Claude Code is that users approve roughly 93% of permission prompts — a number that describes the medium, not the users, because in a TTY the prompt occupies the only input stream the agent and the human share. Stop writing scarier copy and split the two questions the prompt conflates: what the agent is able to do, and when it has to ask.

Step 1A graphical agent has three surfaces. A terminal agent has one.

In a web or desktop product, an agent that needs consent has somewhere to put the question that is not the place work happens: a modal over a still-visible diff, a side panel, a toast, a notification that survives the user looking away. The work and the question occupy different pixels, so the user can read one while the other waits.

A terminal agent has stdin, stdout, and whatever the TUI repaints over them. When it asks, it stops; when it stops, the scrollback above the prompt is the only context the user has, and the prompt itself is the only thing they can interact with. Three consequences follow mechanically, and none of them is a bug you can fix in the prompt text:

  • Every question is blocking. There is no "ask later" lane, so the cost of a question is the whole session's latency, not a glance.
  • The question competes with its own evidence. A long diff scrolls the prompt off-screen or the prompt pushes the diff off; the user approves what they can still see.
  • The answer space is a selector. Integrators report Claude Code's tool-permission dialog as Yes / Yes-and-don't-ask-again / No with no free-text field — which is the right call for a TTY, and it means "do it, but differently" has no expressible form.

Those three are the whole brief for this page. Everything below is a way of spending less of a channel you only have one of.

Step 293% is a measurement of the medium. Treat it that way.

A 2026 study of Claude Code's design space cites Anthropic's own number: users approve approximately 93% of permission prompts. The tempting read is that users are careless. The structural read is better supported: a control that fires on the common case, blocks all progress while it waits, and has an overwhelmingly correct answer will be answered with that answer reflexively, by anyone, after about a day.

The confirming detail is what Anthropic did about it. The response was not a redesigned warning — it was sandboxing and auto-mode classifiers, i.e. defining a boundary inside which the agent does not have to ask. That is a vote that the prompt count is the defect, not the prompt wording.

So the metric to put on your dashboard is not approval rate. It is prompts per completed task, and the direction is down. An approval rate that climbs toward 100% as prompts-per-task rises is not a trust signal; it is the same event seen twice.

If your product's safety story is "the user confirms destructive actions", and your prompts-per-task is in double digits, you do not have a confirmation step — you have a keystroke the user has learned. The approval artefact you emit will faithfully record a human who was not reading.

Step 3Split the two questions: capability, then interruption.

The single most useful structural idea in the current CLI agents is the one Codex CLI makes explicit as two separate settings: sandbox_mode, which decides what the agent is able to do at all, and approval_policy, which decides when it has to ask. A prompt that exists because the harness has no way to make an action safe is a different object from a prompt that exists because the user wants to be told.

Once the axes are separate, most prompts disappear into the first one. Reads inside the working tree, directory listings, builds and tests write only where the sandbox already permits writes, so they need no question. Network egress, writes outside the working tree, and anything that leaves the machine are the residue — and they are residue precisely because a sandbox cannot make them safe without also making them useless.

# The shape to aim for: the sandbox is the policy,
# the prompt is the exception.
sandbox:
  write:  ["./", "$TMPDIR"]        # no prompt, ever
  read:   ["./", "~/.config/app"]
  egress: ["registry.npmjs.org"]    # allowlist, not a question

ask_when:
  - write_outside_sandbox            # cannot be made safe
  - egress_to_unlisted_host          # cannot be made safe
  - git_push | publish | deploy      # reversibility is the reason

The third group is the interesting one. git push is sandboxable in principle; you ask about it because it is hard to undo, not because you cannot contain it. Keeping that group explicitly labelled reversibility rather than safety is what stops it growing: a reviewer can argue about whether an action is reversible, and making it reversible is a way to delete the prompt rather than reword it.

Step 4Budget interrupts like you budget latency.

Give the question count a number and the design decisions make themselves. Take a 200-step session — ordinary for a refactor — with a prompt every sixth step and twelve seconds of human attention per prompt:

prompts      = 200 / 6            # 33
attention    = 33 * 12            # 396s ~ 6.6 min of pure waiting
rubber_stamp = 33 * 0.93          # 31 approvals that carried no decision
# decisions actually made: ~2 out of 33 interruptions

Six and a half minutes of a human's attention bought two decisions. Worse, the 31 reflex approvals are what trained the reflex that will also approve the 32nd. A defensible budget is roughly five prompts per session, each one a decision you would defend in a postmortem; everything else moves into the sandbox or into a reversible action. If you cannot get under that, your sandbox is too narrow, not your users too impatient.

The same arithmetic prices the "yes, and don't ask again" option. That option is not a convenience — it is the user permanently editing your policy under time pressure, at the moment they are least able to evaluate it. Scope it to the narrowest thing that makes the current session finish (this command shape, this path, this session), never to the tool, and show the resulting rule in one line so the grant is reviewable later.

Step 5Design the question so a selector can answer it.

Because the answer space is a selector, the question has to be one a selector can settle. The common failure is to ask a yes/no question whose honest answer is "do something else" — Run rm -rf build/ dist/ .cache/? invites a user who wanted only build/ removed to answer No, lose the turn, and re-steer in prose. Two fixes, in order of preference.

Narrow the proposal until yes is the whole answer. Ask about rm -rf build/, act, and ask again if the next one is genuinely needed. Three narrow questions the user answers correctly beat one broad question they answer wrongly, even though it is three interruptions — which is the one place the step-4 budget should lose an argument.

Make the third option a real one. If "no" is going to be followed by prose anyway, say so in the option: No — tell me what to do instead, which hands the turn back without the user guessing whether the agent is still running. Silent "no" into a blocked loop is the worst outcome available in a TTY, because the user cannot tell refusal from hang.

And show the thing being approved in the same frame as the question. A prompt that scrolls its own diff off the screen is an auto-approval mechanism with extra steps: truncate the preview to what fits above the prompt, state the truncation, and offer the full view as a choice rather than making it the default.

Step 6The scrollback is not a record. Emit one.

Teams reach for the terminal partly because it feels auditable — everything is right there in the buffer. It is not. A TUI repaints, spinners overwrite, long outputs are truncated by the renderer before they reach the buffer, the buffer has a finite scroll limit, and closing the window destroys all of it. The one surface that looks like a log is the one you cannot produce in an incident.

So write the record out of band, in the same commit as the feature: for every gated action, the exact command or payload, its digest, the rule that required the prompt, the option the user chose, and the resulting grant scope. That file is what makes a retrospective possible, and it is also the dataset that tells you your prompts-per-task number. The two reasons to build it are the same artefact.

One more terminal-specific trap: resumption. --resume rebuilds a session from a transcript the user cannot see, so a grant made in the earlier session may silently still apply. Print the inherited grants on resume, in one line each. A permission the user cannot see is a permission they did not give — and in a single-channel medium, printing it is the only way to show it.

Do this first: instrument prompts-per-completed-task for a week, then sort the prompts by frequency. The top three are almost always reads or in-tree writes that belong in the sandbox, not questions — delete them and you will recover most of the human attention your product is currently spending on nothing. Only then argue about the wording of what is left, and keep the remainder under five per session with a written reason for each: cannot be contained or cannot be undone. Any prompt whose reason is neither is a prompt you are keeping out of habit.