/cc-suite:bug-analyze <bug description> [--background | --wait]from cc-suite
Performs root cause analysis on user-described bugs using Codex. Parses symptoms, searches codebase for related code, and traces data flow to identify origin. Supports --background and --wait modes.
Ships in cc-suite. Installing the plugin adds it to Claude Code.
$ARGUMENTS
Follow the instructions in ${CLAUDE_PLUGIN_ROOT}/commands/shared/model-selection.md to discover available models and present choices.
highread-only)Parse $ARGUMENTS for --background or --wait flags (remove the flag from remaining arguments):
| Flag | Mode |
|---|---|
--background | Background — spawn detached Codex runner, return job ID |
--wait | Foreground (explicit) — same as default |
| Neither | Foreground (default) — run inline, block until complete |
Extract from $ARGUMENTS:
If $ARGUMENTS is empty or too vague to extract actionable keywords, use AskUserQuestion to ask the user for a more specific bug description before proceeding.
Identify scope using symptoms and keywords:
Search for related code:
Map the affected area:
If the bug description references specific files or paths, use ${CLAUDE_PLUGIN_ROOT}/commands/shared/scope-parse.md for skip pattern enforcement against {config_skip_patterns}. When the analysis is unscoped (no bounded file list), instead state {config_skip_patterns} in the prompt as paths Codex must not consider or modify.
If --background mode was selected, follow the Background Execution section in ${CLAUDE_PLUGIN_ROOT}/commands/shared/codex-call.md. Build the prompt as described below, then hand off to the background runner with --kind bug-analyze.
Follow ${CLAUDE_PLUGIN_ROOT}/commands/shared/codex-call.md for the call pattern (CLI runner) and Job Tracking.
read-onlyneverFor each affected file (files matching Grep results, files in the call chain, up to 10 files max):
prompt: "Analyze {filename} for potential causes of this bug:
BUG DESCRIPTION: {user's bug description}
Investigate:
1. **Logic Flow Analysis**
- Trace execution path related to symptoms
- Identify conditional branches that could cause the issue
- Check loop conditions and termination
- Look for off-by-one errors or boundary issues
2. **State Management**
- Race conditions or timing issues
- Stale state or cache problems
- Mutation of shared state, async/await issues
3. **Data Flow**
- Data transformations, type coercion
- Null/undefined propagation
- Truncation or overflow possibilities
4. **Error Handling**
- Swallowed exceptions, missing error cases
- Incomplete cleanup on failure
5. **Edge Cases**
- Empty inputs, null/zero values, boundary conditions
- Concurrent access, resource exhaustion
Report findings as:
- LIKELY CAUSE: {description} at {file:line}
- CONTRIBUTING FACTOR: {description} at {file:line}
- RELATED RISK: {description} at {file:line}"
After analyzing all affected files:
prompt: "Based on the root cause pattern found ({root cause}),
search the codebase for similar patterns that could cause related bugs.
Look for:
1. Same anti-pattern in other files
2. Similar logic that shares the same flaw
3. Code that depends on the buggy behavior
4. Copy-pasted code with the same issue
Report each as:
- RELATED BUG RISK: {file:line} - {description}"
# Bug Analysis Report
**Date**: {today}
**Bug**: {summary of user's description}
**Model**: {chosen_model} | **Effort**: {chosen_effort}
**Thread ID**: `{threadId}` _(use `/continue {threadId}` to drill deeper)_
## Executive Summary
**Root Cause**: {one-sentence description}
**Confidence**: High / Medium / Low
**Complexity**: Simple fix / Moderate / Requires refactoring
## Symptoms Explained
{How the root cause manifests as the observed symptoms}
## Root Cause Analysis
### Primary Cause
| Location | Description | Evidence |
|----------|-------------|----------|
| {file:line} | {what's wrong} | {why we know} |
### Contributing Factors
| Location | Description | Impact |
|----------|-------------|--------|
| {file:line} | {issue} | {how it contributes} |
## Data/Logic Flow
(Trace the data/execution flow step-by-step from the triggering input to the point of failure)
## Related Bugs Found
| Location | Risk Level | Description |
|----------|------------|-------------|
| {file:line} | High/Med/Low | {potential bug} |
## Recommended Fix
### Immediate Fix
1. {specific action at file:line}
### Proper Fix (if different)
(Describe the fuller fix when the immediate fix is a patch — what should be refactored and why)
### Test Cases to Add
1. {test case description}
## Prevention
- {coding practice}
- {review checklist item}
- {test strategy}
Follow ${CLAUDE_PLUGIN_ROOT}/commands/shared/fallback.md. Use Grep to find related patterns:
catch|except|errorsetState|set|update|mutateWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub xiaolai/cc-suite --plugin cc-suite46 commands in this plugin
/add-agentCC-Suite Add AgentCreate a new cc-suite advisor agent — a project-scoped value-over-rules persona registered as an MCP server for Claude and Codex, then available to agy after the MCP projection is refreshed. Optional preset arg copies a curated template./agy/cc-suite:agyDelegate a prompt directly to Antigravity CLI with bounded execution and shared job tracking/agy-preflightAntigravity (agy) PreflightCheck Antigravity CLI (agy) availability, authentication, models, and workspace MCP parity/auditUser InputCode auditor — full 9-dimension or fast 5-dimension audit with --full/--mini flag/audit-agentUser InputAgent auditor — audit Claude Code agent definitions for triggering accuracy, system prompt quality, tool appropriateness, and example coverage/audit-commandUser InputCommand auditor — audit Claude Code slash commands for schema, workflow clarity, tool selection, error handling, and output specificationOther plugins' commands for the same job