- Home
- Skills
- Testing & Debugging
- Catch Silent Exit-Code Zero Failures in Agent Scripts
More screenshots
Works with the AI Agents you already use
Catch Silent Exit-Code Zero Failures in Agent Scripts
Find agent-written scripts that print failures but exit 0. Two local audit CLIs scan source, run one script, or compare CI logs; a Stop-hook template checks reports against primary evidence.
$25
Catch Silent Exit-Code Zero Failures in Agent Scripts
Example session with this skill installed
Run python3 scripts/exit_honesty_audit.py --target examples/sample_scripts --format text and tell me which scripts may print a failure but still exit 0.
- Read your context and instructions
- Compiled the catch silent exit-code
The scan covered 3 files and found 5 candidates in two scripts (status FAIL_CANDIDATES).
ExitHonestyAudit: scanned=3 | candidates=5 | status=FAIL_CANDIDATES
Findings:
- [pipeline-missing-pipefail] silent_fail_ci.sh:3: pipeline can hide an upstream failure without pipefail.
- [silent-fail-echo] silent_fail_ci.sh:4: failure text is printed without a later non-zero exit.
- [inverted-bool-return] silent_fail_pipeline.py:13: failure-reporting function returns True into a possible inverted exit gate.
- [silent-fail-return] silent_fail_pipeline.py:7: failure text is printed; verify a non-zero exit path.
- [unchecked-subprocess] silent_fail_pipeline.py:17: subprocess call has no check=True; inspect its return code.
Summary: 3 files scanned, 5 candidates, skipped empty: 0
Next steps: these are static candidates, not confirmed runtime defects. Read the referenced lines, then confirm with --exec <script> --timeout <seconds> on a safe script, or compare a real CI log with --log-file.
Connects securely to your tools. The creator never sees your data.
About this skill
For developers and SREs running Claude Code on CI checks, batch scripts, and automated workflows: catch scripts that print failures while exiting 0 before a false green reaches review.
Two zero-dependency Python audit CLIs cover file, stdin, exec, and Stop-hook entry points. Static scans return candidates to review, --exec observes a real process result, and CI log mode compares failure lines with a later success summary.
What breaks
- A script prints a failure marker and returns normally, so the interpreter exits successfully.
- A boolean is inverted at the final exit gate, making
Truemean success after a failed check. - A shell pipeline uses
set -ewithoutpipefail, or explicitly masks a command status. - Python starts a child process with
check=Falseand never examinesreturncode.
What you get
exit_honesty_audit.py: audit a Python or shell file or directory (--target), run one script with a timeout (--exec), run an explicit local command (--run-cmd), or audit a CI log from a file or stdin (--log-file).evidence_gate_check.py: check a JSON or key-value report (--report,--stdin) or a Stop event (--hook) for timestamps, commands actually run, raw output, and existing artifact paths kept separate from derived summaries.- A Stop-hook adapter, a settings excerpt, and a primary-evidence report template. The hook warns by default; add
--strictonly when blocking a session is your intended local policy. - Four guides, synthetic fixtures, and 36 regression tests (
python3 -m unittest discover tests).
Try it first
python3 scripts/exit_honesty_audit.py --target examples/sample_scripts --format text
The command is read-only and uses synthetic examples. Its exact output is in examples/expected_output.txt.
Limits
Static AST and line analysis narrows candidates where failure text appears and no non-zero exit is visible. It cannot fully resolve dynamic branches in another module or runtime exit behavior from an external command. The evidence gate checks whether reported timestamps, command evidence, and artifact paths agree; it does not establish that the tests which ran were broad or high quality. A clean scan is not a proof of correctness.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Static AST and line analysis narrows candidates where failure text appears and no non-zero exit is visible; candidates are not confirmed runtime defects. It cannot fully resolve dynamic branches in another module or runtime exit behavior from an external command, so confirm with --exec or compare a real CI log with --log-file. The evidence gate checks that reported timestamps, command evidence, and artifact paths agree; it does not establish that the tests which ran were broad or high quality, and it cannot prove a command completed successfully. Pattern matching cannot replace shell parsing, code review, process supervision, or CI's own exit status. A clean scan is not a proof of correctness.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
Python