query

query is a command for Claude Code from TrafficGuard/typedai. It costs 14 tokens per session (416 once invoked), scanned A, original, MIT.

A repository question-and-answer command that searches and reads source files before answering in plain language. It includes citations to the files it used.

In plain words
What is it for?
Use it to explain authentication, trace an API request through to a database response, inspect selected starting files, or ask more thorough questions with the hard-LLM option.
Why use it?
It helps you understand an unfamiliar codebase without manually locating every file involved in a system or data flow.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the code-analysis plugin — 3 commands shipped together

Good fit Use it to explain authentication, trace an API request through to a database response, inspect selected starting files, or ask more thorough questions with the hard-LLM option.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/trafficguard/typedai/query
About the project

TypedAI is a TypeScript platform for building and running AI agents, language-model workflows, and chatbots, including agents that edit code and review pull requests. Developers use it for AI chat, automation, software engineering tasks, and integrations with external tools and services. The catalogue add-ons extend its agent and workflow capabilities.

TrafficGuard/typedai · 1,196 stars · on GitHub · typedai.dev

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/TrafficGuard/typedai

Made for: Claude Code.

Or install code-analysis, the plugin that ships this one along with the rest of its 3 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for query

README.md
[![agentmods](https://agentmods.dev/badge/commands/trafficguard/typedai/query/github.svg)](https://agentmods.dev/commands/trafficguard/typedai/query)
Your own site
<a href="https://agentmods.dev/commands/trafficguard/typedai/query"><img src="https://agentmods.dev/badge/commands/trafficguard/typedai/query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for query

Your own site · 80×15
<a href="https://agentmods.dev/commands/trafficguard/typedai/query"><img src="https://agentmods.dev/badge/commands/trafficguard/typedai/query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 416 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00014 $0.00416
Opus 5.5 $0.00006 $0.00166
Sonnet 5.5 $0.00003 $0.00083
Haiku 4.5 $0.00001 $0.00042

Measured 1mo ago against content hash 14a9f35983cf, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

query scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

claude-plugins/code-analysis/commands/query.md · 61 lines

What it actually says

Query

Ask natural language questions about a codebase and receive detailed answers with citations to specific files. The agent iteratively searches and reads files to gather context before generating a comprehensive answer.

How It Works

The query agent:

  1. Analyzes the repository structure to understand the codebase
  2. Searches for relevant files using regex and/or vector search
  3. Reads and inspects files that might contain answers
  4. Synthesizes information and generates a detailed answer
  5. Includes citations to files where information was found
  6. Returns the list of files that were analyzed

Usage

query "How does the authentication system work?"

# Complex query with hard LLM (more thorough)
query -h "Explain the complete data flow from API request to database response"

# With initial files to include in context
query --initial-files=src/auth.ts,src/middleware.ts "How does this authentication flow work?"

Flags:

  • -h: Use hard LLM for complex queries (slower but more thorough)
  • --initial-files=file1,file2: Comma-separated list of initial files to include in context
  • -r: Resume from previous agent run

Output Format

Returns a detailed text answer with:

  • Comprehensive explanation answering the query
  • Citations to specific files where information was found
  • List of all files that were analyzed
  • Confidence level indicator

Example Queries

Architecture & Design:

  • "What is the overall architecture of this application?"
  • "What design patterns are used in the codebase?"

Implementation Details:

  • "How does the caching mechanism work?"
  • "Where is error handling implemented?"

Debugging:

  • "Where would authentication failures be logged?"
  • "What happens when a database connection fails?"

Notes

  • Uses multiple search strategies (file system tree with per-file summaries, regex and vector search if available)
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 61 lines · 14 tokens per session scan A 14a9f35983cf

Subscribe to this mod's changes

query is a command published in the GitHub repository TrafficGuard/typedai (1,196 stars, last pushed 10mo ago), licensed MIT. It adds 14 tokens to every session and 416 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories

review-pr

PR review using parallel specialized agents for code quality, security, testing, architecture, and performance analysis. Synthesizes findings into a review report with conventional comments (praise/issue/suggestion/nitpick) and approve or request-changes verdict. Use when reviewing pull requests, conducting security…

yonatangross/orchestkit · 69 tokens

assess

Assesses and rates quality 0-10 across multiple dimensions (correctness, maintainability, security, performance, testability, simplicity) with pros/cons analysis. Compares against project conventions and prior decisions from memory. Produces structured evaluation reports with actionable improvement suggestions. Use…

yonatangross/orchestkit · 72 tokens

iterate-plan

Revises a plan written by create-plan from its review comments or new instructions: rewrites the plan body, leaves each comment intact and bumps the revision. Use when a plan file got feedback or its scope changed; never to start a new plan.

yonatangross/orchestkit · 54 tokens

review-artifact-comments

Works through the review comments written into a task artifact (plan or research under .ork/tasks/TASK/): lists the open ones, asks how to proceed, then replies, resolves or hands off to iterate-plan or iterate-research, and approves the artifact once nothing is open. Use when a reviewer has commented on an artifact…

yonatangross/orchestkit · 82 tokens

gh-triage

GitHub OSS maintainer lifecycle triage, review, and approval management.

mastra-ai/mastra · 19 tokens

iterate-research

Re-checks the code behind a research file from create-research when a reviewer challenges a claim or the question widens, then revises its findings with fresh file:line citations, comments intact. Use after review comments on research; stays descriptive.

yonatangross/orchestkit · 54 tokens