Delegate a cold code review, adversarial review, multi-turn analysis, or background task from agy to Claude Code CLI (`ask_claude` / `claude-companion.mjs`).
---
name: ask
description: Delegate a cold code review, adversarial review, multi-turn analysis, or background task from agy to Claude Code CLI (`ask_claude` / `claude-companion.mjs`).
---
# Claude Ask & Code Review
Use the `ask_claude` MCP tool (or run `"${PLUGIN_ROOT}/scripts/run-node.sh" "${PLUGIN_ROOT}/scripts/claude-companion.mjs"`):
Before sending, check that Claude has room for the job: estimate `--sessions <n>` (one session is about `--cost` %, default 5) from the task text and the workspace's open AODD task, then run `"${PLUGIN_ROOT}/scripts/run-node.sh" "${PLUGIN_ROOT}/scripts/claude-companion.mjs" route --sessions <n> --from claude --json` and read `job.decision`. `stay` runs in Claude, `alternate` recommends agy, `split` means do not send the whole job: propose a plan with `"${PLUGIN_ROOT}/scripts/run-node.sh" "${PLUGIN_ROOT}/scripts/claude-companion.mjs" plan --from claude --sessions <n> [--parts <k> | --tasks-file <json>] --json`, show the tasks and the proposal file, let the user edit it (text, sessions, provider), and send only after the user confirms with `split <proposal-file> --confirm`, and `none` means ask the user first. Use the user's number if they give one.
1. **Cold & adversarial reviews:**
* `"${PLUGIN_ROOT}/scripts/run-node.sh" "${PLUGIN_ROOT}/scripts/claude-companion.mjs" review` (`--staged`, `--base main`, `--deep`, `--background`)
* `"${PLUGIN_ROOT}/scripts/run-node.sh" "${PLUGIN_ROOT}/scripts/claude-companion.mjs" adversarial-review` (finds concrete reasons NOT to ship)
2. **Multi-turn session resume:**
* Pass `persist: true` to `ask_claude` (or `--persist`) to receive `[session_id: <id>]`, then pass `resume: "<id>"` on follow-ups.
3. **Safety:**
* Default is read-only (`Read,Grep,Glob`, or `no_tools: true` for diff-only reviews). Only pass `edit: true` / `--edit` when explicitly requested by the user.
* Recursion guard (`CC_PLUGIN_AGY_ACTIVE=1`) prevents infinite `agy -> claude -> agy` loops.