Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

error-decoder

Paste a stack trace, get the root cause, the one line fix and how to stop it recurring.

error-decoder demo

Quickstart

git clone --depth 1 https://github.com/botaoishere/error-decoder .claude/skills/error-decoder

Restart Claude Code, then paste a stack trace and say "decode this trace".

Why this exists

A stack trace tells you where the program died, which is almost never where the bug is. The top twenty frames are framework internals, the message is a symptom ("undefined is not a function"), and the reflex fix is a null check that hides the real problem until it resurfaces somewhere worse. This skill forces a fixed procedure: find the first frame in your own code, read that file, name the cause, then hand back a minimal diff and one thing that stops it recurring.

Usage

Paste a trace. That is the whole interface.

> /error-decoder
TypeError: Cannot read properties of undefined (reading 'email')
    at sendWelcome (/app/src/mail/welcome.ts:14:23)
    at /app/node_modules/bullmq/dist/cjs/classes/worker.js:471:24
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
Root cause: sendWelcome receives a job payload with only { userId }, and
loadUser(userId) returns undefined for users deleted between enqueue and
run, so `user.email` reads off undefined.

Fix:
--- a/src/mail/welcome.ts
+++ b/src/mail/welcome.ts
@@ -11,6 +11,9 @@ export async function sendWelcome(job: Job<WelcomeJob>) {
   const user = await loadUser(job.data.userId)
+  if (!user) {
+    // deleted between enqueue and run; nothing to send, do not retry
+    return { skipped: "user-deleted" }
+  }
   await mailer.send({ to: user.email, template: "welcome" })

Prevention: make loadUser return `User | null` instead of `User` so the
compiler rejects the unchecked property read.

It skipped the node_modules/bullmq and node:internal frames, landed on welcome.ts:14, and read the file before answering.

What it will not do

  • Wrap the symptom in try/catch so the message stops printing.
  • Tell you to "make sure the value exists" without saying why it does not.
  • Suggest deleting node_modules unless the trace actually points at a stale artifact.

Decoder table

The skill ships with a lookup of the fifteen-plus errors that account for most real traces across JS/TS, Python and Go, each mapped to its usual real cause rather than its dictionary definition. EADDRINUSE is a dev server that did not exit. KeyError is an upstream payload that changed shape. nil pointer dereference is an ignored error return. See SKILL.md.

License

MIT.

About

A Claude Code skill that turns any stack trace into root cause, fix and prevention

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors