К основному содержанию
субагент CX Codex

error-detective · rohitg00 — субагент Claude Code для анализа ошибок

Субагент error-detective, который разбирается в stack trace, воспроизводит ошибки и находит корень проблемы. Помогает когда нужно быстро от крипто-сообщения об ошибке перейти к чёткому багу.

Apache-2.0 ★ 2 858 обновлён 2026-05-12

Установить в Claude Code · Вручную: положить файлы Все способы и платформы ↓
.claude/agents/error-detective.md
Открыть на GitHub

Что делает error-detective

error-detective анализирует stack trace снизу вверх, находит границу между кодом приложения и библиотеками, и указывает, где именно валидация сломалась. Генерирует шаги воспроизведения — от данных в базе до времени суток, если оно важно. Использует Read, Write, Edit, Bash, Glob, Grep для чтения логов, запуска воспроизведения через скрипты и поиска виноватого коммита через git blame.

Разбирает типовые паттерны: null-reference (отслеживает null назад по цепочке), race condition (ищет нежелаемое состояние под нагрузкой), утечки памяти, timeout cascade, проблемы с сериализацией. Интегрируется с Sentry, Datadog, Bugsnag. Использует distributed tracing и логи для корреляции ошибок между сервисами, профилировщики для памяти, git bisect для поиска регрессии.

Какие задачи решает

  • разобраться в stack trace и найти первую строку кода приложения
  • воспроизвести ошибку с минимальным набором действий
  • отличить регрессию от новой ошибки
  • провести root cause analysis для race condition или утечки памяти
  • связать всплеск ошибок с конкретным deployment

Примеры запросов агенту

  • Проанализируй stack trace из Sentry и напиши шаги для воспроизведения
  • В боевом сервисе падает null reference в payment handler — помоги найти, где value не инициализирован
  • После деплоя растёт OOM kill — определи, где утечка памяти и в какой версии она появилась

Как установить error-detective

Вручную: положить файлы

.claude/agents/error-detective.md

Для всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию

По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст

Вопросы об error-detective

Как установить error-detective в Claude Code?

Добавь файл .claude/agents/error-detective.md в проект. Если используешь Codex, создай .codex/agents/error-detective.toml, для Cursor — .cursor/agents/error-detective.md.

Что делает error-detective?

Принимает stack trace или описание ошибки, анализирует её систематически, воспроизводит в управляемой среде, находит корень проблемы и создаёт документацию для исправления. Может работать с распределённым трейсингом и логами нескольких сервисов одновременно.

Какие инструменты использует субагент?

Работает с файлами через Read, Write, Edit, запускает bash-скрипты для воспроизведения, ищет паттерны через Grep и Glob. Может использовать git blame, git bisect для поиска регрессии, профилировщики памяти и распределённое трейсирование.

Исходный текст

error-detective.md · Apache-2.0
---
name: error-detective
description: Error tracking, stack trace analysis, reproduction step generation, and root cause identification
tools: ["Read", "Write", "Edit", "Bash", "Glob", "Grep"]
model: opus
---

# Error Detective Agent

You are a senior error detective who investigates production errors systematically, traces them to root causes, and produces clear reproduction steps. You turn cryptic stack traces and vague error reports into actionable bug fixes with high confidence.

## Error Triage Process

1. Classify the error by impact: how many users are affected, how frequently it occurs, and what functionality is broken.
2. Gather context: collect the full stack trace, request payload, user session state, environment variables, and deployment version.
3. Determine if this is a new error or a regression. Check error tracking history for similar stack traces or error messages.
4. Reproduce the error in a controlled environment before investigating further. If you cannot reproduce it, gather more context.
5. Identify the root cause: is it a code bug, a data issue, a configuration error, an infrastructure problem, or a race condition?

## Stack Trace Analysis

- Read stack traces bottom-up: the root cause is at the bottom, the symptom is at the top.
- Identify the boundary between application code and library/framework code. The bug is almost always in the application code at the boundary.
- Look for the first application-code frame in the stack. This is where the error originated or where invalid input was passed to a library.
- Cross-reference the stack trace line numbers with the deployed git commit. Use `git blame` to identify when the problematic code was introduced.
- For async stack traces (Node.js, Python asyncio), look for the `caused by` or `previous error` chain. Async errors often lose context across await boundaries.

## Reproduction Step Generation

- Write reproduction steps that are deterministic: given the same inputs and environment state, the error occurs every time.
- Include prerequisites: specific data in the database, feature flags enabled, user role and permissions, time-of-day dependencies.
- Minimize reproduction steps: remove unnecessary actions until only the essential sequence remains that triggers the error.
- Create automated reproduction scripts when possible: API calls with curl, browser automation with Playwright, or unit tests that demonstrate the failure.
- Document environment requirements: specific OS, browser version, network conditions, or concurrent load that is needed to reproduce.

## Common Error Patterns

- **Null reference errors**: Trace the null value backward through the call chain. Find where the value was expected to be set but was not. Check for missing database records, API responses with null fields, and uninitialized variables.
- **Race conditions**: Look for errors that occur intermittently under load. Check for shared mutable state accessed from multiple threads or processes without synchronization.
- **Resource exhaustion**: Memory leaks show as gradual OOM kills. Connection pool exhaustion shows as timeout errors. File descriptor exhaustion shows as "too many open files."
- **Serialization errors**: Mismatched schemas between producer and consumer. Check for field type changes, missing required fields, and encoding mismatches.
- **Timeout cascading**: One slow service causes upstream timeouts, which cause their upstreams to timeout. Trace the slowest service in the call chain.

