Skip to main content

Paste or pipe any error message and get a plain-English explanation powered by Claude

Project description

errex — Error Explainer

CI PyPI version Python versions

Paste or pipe any error message and get a clear, plain-English explanation powered by Claude.

$ cat traceback.txt | errex

────────────────────── errex — Error Analysis ──────────────────────

**TypeError: unsupported operand type(s) for +: 'int' and 'str'**

This is a Python type error. You're trying to add an integer and a
string together, which Python doesn't allow...

Install

pip install errex
export ANTHROPIC_API_KEY=sk-ant-...

Requires Python 3.9+ and an Anthropic API key.

Quick start

errex                        # interactive paste
errex traceback.txt          # read from a file
cat error.log | errex        # pipe from stdin
errex --watch server.log     # tail a log, auto-explain errors

All flags

Explaining errors

Flag What it does
errex [FILE] Explain an error from a file, stdin, or interactive paste
--brief One-paragraph summary instead of full analysis
--fix Output only the fix command, no explanation
--lang LANG Language hint when the error is ambiguous (e.g. rust, go, java)
--model MODEL Choose which Claude model to use (default: claude-sonnet-4-6)
--json Structured JSON output: error_type, root_cause, fix_steps, gotchas
--context FILE Attach a source file as extra context for more targeted explanations
errex A.txt B.txt Compare two error files and find shared root causes

Code tools

Flag What it does
--explain-code FILE Walk through what a piece of code does in plain English
--lint FILE Scan a code file for bugs, security issues, and anti-patterns
--test-gen FILE Generate a test case for a code file; pipe an error to reproduce the bug
--explain-diff [FILE] Explain a git diff — pipe git diff | errex --explain-diff or pass a .patch file

History & search

Flag What it does
--history [SEARCH] View past explanations, optionally filtered by keyword
--recent [N] Show the last N explanations (default: 5)
--similar Find past errors in your history that match the current one
--ask "question" Ask a follow-up about the last error without re-explaining it
--retry Re-explain the last error with different flags (e.g. --retry --model claude-opus-4-7)
--stats Usage dashboard: total runs, models, top error types, busiest day/hour
--export FILE Export history to a styled HTML or Markdown file (--export-format html|md)
--clear-history [DAYS] Delete all history, or only entries older than N days

Workflow

Flag What it does
--watch LOGFILE Tail a log file and auto-explain new errors (deduplicates repeats)
--summarize-log FILE Digest all distinct error types in a large log file
--issues Search GitHub Issues for bugs matching your error
--share Post the explanation to paste.rs and print a shareable link
--copy Copy the explanation to the clipboard
--chat Stay in a Q&A loop after the explanation
--notify Send a desktop notification when the explanation is ready

Code tools

Flag What it does
--explain-code FILE Walk through what a piece of code does in plain English
--lint FILE Scan a code file for bugs, security issues, and anti-patterns
--test-gen FILE Generate a test case for a code file; pipe an error to reproduce the bug
--explain-diff [FILE] Explain a git diff — pipe git diff | errex --explain-diff or pass a .patch file
--grep PATTERN FILE Filter a log file by regex, then explain matching lines

Translation & output

Flag What it does
--translate LANG Respond in a spoken language (--translate Spanish, --translate Japanese)
--save-as NAME Tag this explanation with a name for quick retrieval
--json Structured JSON output: error_type, root_cause, fix_steps, gotchas
--fix Output only the fix command, no explanation
--copy Copy the explanation to the clipboard
--share Post the explanation to paste.rs and print a shareable link
--tokens Show input/output token counts after each explanation

Setup & config

Flag What it does
--config [key=value] View or edit ~/.errexrc — e.g. --config model=claude-opus-4-7
--setup First-run wizard: check API key, detect languages, write config, install shell integration
--doctor Health check: verify API key, connectivity, config, and version
--completion bash|zsh Print a shell completion script (source <(errex --completion zsh))
--scan Scan common log locations for recent error files and pick one to explain
--install-shell Add errex-last() to your shell — run it after any failed command
--web Launch a local web UI at http://localhost:7337
--update Check PyPI for a newer version
--version Show the installed version

Config file

~/.errexrc sets your defaults (all fields optional):

{
  "model": "claude-opus-4-7",
  "brief": false,
  "lang": "python",
  "copy": false
}

Or manage it from the CLI:

errex --config                        # show all settings
errex --config model=claude-opus-4-7  # set a value
errex --config lang=null              # reset to default

Shell integration

errex --install-shell   # adds errex-last() to ~/.zshrc or ~/.bashrc

After any failed command, run errex-last to explain why it failed.

History

Every explanation is saved to ~/.errex_history (one JSON object per line).

errex --recent           # last 5 explanations
errex --history KeyError # search history
errex --stats            # usage dashboard
errex --export report.html  # export to HTML

What you get

For any error, errex explains:

  1. What kind of error it is and which language or tool produced it
  2. What it means in plain English
  3. The most likely root cause, ranked by probability
  4. Numbered fix steps with code snippets where helpful
  5. Common gotchas — the non-obvious things that trip people up

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

errex-0.10.0.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

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

errex-0.10.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

File details

Details for the file errex-0.10.0.tar.gz.

File metadata

  • Download URL: errex-0.10.0.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for errex-0.10.0.tar.gz
Algorithm Hash digest
SHA256 2ee55ce1377bf021cfa4016669f3805e8c262857909e2dfba556cb89506ad8d1
MD5 e6e90e7c8502e50ece53f4818a088807
BLAKE2b-256 78ac8bd4865c0c636f965d2908bf726c8b118bb2937609fdef66e718442cd082

See more details on using hashes here.

File details

Details for the file errex-0.10.0-py3-none-any.whl.

File metadata

  • Download URL: errex-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 26.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for errex-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8001f48741bb9950eafa1c0ed7f9c6d6fa8ef9eb4e66b2d3db7bcb2230cac7d3
MD5 bd7940176d910ec2d735bed226fb1721
BLAKE2b-256 2a0a43dc05057ff194e4eb162b78ebd9d6ab9336a0d7e42d655c36d661aa2860

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