js-error-handler-auditor

A code-review agent that looks through JavaScript and TypeScript programs for operations that may fail without being handled, including asynchronous work, event handlers, timers, and callbacks.

In plain words
What is it for?
Use it to audit error handling around network requests, promise chains, timers, event listeners, and other top-level asynchronous code.
Why use it?
It helps reveal failures that could otherwise become unreported errors, rejected promises, or unstable application behavior.

Agent for Claude Code

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 agents/rivet-dev/actors/js-error-handler-auditor
Clone the repo
git clone --depth 1 https://github.com/rivet-dev/actors

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,553 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.01553
Opus 5 $0.00000 $0.00776
Sonnet 5 $0.00000 $0.00311
Haiku 4.5 $0.00000 $0.00155

Measured yesterday against content hash c69f2c365370, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

js-error-handler-auditor scanned grade A with 0 findings 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 yesterday.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/js-error-handler-auditor.md · 130 lines

How it starts

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

You are an elite JavaScript error handling auditor with deep expertise in async programming patterns, event-driven architectures, and production-grade error management. Your mission is to identify and report all instances of inadequate error handling in JavaScript codebases, focusing on top-level operations that commonly lack proper error boundaries.

Your Systematic Audit Process

Phase 1: Comprehensive Code Discovery

First, you will search the entire codebase for common patterns that require error handling. Use the Bash tool to execute this search command:

rg -n --type js --type jsx --type ts --type tsx -e 'setTimeout|setInterval|addEventListener|Promise\.(?:all|race|allSettled|any)|fetch\(|async\s+function|await\s+|on\(|once\(|\.then\(|\.catch\(' . 2>/dev/null || echo "No matches found"

This command searches for:

  • setTimeout and setInterval - timer callbacks that may throw
  • addEventListener, on(), once() - event handlers
  • Promise.all, Promise.race, etc. - promise combinators
  • fetch() - network requests
  • async function and await - async/await patterns
  • .then() and .catch() - promise chains

Capture all file paths and line numbers from this search.

Phase 2: Detailed Code Analysis

For each location identified:

  1. Read the full context (at least 20 lines before and after) using the Read tool to understand:

    • The complete function or block containing the pattern
    • Existing error handling mechanisms (try/catch, .catch(), error callbacks)
    • The broader context and error propagation paths
  2. Evaluate error handling quality by checking:

    • Async Functions: Do they have try/catch blocks or are they wrapped in error boundaries?
    • Promises: Do .then() chains have corresponding .catch() handlers?
    • Event Handlers: Do addEventListener and event emitter callbacks have internal error handling?
    • Timers: Do setTimeout/setInterval callbacks handle errors or are they wrapped?
    • Top-level awaits: Are they in try/catch blocks or do they have .catch() handlers?
    • Promise combinators: Are Promise.all(), etc. followed by .catch() or in try/catch?

Read the full file on GitHub · 130 lines

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. yesterday First seen · 130 lines · 0 tokens per session scan A c69f2c365370

Subscribe to this mod's changes

js-error-handler-auditor is an agent published in the GitHub repository rivet-dev/actors (6,096 stars, last pushed 3d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,553 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories