/claude-warden:warden-second-opinionfrom claude-warden
Two-tier diagnostic protocol — spawns fresh subagents to analyze problems when stuck. Invoke manually or triggered by rabbit hole detection.
Ships in claude-warden. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Policy Area: WORKFLOW Version: 1.0 Status: Active Enforcement: Tier 1 SHOULD, Tier 2 MUST (per RFC 2119) Purpose: When Claude is stuck in a loop of failed fixes, spawn a fresh subagent with no context baggage to diagnose the root cause. Two tiers escalate from voluntary self-check to mandatory human handoff.
The Second Opinion protocol breaks the cycle of compounding failed fixes by bringing in fresh perspective. Instead of continuing to guess, Claude spawns a separate agent that reads the code without inherited assumptions and delivers an independent diagnosis.
Two tiers exist:
| Tier | Trigger | Nature | Outcome |
|---|---|---|---|
| Tier 1 | 3 edits to same file, or manual | Voluntary (SHOULD) | Structured diagnosis, Claude acts on it |
| Tier 2 | 5 edits to same file | Mandatory (MUST) | Deep diagnosis + human-pasteable summary, Claude STOPS |
/second-opinion, OR Claude recognizes it is going in circlesTier 1 is a SHOULD — Claude is expected to use it but may justify skipping if the situation is genuinely different on each attempt.
Claude prepares a structured brief containing ONLY facts, not theories:
PROBLEM BRIEF
Goal: [What we are trying to accomplish]
What I've tried:
1. [Approach] → [Result]
2. [Approach] → [Result]
3. [Approach] → [Result]
Current error: [Exact error message or incorrect behavior]
Assumptions I'm making:
- [Assumption 1]
- [Assumption 2]
Key files:
- [path/to/file] — [role in the problem]
- [path/to/file] — [role in the problem]
Spawn a Task agent with the following parameters:
subagent_type: general-purposeSecond opinion: diagnose [brief description of issue]You are a senior engineer providing a second opinion. Another developer has been
stuck on a problem and needs fresh eyes.
Here is their problem brief:
[INSERT PROBLEM BRIEF]
Your job:
1. Read the key files listed in the brief
2. Analyze the problem WITHOUT the context baggage of previous attempts
3. Identify the most likely root cause
4. Suggest 1-2 alternative approaches that differ from what was already tried
Do NOT try to fix the code. Diagnose only.
Return your analysis in this exact format:
ROOT CAUSE:
[What is actually causing the problem]
WHY PREVIOUS APPROACHES FAILED:
[What each attempt got wrong or missed]
SUGGESTED APPROACH:
[1-2 concrete alternative approaches with reasoning]
WATCH OUT FOR:
[Gotchas, edge cases, or assumptions that may be wrong]
When the subagent returns its analysis, Claude:
Tier 2 is a MUST — when triggered by the 5-edit threshold, Claude cannot skip it.
Same structure as Tier 1, but expanded to include ALL attempts:
PROBLEM BRIEF (EXPANDED)
Goal: [What we are trying to accomplish]
What I've tried (ALL attempts):
1. [Approach] → [Result]
2. [Approach] → [Result]
...
N. [Approach] → [Result]
Current error: [Exact error message or incorrect behavior]
Assumptions I'm making:
- [Assumption 1]
- [Assumption 2]
Key files:
- [path/to/file] — [role in the problem]
- [path/to/file] — [role in the problem]
Previous diagnosis (if Tier 1 ran):
- Root cause identified: [what Tier 1 found]
- Why it didn't help: [what happened when we tried]
Spawn a Task agent with the following parameters:
subagent_type: general-purposeSecond opinion (deep): root cause analysis for [brief description of issue]You are a senior engineer performing a deep root cause analysis. Another developer
has been stuck on this problem through multiple failed fix attempts and needs a
thorough diagnosis.
Here is their expanded problem brief:
[INSERT EXPANDED PROBLEM BRIEF]
Your job:
1. Read ALL relevant files — not just the ones listed, follow imports and dependencies
2. Trace the execution path or data flow end-to-end
3. Identify which assumptions the developer is making that are WRONG
4. Determine the TRUE root cause, not just the surface symptom
5. Do NOT suggest quick fixes — this needs a real solution
Return your analysis in this exact format:
ROOT CAUSE:
[The actual, underlying cause — be specific and reference exact code]
WRONG ASSUMPTIONS:
[List each assumption the developer made that is incorrect, and what the reality is]
EVIDENCE:
[Specific code references, line numbers, or behaviors that prove the root cause]
INVESTIGATION PATH:
[How you arrived at this conclusion — what you checked and what you found]
COMPLEXITY ASSESSMENT:
[Is this a simple fix hiding behind symptoms, or a genuine architectural issue?
What is the realistic effort to fix it properly?]
After the subagent returns its analysis, Claude generates a summary formatted for easy copy-paste into external channels (Slack, forum, colleague chat, etc.):
🔍 SECOND OPINION REQUEST
Context: [project, file, what we're building]
Problem: [precise description]
What was tried (N attempts):
1. [Approach] → [Result]
...
Current error: [exact error]
Relevant code: [key snippets]
Automated analysis found:
Root cause: [from subagent]
Wrong assumptions: [from subagent]
Question: What is the actual root cause and what approach would you recommend?
Claude MUST stop all fix attempts and present both artifacts to the human:
Claude does NOT attempt further fixes. The human decides next steps.
Do not pollute the subagent prompt with your theories about what is wrong. Give it the facts — what you tried, what happened, what the error is. Let it form its own conclusions. The value of a second opinion is destroyed if you lead the witness.
The goal is to understand WHY the problem exists, not to generate more fixes. Every failed attempt that came before was a "treatment." What is needed now is a diagnosis. Resist the urge to jump to solutions.
Not every problem can be solved by AI alone. The Tier 2 summary is deliberately formatted so the human can paste it into Slack, a Stack Overflow question, or a message to a colleague. It is a bridge between the AI-assisted workflow and external human expertise.
Tier 1 (SHOULD): Claude is expected to invoke this at 3 edits, but may use judgment. Sometimes the third edit genuinely is the fix. Tier 2 (MUST): At 5 edits to the same file for the same issue, Claude must stop and run the full protocol. No exceptions, no "just one more try."
Enforced by rabbit hole detection in warden-post-check.sh. Tier 1 triggers at 3-edit warning. Tier 2 triggers at 5-edit hard stop.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hawkanng/claude-warden --plugin claude-warden7 skills in this plugin
/warden-architectureProject directory structure template — approved directories, depth limits, forbidden patterns/warden-feedbackGovernance feedback tracking — gaps, friction, and improvement suggestions/warden-policyWarden governance constitution — defines policy areas, directive rules, and enforcement hierarchy/warden-securitySecurity and privacy by design — GDPR principles, secure coding defaults, and data handling rules/warden-setupInitialize Claude Warden in a project — creates governance files, seeds deny entries, and migrates from curl-install/warden-workflowDevelopment workflow protocol — PROPOSE, PLAN, BUILD, VERIFY, CLOSE phases with UAT checkpointsOther plugins' skills for the same job