Know when your AI assistant is guessing, before you run its code.
HalluciGuard reads the replies from Claude Code, Gemini CLI and Copilot and flags hedging, backtracking and apologies the moment they appear. Deterministic Rust regex, under a millisecond per message, no model access needed.
cargo install halluciguard❯ halluciguard watch ~/.claude/projects halluciguard 0.9.2 · platform claude-code (17 patterns) · mode file-monitor watching 3 projects, 14 sessions… 18:42:07 api-server/7f3a.jsonl chat 2 · msg 45 · 0.31ms MEDIUM uncertainty "I think the issue is with the async function" 18:42:31 api-server/7f3a.jsonl chat 2 · msg 47 · 0.29ms HIGH backtracking "Actually, let me reconsider" 18:43:02 api-server/7f3a.jsonl chat 2 · msg 49 · 0.33ms CRITICAL error_ack "Sorry for the confusion" → review the last suggestion before you run it ❯
Playground#
Paste a reply from your assistant. This runs the same rule set as the CLI, right in your browser. Nothing is sent anywhere.
How it works#
HalluciGuard sits outside the model. It sees only the text the assistant sends back, so it works with closed, hosted models you can't retrain.
Deployment modes#
Six ways to put the engine in the path of your assistant. Choose based on where you can intercept traffic, not on features: detection is identical in every mode.
| Mode | Intercepts at | When | Latency | Good for | Status |
|---|
Session viewer#
The dashboard splits each session at /clear, scores every assistant message, and shows where things started to slip. This is the debugging session from our validation study.
Pattern library#
52 rules taken from real transcripts: 306 Claude Code sessions, 7 Gemini CLI sessions (410+ lines) and five Copilot issue threads. The right library loads from the session path.
~/.claude/projects/*/*.jsonl~/.gemini/tmp/*/chats/session-*.jsonissues #281, #6885, #64858| id | Category | Example trigger | Severity | Platforms |
|---|
View patterns/claude.yaml (excerpt)
# patterns/claude.yaml · loaded when path matches ~/.claude/projects/** version: 3 platform: claude-code thresholds: uncertainty_per_1k_tokens: 3 high_at: 2 critical_at: 3 patterns: - id: uncertainty_indicators severity: MEDIUM regex: '(?i)\b(i think|maybe|possibly|probably|hopefully)\b' - id: backtracking_language severity: HIGH regex: "(?i)\bactually,? let me (try|reconsider)\b" - id: error_acknowledgment severity: CRITICAL regex: '(?i)\b(sorry for the confusion|my mistake|i apologi[sz]e)\b' - id: test_manipulation severity: CRITICAL single_hit: true # one match is enough regex: '(?i)\b(skip|disable|comment out) (the )?(failing )?tests?\b'
Benchmarks#
Measured on a standard dev workstation, no GPU. ML guard numbers are the typical range for an LLM-based classifier, shown for comparison.
Detection latency per message
Log scale, milliseconds. Lower is better.
Code quality: /clear vs continuous sessions
345 Claude Code sessions. 192 with context resets, 153 without.
| Metric | /clear | continuous | Δ |
|---|---|---|---|
| Cognitive complexity ↓ | 0.96 | 1.18 | −18.3% |
| Maintainability index | 127.4 | 119.6 | +6.6% |
| Logical LOC per block | 3.9 | 2.6 | +50% |
| Cyclomatic complexity | 1.23 | 0.92 | +34% |
| Messages per session | 134.2 | 84.1 | +60% |
| Code blocks per session | 2.7 | 2.1 | +29% |
Higher cyclomatic complexity here tracks with more complete code, not worse code.
ROI calculator#
A rough estimate for your team. Defaults use the 30 minutes saved in our validated scenario and a US fully-loaded developer rate.
Token savings use $0.25 per prevented retry loop, the midpoint of $0.08–0.60. Context-switch recovery (23–45 min per interruption) isn't counted, so real savings are likely higher.
Pricing#
The CLI and file modes are free and open source. Pay when you need shared dashboards or network-level deployment.
Open source
For individual developers on their own machine.
- Mode 1 file monitor
- Mode 4 batch CSV reports
- All 52 patterns
- Desktop and terminal alerts
Team Popular
Billed yearly.
- Everything in Open source
- Mode 2 API proxy
- Mode 6 embeddable library
- Shared session viewer and alert history
- Custom pattern editor
Enterprise
For platform and security teams.
- Mode 3 transparent HTTPS proxy
- Mode 5 OTLP receiver
- Air-gapped install
- Audit and compliance exports
- SSO and support SLA
Questions
Not covered here? Open a discussion on GitHub.
Does it check whether the code is correct?
No. Linters and tests do that. HalluciGuard checks how the assistant talks about the code. A reply full of "I think" and "let me try a different approach" is a signal to slow down, even when the code compiles.
Why regex and not an ML model?
Speed and explainability. A regex match takes well under a millisecond and shows you the exact phrase it matched. An LLM classifier adds 100–500 ms, needs an API key or a GPU, and gives you a probability instead of a reason.
Do I need access to the model or my provider's API?
No. Every mode reads the text the assistant already produces: session files on disk, proxied HTTP responses, or the string you pass to the library.
What about false positives?
On production sessions we measured under 5%. You can raise the High and Critical thresholds, or disable individual rules in the YAML file, if a phrase is normal for your team.
Why is Mode 5 marked as paused?
Anthropic removed conversation content from Claude Code's OpenTelemetry exports. The OTLP receiver still works and will pick up content from any vendor that exports it.
What changed in 0.9.2?
Added the 16-rule Gemini CLI library, the 19-rule Copilot library, automatic platform detection from the session path, and parallel file parsing in batch mode.
Try it on your own sessions.
Install the CLI and point it at your session folder. Want the Team dashboard? Leave your details and we'll set up a pilot.