{"slug": "triple-agent-code-review-claude-skill", "title": "\"Triple agent\" code review Claude skill", "summary": "A developer has created a \"triple agent\" code review tool called \"code-review-turbo\" that runs Cursor Bugbot, a Claude sub-agent, and Codex in parallel on a pull request, then cross-references all findings to filter out hallucinations. The tool automatically detects the PR number, creates a draft PR if needed, triggers Bugbot reviews, checks for staleness by comparing comment timestamps against the latest commit, and uses the GraphQL API to verify whether Bugbot's inline comments have been resolved. If Bugbot fails to respond within 15 minutes, the tool warns the user and asks whether to proceed or continue waiting.", "body_md": "| name | code-review-turbo | ||||\n|---|---|---|---|---|---|\n| description | Run a triple-agent code review on the current branch's PR. Waits for Cursor Bugbot, runs a Claude sub-agent and Codex in parallel, then cross-references all findings to filter out hallucinations. Use when you want a thorough, multi-perspective code review before merging. | ||||\n| metadata |\n|\n||||\n| allowed-tools | Bash(gh:*) Bash(codex:*) Bash(cat:*) Bash(tee:*) Bash(sleep:*) Agent Read Grep Glob Write(/tmp/*) |\n\nTriple-agent code review: Cursor Bugbot + Claude sub-agent + Codex, with cross-referencing to separate real bugs from hallucinations.\n\nDetermine the PR number. If `$ARGUMENTS`\n\nis provided, use that as the PR number. Otherwise, try to detect it from the current branch:\n\n```\ngh pr view --json number,isDraft -q '{number: .number, isDraft: .isDraft}'\n```\n\nCreate a **draft** PR for the current branch and comment to trigger Bugbot:\n\n```\ngh pr create --draft --fill\ngh pr comment <number> --body \"@cursor review\"\n```\n\nTell the user you created a draft PR and triggered Bugbot.\n\nCheck whether a `@cursor review`\n\nor `@bugbot review`\n\ntrigger comment already exists:\n\n```\ngh pr view <number> --json comments --jq '.comments[].body'\n```\n\nIf no trigger comment is found, add one:\n\n```\ngh pr comment <number> --body \"@cursor review\"\n```\n\nBugbot runs automatically on non-draft PRs, so no trigger comment is needed — unless the review is stale (see below).\n\nBugbot posts **one comment per issue** it finds, and resolves individual comments when the issue is fixed. So \"Bugbot has reviewed\" means there are Bugbot comments on the PR, and \"stale\" means commits were pushed after Bugbot's review pass.\n\nTo detect staleness:\n\n-\nGet the timestamps of ALL Bugbot comments (it posts multiple — one per issue):\n\n```\ngh pr view <number> --json comments --jq '[.comments[] | select(.author.login | test(\"bugbot|cursor\"; \"i\")) | .createdAt]'\n```\n\nAlso check review comments (inline on the diff):\n\n```\ngh api repos/{owner}/{repo}/pulls/<number>/comments --jq '[.[] | select(.user.login | test(\"bugbot|cursor\"; \"i\")) | .created_at]'\n```\n\n-\nGet the timestamp of the most recent commit on the PR:\n\n```\ngh pr view <number> --json commits --jq '.commits | last | .committedDate'\n```\n\n-\nIf the latest commit is\n\n**newer** than ALL of Bugbot's comments (or if Bugbot has never commented), the review is stale. Post a new trigger comment:\n\n```\ngh pr comment <number> --body \"@cursor review\"\n```\n\nTell the user: \"Bugbot's review is stale (commits landed after its last review). Triggered a fresh review.\"\n\n-\nIf Bugbot has comments that are\n\n**newer** than the latest commit, the review is current. Proceed with the existing comments.\n\nIf you triggered a fresh review (due to staleness, draft PR, or new PR), poll for Bugbot comments to appear. Run individual commands — do NOT write a bash loop:\n\n- Run\n`gh pr view <number> --json comments --jq '[.comments[] | select(.author.login | test(\"bugbot|cursor\"; \"i\"))]'`\n\n- If empty, run\n`sleep 30`\n\n- Repeat up to 30 times (15 minutes total)\n\nIf Bugbot never shows up, warn the user and ask whether to proceed anyway or keep waiting.\n\nBugbot posts inline review comments (one per issue) and resolves them when the issue is fixed. You must use the **GraphQL API** to check resolution status, because the REST API does not expose it.\n\nFirst, get the repo owner and name:\n\n```\ngh repo view --json owner,name --jq '.owner.login + \"/\" + .name'\n```\n\nThen fetch all review threads with their resolution status and filter to Bugbot/Cursor comments:\n\n```\ngh api graphql -f query='\n  query {\n    repository(owner: \"<OWNER>\", name: \"<REPO>\") {\n      pullRequest(number: <NUMBER>) {\n        reviewThreads(first: 100) {\n          nodes {\n            isResolved\n            comments(first: 10) {\n              nodes {\n                author { login }\n                body\n                path\n                line\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n'\n```\n\nFrom the result, keep only threads where:\n\n`isResolved`\n\nis`false`\n\n, AND- At least one comment has an\n`author.login`\n\nmatching`bugbot`\n\nor`cursor`\n\n(case-insensitive)\n\n**Ignore all resolved threads** — these are issues Bugbot already confirmed as fixed.\n\nAlso check top-level PR comments (these are rare for Bugbot but possible):\n\n```\ngh pr view <number> --json comments --jq '[.comments[] | select(.author.login | test(\"bugbot|cursor\"; \"i\")) | select(.isMinimized | not)]'\n```\n\nSave all active (non-resolved) Bugbot findings for later comparison.\n\nGather the PR context by running these commands:\n\n```\ngh pr diff <number>\ngh pr view <number> --json title,body,baseRefName,headRefName\n```\n\nThen construct the following review prompt (referred to as `REVIEW_PROMPT`\n\nbelow). This EXACT prompt must be used for BOTH the sub-agent and Codex — do not alter it between the two:\n\n**START OF REVIEW_PROMPT**\n\nYou are reviewing a pull request. Here is the diff:\n\nPR title: PR description: Base branch: Head branch:\n\nReview this PR thoroughly. Focus on these categories IN ORDER OF IMPORTANCE:\n\nLook for logic errors, off-by-one errors, null/undefined issues, race conditions, incorrect conditionals, missing edge cases, wrong variable usage, broken control flow, and any code that simply won't work as intended. This is BY FAR the most important category.\n\nOverly complex solutions where simpler ones exist. Unnecessary abstractions, premature generalizations, or convoluted logic.\n\nDuplicated logic that should be extracted. Copy-pasted code with minor variations.\n\nNew functionality or bug fixes lacking appropriate test coverage.\n\n- For SQL queries: DO NOT GUESS what the query planner will do. Instead, run\n`EXPLAIN ANALYZE`\n\non the actual local database to verify. - For migrations: Will they lock tables for too long? Are they safe for large tables?\n- For application code: N+1 queries, unnecessary allocations, missing batching, O(n^2) loops on large datasets.\n\nFor any TSX/JSX files: missing aria labels, improper heading hierarchy, missing alt text, keyboard navigation issues, color contrast concerns.\n\nDO NOT report:\n\n- Code formatting or style issues (these are linted automatically)\n- Minor TypeScript type issues (also linted)\n- Nitpicks that don't affect correctness or maintainability\n\nFor each issue found, report:\n\n**File and line number**(from the diff)** Severity**: critical / high / medium / low** Category**: which of the above categories** Description**: what the issue is and why it matters** Suggestion**: how to fix it\n\nReturn a structured list grouped by severity (critical first, then high, medium, low).\n\n**END OF REVIEW_PROMPT**\n\nLaunch BOTH of these at the same time (in parallel):\n\nUse the Agent tool to spawn a sub-agent with the full `REVIEW_PROMPT`\n\n. This agent should have access to Bash, Read, Grep, and Glob tools so it can run EXPLAIN queries and inspect code.\n\nRun the EXACT SAME `REVIEW_PROMPT`\n\nthrough Codex. First write the prompt to a randomly-named temp file using the Write tool (e.g., `/tmp/review-prompt-<random-8-chars>.txt`\n\n— generate a unique random suffix to avoid collisions with concurrent agents), then pipe it via stdin:\n\n```\ncodex exec --full-auto - < /tmp/review-prompt-<random>.txt\n```\n\nThe `--full-auto`\n\nflag prevents Codex from prompting for approval on shell commands (e.g., EXPLAIN queries). The `-`\n\ntells it to read the prompt from stdin.\n\n**CRITICAL: DO NOT do any of your own code research, file reading, or EXPLAIN queries until ALL THREE sub-agents (Bugbot, Claude sub-agent, Codex) have returned their results.** If you investigate the code first, you will form your own opinions and become a 4th agent with a veto over the other 3 — biased toward confirming your own findings and dismissing theirs. The whole point of this step is to be an OBJECTIVE judge of three independent reviewers.\n\nCollect and deduplicate all findings from the three agents into a single list. For each unique issue, note which agent(s) reported it. Do NOT yet judge whether the issues are real — just organize them.\n\nOnly after compiling the full list, go through each finding and verify it:\n\n**Read the actual source code** around each reported issue (not just the diff)**Run EXPLAIN ANALYZE** on any flagged SQL queries against local database**Check test files** to see if flagged \"missing tests\" actually exist**Trace the logic** for any reported functional bugs — actually verify the bug is real\n\nFor each unique issue, determine:\n\n- Is it a\n**real issue**(confirmed by your investigation)? - Is it a\n**hallucination**(the code doesn't actually have this problem)? - Which agents found it and which missed it?\n\nBe especially careful not to dismiss a finding just because only one agent reported it — sometimes the lone dissenter found the most critical bug.\n\nPresent the validated findings in this format:\n\n(issues you confirmed are real and need fixing before merge)\n\n(real issues that should be fixed)\n\n(real but lower-risk issues)\n\n(minor improvements, optional)\n\n(issues reported by agents that turned out to be hallucinations or false positives — briefly explain why each was dismissed)\n\nA table showing which agent found which real issue:\n\n| Issue | Bugbot | Claude | Codex | Verdict |\n|---|---|---|---|---|\n| ... | ... | ... | ... | ... |\n\nEnd with a clear **merge recommendation**: ready to merge, merge after fixes, or needs significant rework.", "url": "https://wpnews.pro/news/triple-agent-code-review-claude-skill", "canonical_source": "https://gist.github.com/nolanlawson/4150b0ca9640654c256b324fac0d5253", "published_at": "2026-05-27 01:11:37+00:00", "updated_at": "2026-05-27 11:42:49.398065+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-research", "ai-products", "large-language-models"], "entities": ["Cursor Bugbot", "Claude", "Codex", "GitHub", "PR", "Bugbot", "Claude sub-agent", "triple-agent"], "alternates": {"html": "https://wpnews.pro/news/triple-agent-code-review-claude-skill", "markdown": "https://wpnews.pro/news/triple-agent-code-review-claude-skill.md", "text": "https://wpnews.pro/news/triple-agent-code-review-claude-skill.txt", "jsonld": "https://wpnews.pro/news/triple-agent-code-review-claude-skill.jsonld"}}