Skip to content

User Checks

xsyetopz edited this page Oct 16, 2026 · 1 revision

User Checks

This page describes the usercheck slice of the core plugin claudetto. It is for a user who wants a check that only the user can run to come with the exact command, and for a contributor who edits the slice.

The Problem

A permission check can deny a call, for example in auto mode. The work can then have a check that only the user can run. A reply that says "run the check" and gives no command makes the user find the command. The verification section of the prompt tells Claude to give the exact ! command. A prompt is the weakest control, so the slice adds a hook.

What the Hooks Do

  1. The classic.PermissionDenied hook keeps each denied call of the session. For a Bash call, it keeps the first line of the command. For another tool, it keeps the name of the tool.
  2. The classic.Stop hook reads the reply (last_assistant_message). When the session has denied calls and the reply has no ! command, the hook blocks the stop one time. The reason names the denied calls and asks Claude for the exact ! command, or for one sentence that says that the work does not need the call.
  3. Each Stop clears the denied calls. A stop that is a continuation of a block (stop_hook_active) is not blocked. For this reason, a denial gives at most one block.

How It Finds a ! Command

The hook reads the Markdown syntax of the reply, and not its words, so it works in each language of the reply. A ! command is a code item that starts with !, such as `! just sandbox > /tmp/out.txt 2>&1`, or a line in a code block that starts with !. A ! outside code is not a command.

Cost

The hooks make no model call. A block costs one more model response, and only in a turn with a denied call and no ! command.

Bounds

Bound Value File Use
MAX_NAMED_CALLS 5 slices/usercheck/limits.ts Most denied calls that one reason names
MAX_CALL_CHARS 200 slices/usercheck/limits.ts Most characters of one denied call in the reason

Related Pages

  • Guards: the hooks that ask or deny before a call.
  • Prompt: the verification section of the prompt.
  • Architecture: the slices of the core plugin.

Clone this wiki locally