/scalpel:ci-fixfrom scalpel
Auto-remediate CI, staging, and production failures. 3-attempt retry with investigation. Discord alert on exhaustion. Usage: /ci-fix [ci|staging|prod] [branch]. Flags: <--decisions off|shadow|enforce>
Ships in scalpel. Installing the plugin adds it to Claude Code.
Automatically diagnose and fix CI failures, staging deploy failures, and production deploy failures. Retries up to 3 times. Alerts on Discord #deployments if all attempts fail.
Modes — first positional arg, default ci:
ci — fix GitHub Actions / GitLab / Jenkins / etc. failures on the current branchstaging — investigate + fix staging deploy failures (read deploy logs, patch, redeploy)prod — investigate prod deploy failures READ-ONLY first; never modify prod DB; consider revert on attempt 3Flags: --decisions off|shadow|enforce (legacy --jev) (Arth Decisions mode override, resolved once in A1-J; off = today's flow; the routing trace's Why: carries Arth Decisions: {mode} when not off).
Loop guard: max 3 attempts per session. After exhaustion → Discord alert #deployments + QA incident file. Cross-session guard: .claude/monitors/.ci-fix-state.json tracks attempts per branch.
Per-attempt skeleton: diagnose → classify → fix (scoped to failing files only) → verify locally → push → wait for CI result.
Required reading (do not skip): before any mode dispatches, execute every step in ## Required Context — Read Before Mode Detection (Steps 1-5: read context, detect CI platform, detect test infra, detect env, check flaky patterns). The Quick Reference is a pointer, not a substitute — proceed to Mode Detection only after all 5 steps complete.
Hard rules: never lint-fix the whole repo, never # noqa/# type: ignore, never delete tests, always verify locally before pushing, always try a different strategy on each retry.
Toolkit-specific quick fixes (this repo): bracket regex in description:/arguments: → <text> not [text]; missing manifest entries → add to install.sh:get_category_items(); stale brownfield fixture → cp agents/<name>.md tests/fixtures/claude-setups/poweruser/.claude/agents/.
See also: ## Reference: CI Improvement Recommendations (post-fix hygiene) · ## Reference: Knowledge Base Integration · ## Reference: Monitor Integration — Auto-Remediation Loop
Before attempting any fix, understand the FULL CI/CD landscape.
Read in this order (context-loading.md tiered protocol):
Tier 0:
CLAUDE.md — Test Commands table, Infrastructure table.claude/project-profile.md — CI platform, test frameworks (from /calibrate)Compiled Memory Context (arth-memory Tier 0.5 — if configured): the first
rung of the 3-rung ladder (full contract: skills/_lib/arth-memory-tier05.md).
Attempted ONLY when both bash gates below pass — each line is a single
trivial command (a compound block trips the Bash guard):
bash skills/_lib/arth-memory.sh status # must print "configured" — anything else → skip to Knowledge Graph Context below (marketplace-plugin path: "${CLAUDE_PLUGIN_ROOT}/skills/_lib/arth-memory.sh")
grep -m1 '^ARTH_MEMORY_HEALTH=' .claude/.arth-memory.env 2>/dev/null # must be ARTH_MEMORY_HEALTH=ok — anything else (or missing file) → skip to Knowledge Graph Context below
bash skills/_lib/arth-memory.sh scope-key # → owner/repo; becomes the compile_context scope_key arg
If both gates pass, call mcp__arth-memory__compile_context with:
scope_key — the scope-key output abovetask — the same 3-5 keywords ("CI failure {error keywords from logs}")
that the kg-query call below uses (extract once, reuse for both — do not
derive a second keyword set)budget: 2000If the tool is unavailable, errors, or returns empty: inject nothing and fall through to the kg-query call below, unchanged.
On success: prepend the result under ## Compiled Memory Context (arth-memory), [mem:…] citation tokens preserved verbatim.
Tier 0.5 — Knowledge Graph (fallback rung — fires when arth-memory is absent, unhealthy, or returned nothing above; fast, ranked):
KG_SCRIPT="${CLAUDE_PLUGIN_ROOT}/skills/knowledge-graph/kg-query.sh" # plugin install: Claude Code substitutes the root at load
[ -f "$KG_SCRIPT" ] || KG_SCRIPT=".claude/skills/knowledge-graph/kg-query.sh" # symlink install
if [ -f "$KG_SCRIPT" ]; then
kg_result=$("$KG_SCRIPT" "CI failure {error keywords from logs}" --top 10 --threshold 0.3 2>/dev/null)
# Surfaces: past CI failure patterns, known flaky tests, conventions
fi
Tier 1 — KB files (always, KG supplements):
3. .claude/knowledge/skills/ci-fix.md — Past CI failures and patterns
Tier 2 — Selective:
4. Grep .claude/qa-knowledge/incidents/ for CI-related keywords
5. Grep .claude/qa-knowledge/bug-patterns.md for matching failure patterns
Don't assume GitHub Actions. Detect the actual CI system:
| Signal | CI Platform | How to get logs | How to check status | How to retry |
|---|---|---|---|---|
.github/workflows/*.yml | GitHub Actions | gh run view <id> --log-failed | gh run list --branch <b> | gh run rerun <id> |
.gitlab-ci.yml | GitLab CI | glab ci view --branch <b> | glab ci status | glab ci retry |
Jenkinsfile | Jenkins | Jenkins API: /job/<name>/lastBuild/consoleText | Jenkins API: /job/<name>/lastBuild/api/json | Jenkins API: /job/<name>/build |
.circleci/config.yml | CircleCI | circleci CLI or API | circleci CLI | API trigger |
bitbucket-pipelines.yml | Bitbucket Pipelines | Bitbucket API | Bitbucket API | API trigger |
.buildkite/pipeline.yml | Buildkite | buildkite-agent or API | API | bk build retry |
azure-pipelines.yml | Azure Pipelines | az pipelines runs show | az pipelines runs list | az pipelines run |
.travis.yml | Travis CI | Travis API | Travis API | API trigger |
Taskfile.yml + CI wrapper | Task-based | Depends on wrapper CI | Depends | Depends |
If MULTIPLE CI systems detected (e.g., GitHub Actions for CI + ArgoCD for deploy), document both.
Map the project's test stack so fixes target the right layer:
| Signal | Test Layer | Fix Strategy |
|---|---|---|
pytest.ini / pyproject.toml [tool.pytest] | Python unit/integration | Fix Python code, run pytest locally |
jest.config.* / vitest.config.* | JS/TS unit tests | Fix JS/TS code, run npm test locally |
playwright.config.* / cypress.config.* | E2E tests | May need running services, check docker-compose |
ruff.toml / .flake8 / .eslintrc.* | Linting | Auto-fix with ruff check --fix / eslint --fix |
mypy.ini / tsconfig.json | Type checking | Fix type annotations |
Dockerfile / docker-compose.test.yml | Containerized tests | Build container first, then run |
tox.ini | Multi-env Python testing | Run specific tox env |
Makefile with test targets | Make-based | Run make test |
CI often fails because of environment differences. Check:
# What Python/Node/Go version does CI use?
grep -r "python-version\|node-version\|go-version" .github/workflows/ .gitlab-ci.yml 2>/dev/null
# What services does CI spin up? (postgres, redis, etc.)
grep -r "services:" .github/workflows/ 2>/dev/null
grep -r "image:" .gitlab-ci.yml 2>/dev/null
# What env vars does CI set?
grep -r "env:" .github/workflows/ 2>/dev/null | grep -v "#"
# What secrets are used?
grep -r "secrets\." .github/workflows/ 2>/dev/null
Before investigating a failure, check if it's a known issue:
# Check past CI fix incidents
grep -l "ci-fix\|CI\|flaky" .claude/qa-knowledge/incidents/ 2>/dev/null
# Check knowledge base for CI patterns
cat .claude/knowledge/skills/ci-fix.md 2>/dev/null | grep -A3 "## Patterns"
If a known flaky test matches the failure, report it instead of debugging.
triage (Phase 1, item 1.5)If DECISIONS_MODE_RESOLVED is off, skip this block — Step 5 ends here, exactly as today. Otherwise the triage gate decides whether the failure gets ONE confirmatory rerun before any investigation (contract skills/_lib/decisions-guard.md §10; question file skills/_lib/decisions/triage.json, act 0.8). The gate needs the failing job's log tail: CI_LOG_TAIL is the file Step 1's --log-failed … | tail -200 output was saved to (staging/prod: the deploy/health log), RUNNER the runner detected in Step 3 (pytest|jest|vitest|playwright|other), FAILED_CMD the failing step's command, FAILED_EXIT its exit code (1 when unknown).
First reuse the hook's answer when it is already in the log — hooks/post-test-summary.sh prints one TEST TRIAGE (decisions): <cause> <conf> line per failing local run — otherwise ask the gate (one trivial command per line):
TRIAGE_LINES=$(grep -o 'TEST TRIAGE (decisions): .*' "$CI_LOG_TAIL")
TRIAGE_LINE="${TRIAGE_LINES##*$'\n'}"
If $TRIAGE_LINE is non-empty, TOKEN is decision= + the text after TEST TRIAGE (decisions): (most recent line wins) and IDS is {} (the hook's row already exists; no back-fill from here). Otherwise:
DECISION=$(bash "$(echo "${CLAUDE_PLUGIN_ROOT}" | sed 's|^$|.claude|')/skills/_lib/decisions-state.sh" triage --mode "$DECISIONS_MODE_RESOLVED" --skill ci-fix --step 5 --runner "$RUNNER" --command "$FAILED_CMD" --exit "$FAILED_EXIT" --output "$CI_LOG_TAIL" --is-ci)
TOKEN="${DECISION%%$'\n'*}"
IDS="${DECISION#*ids=}"
$DECISION is exactly two lines: decision=<token> then ids=<json qid→decision_id>. decisions-state.sh prints a cause only at or above triage.json's act threshold (0.8); anything below is uncertain. The rerun rule:
$TOKEN | Action |
|---|---|
decision=flaky_timing <conf> · decision=env_or_infra <conf> · decision=runner_gone <conf> | ONE rerun before any investigation: gh run rerun <FAILED_RUN_ID> --failed (CI mode) or re-run $FAILED_CMD once (staging/prod), wait for the result as in Step 4. Rerun green → done, report "flaky (decisions: ), rerun passed", no attempt consumed. Rerun red → back-fill, then investigate from Attempt 1 exactly as today. |
decision=real_regression <conf> · decision=dependency_or_install <conf> | Skip the rerun — go straight to Attempt 1's investigation (Step 1 → Step 2). |
decision=uncertain · decision=shadow · decision=fallback · decision=off | Today's path unchanged: the known-flaky grep above decided; investigate. |
The rerun is not one of the 3 attempts; the 3-attempt structure below is untouched. After the rerun completes (either result), back-fill the row — only when $IDS is not {}:
bash "$(echo "${CLAUDE_PLUGIN_ROOT}" | sed 's|^$|.claude|')/skills/_lib/decisions-state.sh" outcome triage --ids "$IDS" --rerun "{passed|failed}"
Parse from arguments:
ci → CI mode — fix GitHub Actions lint/test/build failuresstaging → Staging mode — investigate + fix staging deployment failuresprod / production → Prod mode — investigate + fix production deployment failures--decisions off|shadow|enforce — per-invocation override of the Arth Decisions mode (ladder: flag → ARTH_DECISIONS_MODE env → project .claude/qa-config.json → .claude/.arth-decisions.env → global ~/.arthai/config.json; see skills/_lib/decisions-guard.md §3). Resolved once in A1-J via decisions.sh mode. off is byte-identical to today. Unknown value → warn and treat as unset.Resolve the Arth Decisions mode after the mode/arguments above are parsed and before the A1 mode line prints (ladder + semantics: skills/_lib/decisions-guard.md §3). DECISIONS_FLAG is the value of --decisions (empty when absent):
DECISIONS_MODE_RESOLVED=$(bash "$(echo "${CLAUDE_PLUGIN_ROOT}" | sed 's|^$|.claude|')/skills/_lib/decisions.sh" mode --decisions "${DECISIONS_FLAG:-}" 2>/dev/null || echo off)
This is the only Arth Decisions call in Phase 0 (a missing wrapper resolves to off); the gates arrive in later phases and must read DECISIONS_MODE_RESOLVED rather than re-resolving. The A1 mode line prints · Arth Decisions: {DECISIONS_MODE_RESOLVED} on every variant, and the routing trace's Why: line carries Arth Decisions: {DECISIONS_MODE_RESOLVED} whenever it is not off.
Minimal dim-line form per skills/_lib/mode-line.md (one dominant flow, no ladder): increment usage and print one line.
COUNT=$(bash "$(echo "${CLAUDE_PLUGIN_ROOT}" | sed 's|^$|.claude|')/skills/_lib/usage-counter.sh" increment ci-fix)
⚙️ /ci-fix {MODE} · {branch} · Arth Decisions: {DECISIONS_MODE_RESOLVED}
Failure detected → /ci-fix invoked
→ Determine mode (CI / staging / prod)
→ Attempt 1: diagnose → fix → verify → push/redeploy
→ Green? DONE
→ Still failing? Attempt 2 (different strategy)
→ Attempt 2: re-diagnose → fix → verify → push/redeploy
→ Green? DONE
→ Still failing? Attempt 3 (escalate approach)
→ Attempt 3: deep investigation → fix → verify → push/redeploy
→ Green? DONE
→ Still failing? → Discord alert + QA incident file
Fix GitHub Actions lint, type, test, and build failures.
BRANCH=$(git branch --show-current)
gh run list --branch "$BRANCH" --limit 5 --json databaseId,conclusion,status,name
Get failed run logs:
gh run view <FAILED_RUN_ID> --log-failed 2>&1 | tail -200
| Category | Indicators | Fix Strategy |
|---|---|---|
| Lint | ruff/eslint errors | Auto-fix tools scoped to specific directories |
| Type errors | tsc/mypy failures | Read error file:line, fix type annotation |
| Test failures | pytest/jest failures | Read failing test + source, fix root cause |
| Build failures | build errors | Read error, fix import/export/config |
| Migration | Alembic/Django errors | Fix migration file |
| Dependency | pip/npm install failures | Fix requirements/package.json |
| Toolkit tests | 15/20-skill-runtime-safety, manifest-coverage | See Toolkit Test Fixes below |
When CI fails on the mechanical test suite (tests/run.sh), these are the common failures and auto-fixes:
| Test | Failure message | Root cause | Auto-fix |
|---|---|---|---|
20-skill-runtime-safety | "regex-unsafe [brackets] in descriptions" | SKILL.md description: or arguments: field contains [text] | Replace [text] with <text> in the frontmatter field. Brackets break regex matching in Claude Code. |
20-skill-runtime-safety | "Skills missing required frontmatter fields" | SKILL.md missing user-invocable: true or arguments: | Add missing field to the YAML frontmatter between --- markers. Check git show HEAD~1:path/to/SKILL.md for the original. |
15-manifest-coverage | "entries mapped to categories" | New file in portable.manifest not listed in any get_category_items() category in install.sh | Add the manifest entry to the appropriate category in install.sh:get_category_items(). |
15-manifest-coverage | "Install creates all expected symlinks" | New file in portable.manifest but install didn't create the symlink | Usually follows from the category mapping fix above. |
15-manifest-coverage | "Entry counts are consistent" | Mismatch between manifest entries and installed files | Check that new manifest entries have matching source files. |
19-brownfield-assessment | "classify_file returns IDENTICAL" | Agent fixture is stale after editing an agent .md file | Update fixture: cp agents/{name}.md tests/fixtures/claude-setups/poweruser/.claude/agents/ |
Auto-fix sequence for toolkit tests:
# 1. Get the exact failure
gh run view <ID> --log-failed 2>&1 | grep -E "FAIL|✗" | head -5
# 2. For bracket issues — find and fix ALL bracket descriptions
grep -rn 'description:.*\[' skills/*/SKILL.md
# Replace [text] with <text> in each match
# 3. For missing frontmatter — compare against last known good
git show HEAD~1:path/to/SKILL.md | head -6
# Restore missing fields
# 4. For manifest coverage — add to install.sh categories
grep "get_category_items" install.sh
# Add new entries to the right category
# 5. Verify locally before pushing
bash tests/run.sh --suite 15,20 --scenario a
Attempt escalation:
Run ONLY the checks that failed — use commands from CLAUDE.md Test Commands table.
git add <only_changed_files>
git commit -m "$(cat <<'EOF'
fix: <category> — <what was fixed>
Co-Authored-By: Claude <[email protected]>
EOF
)"
git push
Wait for CI result (Monitor-aware):
# Prefer event-driven over polling — zero token cost while idle
if [ -f ".claude/monitors/github-ci.json" ]; then
echo "Monitor configured — waiting for GitHub Actions completion event (event-driven, zero-cost while idle)"
# Claude Code Monitor fires when workflow_run.completed arrives for this branch.
# No sleep needed — the agent wakes only when CI finishes.
else
# Fallback: poll after a fixed delay
sleep 90 && gh run list --branch "$BRANCH" --limit 1 --json conclusion,status
fi
Investigate and fix staging deployment failures.
Same as staging but with extra caution:
git revert HEAD --no-edit && git pushmcp__discord-mcp__send-message(
channel: "deployments",
message: "Auto-Fix Failed — 3 attempts exhausted\n\nMode: {mode}\nBranch: {branch}\nError: {last_error_summary}\n\nAction needed: Manual review required."
)
Create .claude/qa-knowledge/incidents/{date}-autofix-exhausted-{slug}.md with root cause, how QA missed it, and regression test recommendation.
Auto-fix exhausted after 3 attempts ({mode} mode) on `{branch}`.
QA incident logged.
Manual review required.
After all fix attempts (success or exhaustion), spawn the completion-verifier agent (subagent_type="completion-verifier", model="sonnet"):
SKILL_NAME: ci-fix
FEATURE_NAME: {branch or ci-run-slug}
PLAN_PATH: .claude/plans/{feature-name}.md (if applicable)
SPEC_PATH: .claude/specs/{feature-name}.md (if applicable)
FAILURE_LOG: .claude/knowledge/shared/completion-failures.jsonl
AUTO_FIX: false
Wait for output. Display verbatim — PASS, GAPS FOUND, or INCONCLUSIVE. Do NOT block on gaps. User decides whether to rerun.
# type: ignore or # noqa to suppress errors — fix them properlyrailway up or equivalent — always push to git for auto-deployAfter every fix (or on first run), check for CI best practices:
CI recommendations for {project}:
⚠ No dependency caching — CI runs will be slow
Add: actions/cache for node_modules / .venv / cargo
⚠ No test parallelism — tests run sequentially
Add: pytest-xdist / jest --workers / go test -parallel
⚠ No test timeout — flaky tests can hang forever
Add: timeout-minutes in workflow / pytest --timeout=30
⚠ No retry for flaky tests — one flake fails the whole run
Add: pytest-rerunfailures / jest --retry
⚠ Services not health-checked — tests may start before DB is ready
Add: health check options to service containers
⚠ No artifact upload on failure — can't debug after the run
Add: actions/upload-artifact for test reports on failure
Protocol: Read small files fully (Tier 1). For directories, grep first, read only matches (Tier 2). Skip gracefully if missing. Only write back when something NEW is discovered.
knowledge/skills/ci-fix.md — past failure patternsqa-knowledge/incidents/ — grep for CI-related incidents, read matching onlyknowledge/skills/ci-fix.md:
### {date} — {failure type}
**CI Platform**: {platform}
**Category**: {lint | type | test | build | migration | dependency | flaky}
**Root cause**: {what was wrong}
**Fix**: {what was done}
**Attempts**: {N}
**Was it a known pattern?**: {yes — matched incident X | no — new pattern}
**Prevention**: {how to avoid next time}
kg-write.sh domain "CI fix: {category} — {root_cause}" "ci-fix"qa-knowledge/bug-patterns.md under CI section
kg-write.sh domain "CI pattern: {pattern}" "ci-fix"qa-knowledge/incidents/{date}-ci-exhaust-{slug}.md
kg-write.sh domain "CI exhaustion: {slug} — {root_cause}" "ci-fix"KG_WRITE="${CLAUDE_PLUGIN_ROOT}/skills/knowledge-graph/kg-write.sh" # plugin install: Claude Code substitutes the root at load
[ -f "$KG_WRITE" ] || KG_WRITE=".claude/skills/knowledge-graph/kg-write.sh" # symlink install
[ -f "$KG_WRITE" ] && "$KG_WRITE" domain "{one-line summary}" "ci-fix"
If a KG node from Step 1 matched the current failure (a known pattern), reinforce it.
When /calibrate runs, it reads CI configuration to understand the project's test pipeline.
The /ci-fix skill contributes:
If /calibrate hasn't run, /ci-fix does its own discovery and recommends running /calibrate.
If /calibrate has run, /ci-fix reads the profile instead of re-discovering.
Instead of manually running /ci-fix after a CI failure, you can register a Monitor watcher
that automatically detects CI failures and loops through the full fix → resubmit → verify cycle.
[CI failure event fires]
│
▼
[Monitor wakes /ci-fix agent]
│
├─► Diagnose failure (gh run view --log-failed)
├─► Classify + fix (scoped to failing files only)
├─► Verify locally (run only failing checks)
├─► Commit + push
│
▼
[Monitor watches NEW CI run]
│
├─► Green? → Done. Discord notification.
└─► Still red? → Attempt 2 (different strategy)
→ Attempt 3 (deep investigation)
→ 3 exhausted? → Discord alert + QA incident
Create .claude/monitors/github-ci.json:
{
"name": "github-ci-failure-watcher",
"description": "Wake /ci-fix agent when GitHub Actions fails — auto-remediation loop",
"trigger": "webhook",
"endpoint": "/webhooks/github",
"filter": "$.action == 'completed' AND $.workflow_run.conclusion == 'failure' AND $.workflow_run.head_branch != 'main'",
"skill": "ci-fix",
"args": "ci {{$.workflow_run.head_branch}}"
}
GitHub webhook setup (one-time per repo):
claude monitor endpoint or Cowork Dispatch URL)application/jsonWorkflow runs (or "Send me everything")After each fix push, /ci-fix re-registers a single-fire watcher for the next run result:
{
"name": "ci-fix-verify-{{branch}}-{{timestamp}}",
"trigger": "webhook",
"endpoint": "/webhooks/github",
"filter": "$.workflow_run.head_branch == '{{branch}}' AND $.workflow_run.conclusion != null",
"skill": "ci-fix",
"args": "ci {{branch}} --verify-only --attempt {{N}}"
}
This single-fire watcher expires after it fires once, preventing duplicate executions.
The 3-attempt limit applies within a single /ci-fix session. Without a state file,
each Monitor-triggered invocation starts fresh — a persistently broken branch could
spawn unbounded agents if CI keeps failing after each fix push.
To prevent this, /ci-fix persists attempt state to .claude/monitors/.ci-fix-state.json:
{
"feature/my-branch": {
"attempts": 2,
"last_attempt": "2024-01-15T10:30:00Z",
"last_error": "test failure in auth.test.ts"
}
}
On Monitor-triggered invocation, read this file first:
attempts >= 3 for this branch: skip remediation, send Discord alert, exitThis ensures the 3-attempt guard persists across Monitor-triggered sessions.
Use the shared skills/_lib/shipping.py helper (plugin: $CLAUDE_PLUGIN_ROOT/skills/_lib/,
compiled project: .claude/skills/_lib/) for deterministic retry state on both hosts.
Run --project <root> status --branch <branch>, then begin --branch <branch> --error "<actual summary>" before each attempt. It shares the state above and its
.ci-fix-state.lock directory, preserves authored fields and refuses exhausted/corrupt
state. Only after observing green CI for current HEAD run green --branch <branch> --run-id <actual-successful-run-id> --head <exact-head>. Never reset from local checks
alone. Do not duplicate these mutations with inline JSON writes.
The Monitor loop is opt-in. Running /ci-fix manually works exactly as before.
Monitor upgrades the workflow when configured — it doesn't break the manual path.
| Approach | Tokens per fix cycle | Latency |
|---|---|---|
| Manual: check every 5 min | ~500 tokens/poll × N polls | Up to 5 min delay |
| Monitor: event-driven | 0 tokens while waiting | <1s after CI finishes |
After CI turns green (or after 3-attempt exhaustion), print this block verbatim:
─────────────────────────────────────────────
💡 Context tip — /ci-fix accumulates CI logs, fix diffs, and retry output.
Multiple failed attempts especially pollute context with dead ends.
CI fixed on attempt 1?
Low context pressure — continue or /compact focus on CI fix — {category} resolved.
CI fixed on attempt 2 or 3?
Context is noisy with failed approaches. /clear before starting the next task.
Write a brief: "Continue work on {branch} — CI is now green."
3 attempts exhausted, manual investigation needed?
ALWAYS start a fresh /clear session — the failed attempts actively mislead.
Brief: "Investigate CI failure on {branch}: {last_error_summary}"
If attempt 2 is about to fail the same way as attempt 1:
Rewind (Esc Esc) to before attempt 1. Re-prompt with a different strategy.
Don't accumulate failed fix context — each bad attempt makes the next harder.
─────────────────────────────────────────────
Modeled at ~5-25 units per attempt × up to 3 attempts. From toolkit cost audit (2026-05-06).
Spawn ladder (per attempt):
Per attempt: ~5-15 units (inline) or ~21 units (with troubleshooter spawn).
Optimizations (see audit): AUTO_LITE_ON_TRACEBACK (auto-lite when explicit traceback present), SEQUENTIAL_REVIEW_SWARM (2nd reviewer only if 1st flags issues).
Tier weights: Haiku=1, Sonnet=7, Opus=50.
Files this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub arthtech-ai/sarathi --plugin scalpel3 commands in this plugin
/fixFormal bug fix pipeline — root cause analysis, scope lock, behavior contract, differential testing, regression proof. Usage: /fix <description|#issue> <--severity critical|high|medium|low> <--hotfix|--lite|--lite-strict|--verified|--full|--swarm> <--decisions off|shadow|enforce>/issueCreate, close, list, and remind on GitHub issues. Usage: /issue <title>, /issue close #N, /issue list, /issue remind2 plugins in one repository ship this exact command · first indexed Dec 1, 2026
Other plugins' commands for the same job