test: reduce /create-bug root cause analysis cost with two-phase approach#26829
test: reduce /create-bug root cause analysis cost with two-phase approach#26829chrisleewilcox wants to merge 1 commit intomainfrom
Conversation
Use a Haiku subagent for evidence gathering (file reads, grep, git log) and reserve the main Opus context for reasoning and posting, reducing cost by ~5-8x per analysis while maintaining output quality. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The changes restructure the "Root Cause Analysis" workflow from three sequential phases to a two-phase approach using a Haiku subagent for evidence gathering and the main context for analysis. This is purely a workflow optimization for the AI assistant. This file:
No E2E tests are needed because this change has zero impact on the application or testing infrastructure. Performance Test Selection: |
Description
The root cause analysis in
/create-bug(Step 6) currently runs entirely on Opus — all file reads, grep searches, git log/blame calls, and reasoning happen in one expensive context. This refactors Step 6 into a two-phase approach:model: "haiku") performs all the I/O-heavy work — grep/glob/read for code tracing, git log for regression PRs, and pattern searching for scope analysis. Returns a structured summary.This reduces cost by ~5-8x per analysis while maintaining output quality since reasoning stays on Opus.
Related issues
MMQA-1530
Manual testing steps
Screenshots/Recordings
Before
Root cause analysis ran entirely on Opus — all file reads, greps, git logs, and reasoning in one context.
After
Run
/create-bugin Claude Code terminal, opt in to root cause analysis, and verify the Agent tool is called withmodel: "haiku"for evidence gathering while the final comment still contains all required sections.Changelog
CHANGELOG entry: null
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Documentation-only change to the
/create-bugClaude command; no production code paths or data handling are modified. Risk is limited to potential workflow/prompt regressions in how root-cause analysis is executed and formatted.Overview
Refactors
/create-bugStep 6 root-cause investigation guidance to a two-phase flow: a Haiku subagent performs I/O-heavy evidence gathering (code search/trace,git logregression hunting, and scope/pattern matching) and returns a structured summary, then the main context performs the reasoning and posts a single consolidated issue comment.Adds explicit instructions for the Haiku prompt (required sections and constraints on output) and updates the main-context checklist to consume that summary to determine root cause, identify regression PRs, assess blast radius, and file/link follow-up bugs as needed.
Written by Cursor Bugbot for commit 932e944. This will update automatically on new commits. Configure here.