Skip to content

Stack Traces

Live Trace Analysis

Krythiq intercepts stack traces in real-time as your process runs and explains the root cause with AI analysis — all directly in your terminal.

How It Works

When you run krythiq run "your-command", krythiq:

  1. Spawns your process and captures all stderr output
  2. Watches for stack trace patterns (Node.js, Python, Go, etc)
  3. When a trace is detected, sends it to Claude for AI analysis
  4. Streams back the root cause, explanation, and fix suggestion
  5. Your process continues running — analysis is non-blocking
Basic Usage

Start by wrapping any process with krythiq:

krythiq run "npm start"

When an error occurs, you'll see:

Example output
$ krythiq run "npm start" ● krythiq watching — node v20.11.0● AI trace analysis enabled   > myapp@1.0.0 start  > node index.js Server listening on :3000 TypeError: Cannot read properties of undefined (reading 'id')    at /src/routes/user.ts:42:18    at Layer.handle [as handle_request] (/node_modules/express/lib/router/layer.js:95:16) ──────────────────────────────────────────────────────────────────● krythiq — trace analysis   Root cause: req.user is undefined because the authentication middleware             didn't run before this route handler.   Why: Express middleware order matters. The auth middleware must come       before route definitions. If auth is loaded after routes, req.user       won't exist when routes execute.   Fix: Move require("./middleware/auth") before require("./routes") in       your app.js, or use app.use(authMiddleware) before app.use(routes).   Confidence: 94%──────────────────────────────────────────────────────────────────
Supported Languages

Krythiq can analyze stack traces from:

Node.js / JavaScript

Full support for TypeScript too

Python

Traceback format recognized

Go

goroutine panic traces

Rust

backtrace module format

Command-Line Options
--no-ai

Disable AI analysis. Krythiq will just pipe output through without analyzing traces.

krythiq run --no-ai "npm start"
--model <model>

Specify which Anthropic model to use for analysis (default: claude-sonnet-4-20250514)

krythiq run "npm start" --model your-anthropic-model
--verbose

Show debug information from krythiq itself (useful for troubleshooting)

krythiq run --verbose "npm start"
Configuration

Control trace analysis behavior via krythiq.config.mjs:

export default defineConfig({  model: "claude-sonnet-4-20250514",    traces: {    enabled: true,  },});

See the Configuration page for complete options.

Common Patterns Detected

Krythiq recognizes and explains patterns like:

  • Null/undefined reference errors
  • Type mismatch errors
  • Missing dependencies or modules
  • Async/await issues (promise rejections)
  • Memory exhaustion or out-of-bounds access
  • Permission and file system errors
  • Network timeout or connection errors
  • Database query failures
Requirements
  • Anthropic API Key (optional): Run krythiq auth to enable AI analysis; commands still run without it
  • Node.js 20+: Krythiq itself requires Node 20 or later
  • Internet connection: AI analysis requires calls to Anthropic API
Troubleshooting

Trace not being analyzed?

Make sure traces are enabled in your config and your API key is set: krythiq auth

Analysis taking too long?

Select a model available to your Anthropic account with --model.

Running out of API quota?

Use krythiq run --no-ai to disable AI features.