Docs / How verdicts work
How Pinky reaches a verdict
Pinky is not open source. This page is the plain explanation instead: what each hook is handed, how the rules turn that into an answer, and what Pinky does when it cannot answer.
From tool call to answer
- 1. Claude Code calls the hook Before a tool runs (and at the other points listed below), Claude Code starts Pinky's hook and hands it the details as structured text. Pinky reads them; it does not watch your screen or your network.
- 2. Every rule looks at the same input A rule is a written pattern with examples it must match and examples it must leave alone. Each rule that matches adds a finding with a severity and an action: allow, ask you first, or deny.
- 3. The strictest action wins A rule can only add caution, never remove it. If one rule says ask and another says deny, the answer is deny. A rule you wrote yourself cannot weaken one Pinky ships.
- 4. Your mode decides what happens In watch mode, the default and the free tier, nothing is stopped: Pinky records what it would have done and shows it on your dashboard. Blocking needs a paid plan and your say-so, rule by rule or all at once.
- 5. Claude Code gets one answer The hook hands back allow, ask or deny with a reason in plain words. Ask means Claude Code shows you the reason and waits for your choice.
What each hook sees
Pinky registers one hook per point in a session. Each is handed only what Claude Code passes at that point.
- user-prompt-submit The prompt you just typed, the session id and the folder you are working in. Runs once per prompt you send, before Claude sees it — where session-level advisories and budget nudges attach.
- pre-tool-use The tool's name and its full input, such as the shell command, or the file path and the new text, plus the session id and folder. Runs before a tool call executes — where security rule packs and most token-saving guards attach; the only event that can deny.
- post-tool-use The same tool call and the output it returned. Runs after a tool call returns — where output auditing, redaction, and quarantine attach.
- pre-compact The session id and the location of the session transcript, just before Claude Code shortens it. Runs right before Claude Code compacts context — where handoff notes and continuity guards attach.
- stop The session id and the location of the session transcript when the session ends. Runs when a session ends — informational only, never blocking: end-of-session summaries of subagent output and background tasks.
Same input, same answer
Same input, same verdict, every time: no model, no network call and no randomness sits between the input and the answer. Pinky keeps a redacted copy of what each check saw, so a past verdict can be replayed and compared, and a test fails the build if any input to a verdict goes unrecorded.
When Pinky itself goes wrong
Pinky never blocks work because of its own failures. If a hook cannot read its input, hits an error or is
handed an event it does not know, it answers allow and writes the error to its local log, so a bug in Pinky
costs you a missed check, not a stuck session. pinkyai off --yes turns every hook to allow at once
if you ever need it.
Next: Hooks → for what runs at each point, and Rule reference → for every rule category.