[PR #5] Two Gaps Where a Test Failed and Nobody Could See It
- What changed: Two gaps in the gate that runs tests when a response ends (a timeout, and a notice that did not show on screen) were found and fixed.
- Decision: A gap where the user sees nothing and has no response was treated as critical and fixed first.
- Still unknown: The exact reason the desktop app does not draw the notice on screen was not confirmed.
Claude had built a hook (the verify-gate hook) for me that runs a test command at the moment the AI is about to finish a reply, and blocks finishing if the test fails. I asked for an investigation into whether it was actually in effect. Checking that something runs turned out to matter as much as building it.
What I did and why
Midway through, my authentication expired (401 OAuth access token has expired) and the work stopped, so I picked it up the next day.
Here is Claude’s conclusion. The hook was configured exactly as the official docs describe, and the session records showed it ran four times with no errors. There was no setting turning it off and no other hook overlapping it. But there were two paths where a test could fail and the user would see nothing.
- Timeout. If the verification command runs past 600 seconds (the hook’s time limit), Claude Code cancels the hook and finishes without any message.
- The alert is not visible. When a failure continued after one block, the hook finished with only an app alert (
systemMessage), and on my desktop app screen that alert did not actually appear. Claude found it in the session record, and reproduced that Claude Code does emit the alert. Why the app does not draw it, Claude could not confirm.
By the “failure-case table” standard I had set in CLAUDE.md, these two paths count as critical gaps, where the user sees nothing and there is neither a response nor a test.
What Claude changed
- The check script (
verify-gate.ps1)- It now stops the verification command by itself at 540 seconds. After it also ends any subprocesses the test started, it blocks with “stopped because it exceeded the time limit (540 seconds)”. It waits for the output to close rather than for the process to exit, so the hook does not hang even if a program is still holding the output.
- If the test still fails after one block, it allows finishing only when Claude’s last reply contains ‘검증 실패’ (verification failed). If not, it blocks again, telling Claude to stop fixing and report the failure. The point is to make the failure appear in the body of the reply, which the user is sure to see. Claude kept the app alert as a backup.
- The settings file (
settings.json). Claude wrote"timeout": 600explicitly (the same as the default). The script’s 540 seconds must stay below this value. - CLAUDE.md. Claude changed “whenever work ends” to “whenever a reply ends” and corrected the description of what happens on failure. It also added a note to chain several commands with
&&, not;. With;, a failed earlier command still counts as a pass if the last command succeeds.
The options I chose and the ones I dropped
- I asked to apply all three recommendations from the investigation (test that it really blocks, correct the CLAUDE.md wording, fix the timeout gap).
- Getting the app to draw the alert would be a change on the app’s side, which cannot be done from here. Claude offered options, and instead of trusting the alert, I chose to force Claude to write the failure into the body of its reply.
How I checked
- Standalone checks Claude ran (15 cases in a temporary git repository, all as expected). No file passes, success passes, failure blocks (Korean text displays correctly), failure after a block with no ‘검증 실패’ in the reply blocks again, with it allows, a first failure blocks once even if the phrase is present, a timeout (shortened to three seconds in a copy) blocks in about four seconds with zero processes left behind, and a leftover process holding the output blocks in nine seconds, among others.
- Three real Claude Code sessions. Claude used a temporary
verify-commandthat deletes itself.
| Round | Situation | Result |
|---|---|---|
| 1 | First failure | Blocked, told to fix it or report ‘검증 실패’ |
| 2 | No ‘검증 실패’ in the reply | Blocked again, told to stop fixing and report |
| 3 | ‘검증 실패’ in the reply | Allowed to finish. The temporary file deleted itself |
In the first test, the round number was missing from the output. That was not a hook problem. It was a mistake in the test command Claude wrote, where PowerShell read $n회차 as one whole variable name.
What I did not do this time
- Skipping the check in plan mode or for simple Q&A. There is no test command yet, so there is nothing inconvenient.
- Preparing for environments where git cannot be found. It works on my Windows computer and I do not plan to use another environment.
What is left and what I learned
- Not confirmed: the exact reason the desktop app does not draw the alert.
- Once a real test command exists, it is written in
.claude/verify-commandto turn the hook on. Until then this hook does nothing. - Not just trusting a tool’s report that “it works”, but separately checking that it actually shows up on the user’s screen, was the heart of this investigation.