TruthGuard: Shell Script Hooks That Catch AI Coding Agent Lies

What TruthGuard Does
TruthGuard is a free, open-source tool built with Claude Code for Claude Code users. It addresses a documented problem where Claude Code makes false claims like "Done! All tests pass!" when tests were never run, or "I updated the file" when the file remains byte-for-byte identical. The creator notes that system prompts don't fix this issue—Claude ignores text instructions when it "decides" something is done.
What It Catches
- Phantom edits - Agent says "file updated" but SHA256 before and after is identical
- Exit code lies - Tests fail with exit 1, agent says they passed
- Dangerous shortcuts - Blocks
--no-verifyand--force push. Warns onreset --hardandclean -f - Commits without tests - Auto-detects your test framework, runs tests before every
git commit. Fails? Commit blocked - "Done" without checking - After each commit, makes the agent stop and confirm the fix actually works before moving on
How It Works
Pure shell scripts plugged into Claude Code's hook pipeline. No backend, no API calls—just jq and bash. The workflow: Agent decides to edit a file → [PreToolUse] records SHA256 checksum → Agent edits the file → [PostToolUse] compares checksums → BLOCKS if unchanged. The agent can't argue with this—it's not a prompt it can ignore, it's a programmatic gate.
Dogfooding Results
After 2 days on a production Flutter project:
- 5 commits blocked because tests were failing
- 3 dangerous commands blocked (2x
--force push, 1x--no-verify) - 0 false positives - every block was a real problem
The pre-commit test hook alone kept the creator from shipping broken code five times in two days.
Installation
npx truthguard install && npx truthguard init
Or: brew tap spyrae/truthguard && brew install truthguard
Works with Claude Code and Gemini CLI. Same scripts for both—they're agent-agnostic (JSON in, JSON out).
📖 Read the full source: r/ClaudeAI
👀 See Also
ClaudeAI Brainstorming Mode Gets Visual Companion for Mockups and UI Approval
A user discovers a new 'Visual companion' feature in ClaudeAI brainstorming mode that serves mockups on a local web server, enabling back-and-forth UI tweaks before building.

Benchmarking 88 Small GGUF Models on a 16GB Mac Mini M4
An automated pipeline tested 88 GGUF models on a Mac Mini M4 with 16GB RAM, identifying 9 as unusable and 4 LFM2-8B-A1B MoE models on the Pareto frontier for speed and quality.

Context Routing Layer Reduces Claude Code Token Usage by Tracking Accessed Files
A developer saved approximately $80 per month on Claude Code usage by adding a context routing layer that prevents the AI from re-reading the same repository files on follow-up turns. The tool tracks what files have already been accessed to reduce redundant token consumption.

Community patch adds RTL language support to Claude Desktop on Windows
A developer has created a patch that adds proper right-to-left language support to Claude Desktop on Windows, fixing broken rendering for Hebrew, Arabic, and other RTL languages. The patch injects RTL detection logic into the Electron app's renderer and includes backup/restore functionality.