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

Claude Pulse Browser Extension Surfaces Token Counts, Cache Timers, and Rate Limits on Claude.ai
Claude Pulse is a client-side Chrome extension that adds a real-time dashboard to Claude.ai showing per-message token counts, total context usage, prompt cache expiry timer, and rate limit progress bar. Also includes chat export to Markdown.

PRECC Tool Cuts Claude Code API Costs with Pre-Tool-Call Compression
A developer built PRECC, an open source tool that intercepts Claude Code tool calls and compresses payloads using RTK (Redundancy-aware Token Kompression), reducing input tokens by 40-66% with no perceptible latency impact.

Windows System Tray App for Real-Time Claude API Usage Monitoring
A developer built a lightweight Windows tray application that displays Claude API quota usage in real time, including 5-hour and 7-day windows, today's token counts, and depletion forecasts. The app supports Korean, English, Chinese, and Japanese UI and is open source on GitHub.

Claude-Powered MCP Tool Generates Interactive HTML Components Without Build Tools
A developer built daub.dev, a system where Claude drives an MCP server to produce styled, interactive HTML UI components from natural language descriptions without React, bundlers, or build pipelines.