troubleshooting

troubleshooting is a skill for Claude Code, Codex from anatomia-dev/anatomia. It costs 31 tokens per session (1,131 once invoked), scanned C, original, MIT.

A troubleshooting guide for diagnosing coding failures and unexpected behavior. It collects known problems and practical fixes for issues such as TypeScript errors and JavaScript module conflicts.

In plain words
What is it for?
Use it when debugging errors, investigating failed tests, or explaining unexpected behavior in a project. It provides diagnostic workflows and examples of fixes for listed failure modes.
Why use it?
It gives developers a repeatable way to investigate failures instead of guessing at fixes. It also highlights causes that are easy to miss, such as type narrowing ending across an await.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/anatomia-dev/anatomia/troubleshooting
Any agent
npx skills add anatomia-dev/anatomia --skill troubleshooting
Clone the repo
git clone --depth 1 https://github.com/anatomia-dev/anatomia

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for troubleshooting

README.md
[![agentmods](https://agentmods.dev/badge/skills/anatomia-dev/anatomia/troubleshooting.svg)](https://agentmods.dev/skills/anatomia-dev/anatomia/troubleshooting)
Your own site
<a href="https://agentmods.dev/skills/anatomia-dev/anatomia/troubleshooting"><img src="https://agentmods.dev/badge/skills/anatomia-dev/anatomia/troubleshooting.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,131 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.01131
Opus 5 $0.00015 $0.00566
Sonnet 5 $0.00006 $0.00226
Haiku 4.5 $0.00003 $0.00113

Measured 3d ago against content hash 9a576391c54f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

troubleshooting scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**Re-init doesn't show new template content.** CLAUDE.md, AGENTS.md, and agent definitions use merge-not-overwrite — existing files are preserved. To see fresh template output after changing templates, delete the existin
.ana/skills/troubleshooting/SKILL.md · 35 lines

How it starts

The opening of the file, as written. The whole thing — 35 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Troubleshooting

Detected

Common Issues

  • TypeScript reports "possibly null" or "possibly undefined" after a type guard, but only in async functions — the guard works in sync code — Type narrowing does not persist across await boundaries because the variable could be reassigned between suspension points. Re-narrow after each await: if (!x) throw before the await, then if (!x) throw again after.
  • Object literal type is widened to string instead of the literal value, or array type is string[] instead of a tuple — Add as const to the declaration: const x = { type: "success" } as const gives { readonly type: "success" } instead of { type: string }. For arrays: const arr = ["a", "b"] as const gives readonly ["a", "b"] instead of string[].
  • "ERR_REQUIRE_ESM" when importing an ESM-only package, or "SyntaxError: Cannot use import statement in a module" — ESM-only packages (like chalk v5+, execa v6+, node-fetch v3+) cannot be require()'d. Either: (1) switch your project to ESM ("type": "module" in package.json), (2) use dynamic import() for the ESM package, or (3) pin an older CJS-compatible version.
  • Process crashes with "UnhandledPromiseRejection" — an async function throws but nothing catches it — Ensure every Promise chain has a .catch() or is inside a try/catch in an async function. For fire-and-forget promises, add .catch(err => logger.error(err)). Check for missing await on async calls — without it, the rejection is unhandled. Prevention: Add process.on("unhandledRejection", handler) as a safety net, but fix the root cause — unhandled rejections indicate a code bug.
  • Tests hang indefinitely in CI or when run from scripts — process never exits — Vitest defaults to watch mode in interactive terminals. Pass --run flag to run tests once and exit: vitest run instead of vitest. In CI, Vitest auto-detects non-interactive environments, but scripts piping output may still trigger watch mode. Prevention: Always use vitest run in CI scripts and non-interactive contexts.
  • Tests pass individually but fail when run together — mock from one test bleeds into another — Call vi.restoreAllMocks() in afterEach or set mockReset: true / restoreAllMocks: true in vitest.config.ts. Module mocks (vi.mock()) persist across tests in the same file — use vi.unmock() or restructure to avoid shared module-level mocks.

Read the full file on GitHub · 35 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 35 lines · 31 tokens per session scan C 9a576391c54f

Subscribe to this mod's changes

troubleshooting is a skill published in the GitHub repository anatomia-dev/anatomia (32 stars, last pushed 1mo ago), licensed MIT. It adds 31 tokens to every session and 1,131 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.