154 lines
4.7 KiB
Markdown
154 lines
4.7 KiB
Markdown
---
|
|
name: ask-claude
|
|
description: "Invoke Claude (any agent or model) for an opinion, review, or analysis. Use when the user asks you to ask a specific Claude about something specific — e.g. trade-offs of an approach, a focused review, or a second opinion."
|
|
---
|
|
|
|
# Ask Claude
|
|
|
|
Use `ask_claude` to consult Claude with any combination of agent, model, question, and prompt.
|
|
|
|
## Parameters
|
|
|
|
| Parameter | Required | Description |
|
|
|-----------|----------|-------------|
|
|
| `prompt` | yes | The content for Claude to reason about (context, code, plan, bug report, etc.) |
|
|
| `question` | no | What specifically to ask — prepended as a focused review directive |
|
|
| `agent` | no | Agent name from `~/.claude/agents/`. See **Available agents** below. |
|
|
| `model` | no | Override the model: `"opus"`, `"sonnet"`, `"haiku"` |
|
|
| `session_id` | no | Resume a prior conversation (returned in every response) |
|
|
|
|
If neither `agent` nor `model` is set, defaults to Claude Sonnet.
|
|
|
|
> **Multi-turn:** Every response includes a `session_id`. Pass it back in a subsequent `ask_claude()` call to continue the same conversation with the same agent/model.
|
|
|
|
## Available agents
|
|
|
|
See `~/.claude/agents/` for the full list. Common agents:
|
|
|
|
| Agent | Model | Tools | Use when |
|
|
|-------|-------|-------|----------|
|
|
| `plan_review` | Opus | Read, Bash | Reviewing plans for correctness, completeness, feasibility, and risk |
|
|
| `code_review` | Sonnet | Read, Bash, Edit, Write | Reviewing implementations; can apply fixes directly |
|
|
| `debug` | Sonnet | Read, Bash | Tracing bugs and root causes; will NOT apply fixes |
|
|
| `oracle` | Opus | Read, Bash | Hard problems, architectural decisions, when you're stuck |
|
|
|
|
Pick the agent that matches the task. If unsure, ask the user which agent to use, or use a raw `model=` instead of an agent.
|
|
|
|
## Common patterns
|
|
|
|
### Plan review
|
|
```
|
|
ask_claude({
|
|
agent: "plan_review",
|
|
question: "Review for correctness, completeness, feasibility, and risk. Highlight missing steps or unclear requirements.",
|
|
prompt: `
|
|
## Project Context
|
|
[Key facts from CLAUDE.md]
|
|
|
|
## Codebase Exploration
|
|
[Modules/files you read]
|
|
|
|
## Implementation Plan
|
|
[Your full plan, step by step]
|
|
|
|
## Open Questions
|
|
[Anything uncertain]
|
|
`
|
|
})
|
|
```
|
|
|
|
### Code review (with fix capability)
|
|
```
|
|
ask_claude({
|
|
agent: "code_review",
|
|
question: "Review for bugs, architectural issues, style, and correctness. Apply fixes for any issues you find.",
|
|
prompt: `
|
|
## Project Conventions
|
|
[Relevant context not in CLAUDE.md]
|
|
|
|
## What Was Implemented
|
|
[Brief description]
|
|
|
|
## Plan That Was Followed
|
|
[The implementation plan]
|
|
|
|
## Files Changed
|
|
- path/to/file.ts — [what changed]
|
|
|
|
## Code to Review
|
|
[Paste key sections OR instruct the agent to read the files above]
|
|
`
|
|
})
|
|
```
|
|
|
|
### Debugging
|
|
```
|
|
ask_claude({
|
|
agent: "debug",
|
|
question: "Trace the root cause. Provide specific file paths, line numbers, and the exact code responsible. Suggest a fix but do not apply it.",
|
|
prompt: `
|
|
## The Issue
|
|
[What's happening vs. what should happen]
|
|
|
|
## Error Output
|
|
[Any logs, stack traces, or error messages]
|
|
|
|
## Relevant Files
|
|
- path/to/file.ts — [why it's relevant]
|
|
|
|
## What I've Already Tried
|
|
[Hypotheses tested, things ruled out]
|
|
`
|
|
})
|
|
```
|
|
|
|
### Oracle (hard problems)
|
|
```
|
|
ask_claude({
|
|
agent: "oracle",
|
|
question: "Analyze this problem and provide guidance. Explain your reasoning and recommend the best path forward.",
|
|
prompt: `
|
|
## The Problem
|
|
[What you're trying to solve and why it's hard]
|
|
|
|
## Codebase Context
|
|
[Relevant files, modules, and patterns explored]
|
|
|
|
## Options Considered
|
|
[Approaches evaluated and their trade-offs]
|
|
|
|
## What I Need Clarified
|
|
[Specific question or decision point]
|
|
`
|
|
})
|
|
```
|
|
|
|
### Free-form model question (no agent)
|
|
```
|
|
ask_claude({
|
|
model: "opus",
|
|
question: "What are the trade-offs of this approach vs using a message queue?",
|
|
prompt: `We're considering polling a database table every 5 seconds for new jobs instead of a queue...`
|
|
})
|
|
```
|
|
|
|
### Continuing a conversation
|
|
When Claude returns a `session_id` in its response, pass it back to continue the same conversation:
|
|
```
|
|
ask_claude({
|
|
agent: "code_review",
|
|
question: "Apply the fixes you identified.",
|
|
session_id: "<session_id from prior response>",
|
|
prompt: "Please proceed with the fixes."
|
|
})
|
|
```
|
|
|
|
## After the response
|
|
|
|
- Summarize Claude's key points for the user.
|
|
- If Claude raises blockers or important concerns, address them before proceeding.
|
|
- For plan reviews: if blockers or missing steps are flagged, update the plan and re-invoke if changes are significant.
|
|
- For code reviews: Claude (via `code_review`) may apply fixes directly — summarize what was changed.
|
|
- For debugging: apply the fix yourself or delegate to a coding agent.
|
|
- For oracle: proceed with the recommended approach, or loop back if more clarification is needed.
|