Query AI Agent

VerifiedCaution

Queries another AI agent (Claude, Codex) non-interactively and returns its response. Useful for getting a second opinion or a different perspective on a problem, executing the request synchronously via a command.

Sby Skills Guide Bot
DevelopmentBeginner
6/2/2026
Claude CodeCodex
#ask-agent#subagent-pattern#agent-query#second-opinion

Recommended for

Automated summary

Queries another AI agent (Claude or Codex) non-interactively and returns its response.

Strengths

  • Quickly get a second opinion from a different model
  • Synchronous usage with minimal blocking
  • Supports custom working directory and model selection

Limitations

  • Depends on the availability of target agents
  • No streaming, only full response
  • Requires prior setup of the agents
When to use it

When you want to cross-check an idea or code snippet with another AI agent.

When not to use it

If the target agent is not installed or an asynchronous interaction is preferred.

Security analysis

Caution
Quality score92/100

The skill runs a bash script that passes user input to external AI agent commands. While the allowed-tools is restricted, there remains risk of shell injection if the script does not robustly sanitize arguments. Additionally, the external AI agents' own safety is out of control. The skill itself does not instruct destructive actions, but caution is warranted.

Findings
  • •The skill executes shell commands based on user-supplied prompt and arguments; if the agent-query.sh script does not properly sanitize inputs, it could be vulnerable to command injection.
  • •Invoking external AI agents could lead to unpredictable or potentially harmful responses, though the skill only returns the response text without executing it.
How this analysis is made

Examples

Second opinion on authentication approach
/ask-agent codex "What do you think of using JWT for this auth flow?"

name: ask-agent description: Ask another AI agent a question and get the response back (subagent pattern) argument-hint: <agent> [options] <prompt> allowed-tools: Bash(~/.codex/skills/ask-agent/scripts/*)

ask-agent

Query another AI agent non-interactively and get the response back. Use this when you want a second opinion from a different agent (Claude, Codex, etc.).

Usage

/ask-agent <agent> [options] <prompt>

Arguments

  • <agent>: The agent to query (claude, codex)
  • <prompt>: The question or request for the agent

Options

  • -d, --dir <dir>: Set working directory for the agent
  • -m, --model <model>: Specify model (agent-specific)

Instructions

When this skill is invoked, run the agent-query.sh script:

~/.codex/skills/ask-agent/scripts/agent-query.sh <agent> [options] <prompt>

The script will:

  1. Run the specified agent in non-interactive/print mode
  2. Return the agent's response

Report the response back to the user.

Examples

# Get Codex's opinion on an approach
/ask-agent codex "What do you think of using JWT for this auth flow?"

# Ask Claude with a specific model
/ask-agent claude -m opus "Review this error handling pattern"

# Query from a specific directory
/ask-agent codex -d ./src "Explain what the auth module does"

Agent CLI Mappings

| Agent | Non-interactive command | |--------|------------------------| | claude | claude -p "<prompt>" | | codex | codex exec "<prompt>" |

Notes

  • Response is synchronous - the calling agent waits for the response
  • Useful for getting a second opinion or different perspective
  • Each agent has different training data and reasoning patterns

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/query-ai-agent-mma3js74/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/query-ai-agent-mma3js74' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/query-ai-agent-mma3js74/download' --output '.skill-downloads/query-ai-agent-mma3js74/SKILL.md.part' && mv '.skill-downloads/query-ai-agent-mma3js74/SKILL.md.part' '.skill-downloads/query-ai-agent-mma3js74/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash(~/.codex/skills/ask-agent/scripts/*)

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/query-ai-agent-mma3js74/SKILL.md' && test -s '.skill-downloads/query-ai-agent-mma3js74/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/ask-agent' && cp -R '.skill-downloads/query-ai-agent-mma3js74' '.claude/skills/ask-agent'

Codex
test -f '.skill-downloads/query-ai-agent-mma3js74/SKILL.md' && test -s '.skill-downloads/query-ai-agent-mma3js74/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/ask-agent' && cp -R '.skill-downloads/query-ai-agent-mma3js74' '.agents/skills/ask-agent'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/query-ai-agent-mma3js74'

openskills read 'query-ai-agent-mma3js74'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/query-ai-agent-mma3js74/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills