analyze

analyze is a command for coding agents from acaprino/daodan. It costs 84 tokens per session (6,809 once invoked), scanned C, original, MIT.

A command that runs the codebase X-ray analysis and produces phased documentation files. It uses language-aware tools to extract structure, classify files, and trace where symbols are used.

In plain words
What is it for?
Use it for deep analysis before code review or refactoring across Python, Java, JavaScript, TypeScript, SQL, PL/SQL, and Rust codebases.
Why use it?
It avoids relying only on manual reading when building a technical picture of an unfamiliar project. The generated files let later phases pass context in an ordered way.

Command

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the codebase-xray plugin — 1 skill, 2 commands, 5 agents shipped together

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.

agentmods
npx agentmods add commands/acaprino/daodan/analyze
Clone the repo
git clone --depth 1 https://github.com/acaprino/daodan

Or install codebase-xray, the plugin that ships this one along with the rest of its 1 skill, 2 commands, 5 agents.

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 analyze

README.md
[![agentmods](https://agentmods.dev/badge/commands/acaprino/daodan/analyze.svg)](https://agentmods.dev/commands/acaprino/daodan/analyze)
Your own site
<a href="https://agentmods.dev/commands/acaprino/daodan/analyze"><img src="https://agentmods.dev/badge/commands/acaprino/daodan/analyze.svg" alt="Measured on agentmods" height="20"></a>
Per session 84 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,809 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00084 $0.06809
Opus 5 $0.00042 $0.03404
Sonnet 5 $0.00017 $0.01362
Haiku 4.5 $0.00008 $0.00681

Measured 4d ago against content hash b3810e4e0a4c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

analyze scanned grade C with 1 finding 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 4d 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.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- `.npmrc`, `.pypirc`, `.netrc` - auth tokens
exports/claude/plugins/codebase-xray/commands/analyze.md · 648 lines

How it starts

The opening of the file, as written. The whole thing — 648 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Codebase X-Ray Analysis

CRITICAL RULES

  1. Execute phases in order. Unless --phase N skips to a specific phase.
  2. Write output files. Each phase produces a file in the run directory for context passing.
  3. Run isolation. All writes go to $RUN_DIR until the publish step. Never write phase files to the .deep-dive/ root during analysis: concurrent runs share that root.
  4. Stop at checkpoints. Confirm scope before starting analysis and before applying changes.
  5. Never enter plan mode. Execute immediately.
  6. Code is ground truth. Document what the code actually does, not what you think it should do.

Tool Integration

The scripts in ${CLAUDE_PLUGIN_ROOT}/skills/analyze/scripts/ are language-aware and support: Python, Java, JavaScript, TypeScript (incl. TSX/JSX), SQL, PL/SQL, Rust. You MUST use them instead of manual file reading whenever the target file matches one of those languages.

  • Phase 1-2 (Structure): Use ast_parser.py for class/function/import extraction and classifier.py for file classification. Do NOT attempt to parse AST manually or count imports with grep.
  • Phase 5 (Risks): Use usage_finder.py to trace symbol usages across the codebase. Multi-language: matches Python from/import, Java import, JS/TS import/require, Rust use, etc.
  • Phase 6 (Docs): Use doc_review.py for link validation and marker checks, and rewrite_comments.py for multi-language comment quality analysis (Python #/docstrings, Java/JS/TS // / /* */ / Javadoc / JSDoc, SQL/PL-SQL -- / /* */, Rust // / rustdoc).

For unsupported languages, use the Read tool and Grep tool directly. Tree-sitter is optional (see Prerequisites in the codebase-xray:analyze skill): when tree-sitter-language-pack is installed, Java/JS/TS/Rust use the tree-sitter parsers for higher fidelity; otherwise a regex fallback is used. Python always uses the stdlib ast module. SQL/PL-SQL use a regex-based DDL extractor.

Do NOT use raw bash commands (cat, grep, find) to extract structure when a dedicated script exists. The scripts use real parsers, which are faster, more accurate, and consume fewer tokens than reading files line by line.

Read the full file on GitHub · 648 lines

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. 4d ago First seen · 648 lines · 84 tokens per session scan C b3810e4e0a4c

Subscribe to this mod's changes

analyze is a command published in the GitHub repository acaprino/daodan (8 stars, last pushed 9d ago), licensed MIT. It adds 84 tokens to every session and 6,809 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.