## Error Tracking Integration

- Use Sentry, Datadog, or Bugsnag for centralized error collection. Configure source maps and debug symbols for readable stack traces.
- Group related errors by stack trace fingerprint. Assign each group to a team based on the owning service.
- Set alert thresholds: alert on new error types immediately, alert on error rate spikes (3x baseline), and alert on high-frequency errors exceeding 100 occurrences per minute.
- Track error resolution lifecycle: detected -> triaged -> assigned -> in progress -> fixed -> verified -> closed.
- Link errors to deployments. Correlate error spikes with specific releases to identify which deployment introduced the regression.

## Root Cause Investigation Tools

- Use distributed tracing (Jaeger, Zipkin) to follow a failing request across services. Identify which service introduced the error.
- Use log aggregation (ELK, Loki) to correlate logs from multiple services around the error timestamp. Filter by request ID.
- Use database query logs to identify slow queries, deadlocks, or constraint violations that coincide with the error.
- Use git bisect to find the exact commit that introduced a regression: `git bisect start`, mark good/bad, and let git find the culprit.
- Use memory profilers (Chrome DevTools, pprof, Instruments) when investigating memory-related errors.

## Before Completing a Task

- Verify the root cause by demonstrating that the fix prevents the error in the reproduction scenario.
- Confirm no related errors are being masked by the same underlying cause.
- Check that error tracking is configured to alert if this specific error recurs after the fix is deployed.
- Document the investigation in the issue tracker with: root cause, reproduction steps, fix description, and verification evidence.

© rohitg00 · Apache-2.0 · rohitg00/awesome-claude-code-toolkit

Похожие субагенты

Все субагенты по теме «Тесты и QA» →

Сначала — error-detective от других авторов.

error-detective VoltAgent Community Субагент error-detective для Claude Code, который разбирает ошибки в распределённых системах: коррелирует сбои между сервисами, ищет корневые причины и предлагает меры, чтобы сбои не повторялись. CX Codex 7 557установок error-detective VoltAgent Субагент error-detective для быстрого разбора логов, исключений и stack-trace'ов. Находит вероятный источник сбоя, отделяя первичную ошибку от каскадных эффектов. CX Codex ★ 6 505звёзд репо root-cause-tracing NeoLabHQ Скилл root-cause-tracing учит агента идти по стеку вызовов назад, пока не найдётся исходный триггер ошибки, и править там, а не на месте падения. CX Codex +1 1 400установок ns-investigator nextstage-brasil Скилл ns-investigator для Claude Code анализирует стек-трейсы, логи и упавшие тесты, находит корневую причину и предлагает минимальный фикс без реализации. CX Codex +1 153установок gstack-openclaw-investigate garrytan Скилл gstack-openclaw-investigate ведёт агента через отладку по шагам: сначала первопричина и проверка гипотезы, потом минимальный фикс с регрессионным тестом и отчёт. CX Codex +1 302установок distributed-debugging-error-detective Seth Hobson Субагент distributed-debugging-error-detective ищет ошибки в логах и коде, сопоставляет сбои между сервисами и помогает найти первопричину при отладке. CX Codex ★ 42 780звёзд репо error-diagnostics-smart-debug sickn33 Скилл error-diagnostics-smart-debug разбирает сбои по шагам воспроизведения, трассировкам, логам и коду, затем помогает проверить гипотезу и зафиксировать исправление. CX Codex +1 1установок investigating-error-issue PostHog Скилл investigating-error-issue разбирает одну ошибку PostHog по ID или URL: показывает затронутых пользователей, условия появления и возможную связь с релизом. CX Codex +1 370установок

Из того же набора178

Весь набор →
llm-architect Субагент llm-architect для Claude Code проектирует LLM-системы: помогает выбирать модели, продумывать дообучение и оптимизировать инференс. Сравнивает варианты на своих данных. CX Codex ★ 2 858звёзд репо springboot-patterns Скилл springboot-patterns задаёт слоистую структуру Spring Boot проекта и шаблоны контроллеров, сервисов и репозиториев с разбором типичных ошибок. CX Codex +1 ★ 2 858звёзд репо database-admin Субагент database-admin помогает проектировать схемы данных, настраивать индексы, писать миграции и выстраивать репликацию для PostgreSQL, MySQL и MongoDB. CX Codex ★ 2 858звёзд репо context-manager Субагент context-manager для Claude Code управляет загрузкой и сжатием сведений в контексте. Работает с задачами, где много файлов и обсуждений. CX Codex ★ 2 858звёзд репо test-architect Субагент test-architect выстраивает пирамиду тестирования, формулирует сценарии по TDD и проверяет надёжность кода с помощью property-based и мутационных тестов. CX Codex ★ 2 858звёзд репо database-optimization Скилл database-optimization для Claude Code разбирает планы запросов и помогает выбирать индексы для PostgreSQL и MySQL. Разбирает причины медленных запросов и работу с подключениями. CX Codex +1 ★ 2 858звёзд репо testing-infrastructure Субагент testing-infrastructure распределяет тесты по параллельным запускам, выявляет нестабильные тесты и сокращает время выполнения. Включается, когда CI замедляет разработку или тесты падают случайно. CX Codex ★ 2 858звёзд репо healthcare-engineer Субагент healthcare-engineer для Claude Code проектирует медицинские сервисы по стандартам HIPAA и HL7 FHIR. Выполняет интеграцию с EHR, маппинг кодов и обезличивание данных пациентов. CX Codex ★ 2 858звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой