v0.9.2Gemini CLI pattern pack is out, plus 40% faster batch mode.Read the changelog →
Get started
New Copilot pattern library, 19 rules

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
MIT / Apache-2.0Rust 1.78+Node 18+ bindingsmacOS · Linux · Windows
~/code/api-server — 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
 
❯ 
Works with Claude CodeGemini CLIGitHub CopilotOllamaAny OpenAI-compatible APIOpenTelemetry

Playground#

Paste a reply from your assistant. This runs the same rule set as the CLI, right in your browser. Nothing is sent anywhere.

uncertainty hits
assistant_reply.md
0 chars~0 tokens0.00 ms
SeverityPASS
Matches0
Per 1k tokens0.0
Reasonno patterns

    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.

    AI assistant Claude · Gemini · Copilot Interception (12c) 1 file monitor · jsonl2 api proxy · :80003 https proxy · :80804 batch · csv5 otlp · :43176 napi library Detection engine (12a) Rust regex · O(n) severity scoring ~0.32 ms / msg patterns/*.yaml (122a) Alert router (12b) desktop notificationterminal · log fileexit code · halt signal
    Step numbers follow Fig. 2 of the patent filing.

    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.

    ModeIntercepts atWhenLatencyGood forStatus
    
          

    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.

    ~/.claude/projects/api-server/7f3a.jsonl

    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 Code17~/.claude/projects/*/*.jsonl
    Gemini CLI16~/.gemini/tmp/*/chats/session-*.json
    GitHub Copilot19issues #281, #6885, #64858
    Severity split across all 52 rules
    critical 2high 18medium 22low 10
    idCategoryExample triggerSeverityPlatforms
    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/clearcontinuousΔ
    Cognitive complexity ↓0.961.18−18.3%
    Maintainability index127.4119.6+6.6%
    Logical LOC per block3.92.6+50%
    Cyclomatic complexity1.230.92+34%
    Messages per session134.284.1+60%
    Code blocks per session2.72.1+29%

    Higher cyclomatic complexity here tracks with more complete code, not worse code.

    0.32 ms900+ message session, under 350 ms total
    < 5%false positives on production sessions
    ~30 MBconstant memory, any session length
    13prebuilt Node binaries

    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.

    Estimated value per year
    0
    0developer hours recovered
    0API spend avoided
    0incidents caught
    0per developer

    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

    $0

    For individual developers on their own machine.

    • Mode 1 file monitor
    • Mode 4 batch CSV reports
    • All 52 patterns
    • Desktop and terminal alerts
    Install the CLI

    Team Popular

    $12 / developer / month

    Billed yearly.

    • Everything in Open source
    • Mode 2 API proxy
    • Mode 6 embeddable library
    • Shared session viewer and alert history
    • Custom pattern editor
    Start 14-day trial

    Enterprise

    Custom

    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
    Contact sales

    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.

    $ cargo install halluciguard $ halluciguard batch "~/.claude/projects/*/*.jsonl" -o report.csv ✓ 306 files · 1,204 chats · report.csv written in 4.1s

    Demo form. Nothing is submitted.