Coding prompts · Prompt
Audit silent failures (prompt)
audit-silent-failures-prompt
A prompt that hunts for errors your code hides - empty or broad catch blocks, log-and-continue handlers, quiet fallbacks and default values, optional chaining that skips work, retries that give up silently - and ranks each with the errors it could hide and a fix. Use when the user asks why a bug left no trace, wants error handling reviewed, or worries a fallback masks failures.
Works with: Any AI Not yet model-tested; testing Jan 2027
Paste it into ChatGPT, Claude, Gemini or any AI chat, then tell it about your project. How it works
Install in Claude Code, Cursor or Codex (optional)
Only for AI coding tools that read skill folders. Run one line in a terminal, in your project folder. It downloads this skill's text files from TheSkillVault and nothing else; you can read them first with “View raw SKILL.md”.
Claude Code (all your projects)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/raw' -o ~/'.claude/skills/audit-silent-failures-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/LICENSE.txt' -o ~/'.claude/skills/audit-silent-failures-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/NOTICE.txt' -o ~/'.claude/skills/audit-silent-failures-prompt/NOTICE.txt'Cursor (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/raw' -o '.cursor/skills/audit-silent-failures-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/LICENSE.txt' -o '.cursor/skills/audit-silent-failures-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/NOTICE.txt' -o '.cursor/skills/audit-silent-failures-prompt/NOTICE.txt'Codex and other Agent Skills tools (this project)
curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/raw' -o '.agents/skills/audit-silent-failures-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/LICENSE.txt' -o '.agents/skills/audit-silent-failures-prompt/LICENSE.txt' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/audit-silent-failures-prompt/files/NOTICE.txt' -o '.agents/skills/audit-silent-failures-prompt/NOTICE.txt'
Or connect the whole library over MCP
Add TheSkillVault to Cursor or add this to your app's MCP settings (read-only; help):
{
"mcpServers": {
"theskillvault": {
"url": "https://theskillvault.ai/mcp"
}
}
}The worst bugs are the ones that leave no trace. A catch block swallows an error, a fallback returns an empty list, and nobody finds out until a customer does. This prompt makes the AI look only at how your code handles failure.
When to use
- A bug showed up in production but nothing was logged and no one was told.
- You just added try/catch blocks, retries, fallbacks or default values and want them checked.
- An AI agent wrote error handling for you and you suspect it hides problems to make things "work".
When not to use
- You want a general review for bugs, security and readability. Use review-code-prompt.
- You already have the logs from a crash and need the cause. Use analyse-error-logs-prompt.
- You want a fault found by testing hypotheses. Use debug-systematically.
Steps
- Commit your work so the diff is clean, then open the branch in your AI coding tool.
- Paste the prompt below. Change the base branch, and name your logging or error-tracking tool if you have one.
- Fix the CRITICAL findings first. Each one names the errors that could vanish.
- For every fallback the AI flags, decide whether it is intended. Write down the intended ones so the next review skips them.
- Run the prompt again on the new diff until no CRITICAL findings remain.
Prompt
Audit the error handling in this branch's changes (git diff main...HEAD). Look only at how failures are caught, reported and recovered from. Do not edit code yet.
1. List every place that handles failure: try/catch or try/except blocks, error callbacks, Result or error returns, retry loops, fallback values, defaults returned on error, and optional chaining or null checks that skip work.
2. For each one, answer:
- Is the error logged with enough context to debug it months later (operation, IDs, inputs, state)?
- Does the person using the app learn that something failed and what they can do next?
- Does the catch only catch the errors it expects? Name the unrelated errors it could also swallow.
- Is there a fallback? Was it asked for, or does it hide the real problem? Is it a mock or stub outside test code?
- Should the error go up to a caller instead of being handled here? Does catching here skip cleanup?
3. Flag these patterns every time: empty catch blocks; catch, log and carry on; returning null, empty or default values without logging; optional chaining that silently skips an operation; chains of fallbacks with no explanation; retries that run out without telling anyone.
4. Check user-facing error messages: clear words, specific to this failure, a next step, no internals leaked.
For each finding give: file and line; severity (CRITICAL = error disappears or broad catch, HIGH = unjustified fallback or useless message, MEDIUM = missing context); the hidden errors; the impact on users and debugging; and the corrected code.
Mention handlers that are done well. Ask me before changing anything.
How to adapt
- Have an error tracker such as Sentry, or a house logger? Add "errors must be reported with <function>" to step 2.
- Some fallbacks are by design, such as a cache miss or an offline mode? List them so they are not flagged.
- Not on git? Replace the diff command with the files or folders to audit.
- Go, Rust or another language with error returns? Ask it to check every ignored error value and unwrap call too.
Gotchas
- Not every catch is wrong. A handler that logs, informs the user and recovers on purpose is fine.
- The fix for a swallowed error is usually to let it fail loudly. Expect more visible errors at first.
- Logs can leak secrets. Check that new log lines do not print tokens, passwords or personal data.
Portability
Works with any language and any AI coding tool or chat AI. In a chat without repo access, paste the diff and the files it touches.
Done when
- No empty or catch-all handlers remain without a written reason.
- Every fallback is either intended and noted, or replaced with a reported error.
- Each failure path logs useful context and tells the user something they can act on.
Example prompt
"Audit the error handling in my branch for silent failures. Flag empty catches, fallbacks that hide problems and retries that give up quietly, and list the errors each one could hide."
---
Modified from the "silent-failure-hunter" agent in anthropics/claude-plugins-official (pr-review-toolkit, by Anthropic; README credits Daisy). Licensed Apache-2.0 per the LICENSE file at commit a7ba5b9. Original: https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/silent-failure-hunter.md. Changes by TheSkillVault are listed in the metadata above and in NOTICE.txt. See LICENSE.txt.
Bundled files
Licence
Adapted from Anthropic (anthropics/claude-plugins-official, pr-review-toolkit, silent-failure-hunter; the plugin README credits Daisy, daisy@anthropic.com) (Anthropic (the upstream LICENSE keeps the blank Apache template line 'Copyright [yyyy] [name of copyright owner]'; no other copyright notice at this commit). Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt), Apache License 2.0. Modified by TheSkillVault on 2026-11-04: the role-play persona, the Daisy example dialogues, the Task-tool invocation notes and the project-specific logging functions and error-ID file were removed; the five review passes were rewritten as one copy-paste prompt with a shorter severity scale, an intended-fallback check and an ask-before-editing rule; added steps, adapt notes, gotchas and done-when. Not the original file.
Licence: Apache License 2.0. Attribution when you reuse it: Based on work by Anthropic (anthropics/claude-plugins-official, pr-review-toolkit, silent-failure-hunter; the plugin README credits Daisy, daisy@anthropic.com) (Anthropic (the upstream LICENSE keeps the blank Apache template line 'Copyright [yyyy] [name of copyright owner]'; no other copyright notice at this commit). Apache License 2.0 text in LICENSE.txt, attributions in NOTICE.txt, Apache License 2.0), https://github.com/anthropics/claude-plugins-official/blob/a7ba5b93db0c7c8d17f3f1d25853adca79598a1a/plugins/pr-review-toolkit/agents/silent-failure-hunter.md; adapted by TheSkillVault, https://theskillvault.ai