Repository navigation
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.
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.
- The
classic.PermissionDeniedhook keeps each denied call of the session. For aBashcall, it keeps the first line of the command. For another tool, it keeps the name of the tool. - The
classic.Stophook 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. - Each
Stopclears 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.
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.
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.
| 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 |
- Guards: the hooks that ask or deny before a call.
-
Prompt: the
verificationsection of the prompt. - Architecture: the slices of the core plugin.
- Start
- How claudetto Works
- Add-On Plugins
- How Claude Code Works
- Reference
- Rationale
- Evidence
- Development
- Archive