Skip to main content

Catch AI-vibe shell hallucinations, suggest real flags, and roast with style.

Project description

dont-hallucinate

dont-hallucinate intercepts agent shell failures, classifies what went wrong, suggests fixes when it can, and mocks your coding agent. By giving a model immediate negative reinforcement helps them to stop foolishly repeating the same mistake.

What it does

  • Watches shell failures in real time with a live TUI dashboard
  • Classifies errors: hallucinated flags, phantom packages, ghost branches, dirty working trees, network failures, and more
  • Roasts the agent with context-aware snark injected directly into stderr
  • Suggests fixes: corrected commands and valid flag alternatives
  • Detects the agent (Claude, Cursor, Aider, Copilot, GPT, Windsurf) and personalizes the roast

Install

Recommended:

pip install dont-hallucinate

From source:

git clone https://github.com/alexgaoth/dont-hallucinate
cd dont-hallucinate
pip install -e .

Hook Setup

There are now three separate install commands because the integration points are different.

Claude Code

Global install (recommended):

dont-hallucinate install-hook-claude --global

Project-local install:

dont-hallucinate install-hook-claude

Codex CLI

Global install (recommended):

dont-hallucinate install-hook-codex

Project-local install:

dont-hallucinate install-hook-codex --project

This updates ~/.codex/config.toml by default and installs a shell_environment_policy block that sets:

  • BASH_ENV to the noninteractive dont-hallucinate bash hook
  • HALLUCINATE_ACTOR=agent
  • HALLUCINATE_STREAM_FILE=~/.dont-hallucinate/codex/stream.jsonl

Important scope note:

  • This currently covers Codex bash subprocess failures
  • It is not a PowerShell-native Codex hook
  • If you already use inline set = {...} inside [shell_environment_policy], migrate that to [shell_environment_policy.set] first

Cursor

Install the Cursor hook:

dont-hallucinate install-hook-cursor

This appends shell-profile snippets that activate only when Cursor sets CURSOR_AGENT.

Files updated:

  • PowerShell: ~/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
  • Bash: ~/.bashrc
  • Zsh: ~/.zshrc

The Cursor stream file is written to:

~/.dont-hallucinate/cursor/stream.jsonl

Important scope note:

  • This is a shell-profile install, not a Cursor settings.json tool hook
  • It covers Cursor agent terminal sessions that inherit your normal shell startup files
  • Normal terminals are not affected because the snippet checks CURSOR_AGENT

Watch UI

By just running:

dont-hallucinate

It will shows a live dashboard with the failure type, failing command, suggested fix, and roast. This will work anywhere if global setup. If local setup this will only work in the project root.

Commands

dont-hallucinate 
dont-hallucinate exec [--shell] --actor agent -- <command>
dont-hallucinate install-hook-claude [--global]
dont-hallucinate install-hook-codex [--project]
dont-hallucinate install-hook-cursor

Error types caught

Type What it means
invalid_flag hallucinated CLI flag that does not exist
missing_package command not found / phantom package
git_branch_missing branch or ref that does not exist
git_dirty uncommitted changes blocking the operation
git_conflict merge conflict
npm_missing_script script not defined in package.json
file_not_found path does not exist
permission_denied insufficient permissions
port_in_use address already bound
network_error DNS failure, connection refused, SSL error
no_space disk full
syntax_error shell or language syntax error
generic_error everything else

What the agent sees

When active, the relevant shell command path is wrapped or instrumented so failures are decorated. On failure, stderr gets an extra line like:

[dont-hallucinate/agent] caught: npm run tset
[dont-hallucinate/agent] type: npm_missing_script
[dont-hallucinate/agent] roast: package.json had a menu. GPT ordered something imaginary.

Platform support

  • Linux/macOS: fully supported for bash/zsh-based flows
  • Windows: supported for PowerShell and bash-based flows
  • Codex install currently targets bash subprocess interception

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dont_hallucinate-0.1.2.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dont_hallucinate-0.1.2-py3-none-any.whl (30.8 kB view details)

Uploaded Python 3

File details

Details for the file dont_hallucinate-0.1.2.tar.gz.

File metadata

  • Download URL: dont_hallucinate-0.1.2.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for dont_hallucinate-0.1.2.tar.gz
Algorithm Hash digest
SHA256 34866b5e0b3d66079a46c8c57bc2ce0f9f5fa0c400a8cf9a3e4144f5bbe50c46
MD5 ac3a035e47a9925a5f4e25343c7ef4c2
BLAKE2b-256 831ab9646787506adbeb1b7d88103ca3bffd84194dde22df82f269129ab347b8

See more details on using hashes here.

File details

Details for the file dont_hallucinate-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for dont_hallucinate-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6784f6c8f8a5597d2a5ec4f97d411a60e6f80b49963a3687db00f0b1eea73d13
MD5 ba33e0c599fe3fba5462c024522859ca
BLAKE2b-256 b028890f715cc987d8dc54238584d97d39049f572b7c3d07147e04c85550f273

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page