analyze-with-file

An interactive command for investigating a coding question with shared codebase exploration, several perspectives, and a written record of the discussion and conclusions.

In plain words
What is it for?
Use it for architecture reviews, implementation analysis, evaluating alternatives, exploring concepts, or preparing a structured handoff for execution.
Why use it?
It preserves how the team reached a decision and gathers the relevant findings, research, and recommendations in one place.

Command for Claude Code

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/catlog22/claude-code-workflow/analyze-with-file
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 7,050 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00019 $0.07050
Opus 5 $0.00010 $0.03525
Sonnet 5 $0.00004 $0.01410
Haiku 4.5 $0.00002 $0.00705

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

Security

Grade A, and why

analyze-with-file 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 3d 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/commands/workflow/analyze-with-file.md · 688 lines

How it starts

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

Use when: architecture review, implementation analysis, concept exploration, decision evaluation, or any multi-perspective codebase question.

Auto mode (-y): Auto-confirm decisions, use recommended angles, skip interactive scoping.

Artifacts

{projectRoot}/.workflow/.analysis/ANL-{date}-{slug}/
├── discussion.md                 # Single source of truth: rounds, decisions, synthesis, conclusions, recommendations
├── state.json                    # Session state: config, confidence, quality tracking
├── exploration-codebase.json     # Layer 1 shared discovery: files, patterns, module map
├── explorations/{perspective}.json  # Layer 2-3 per-perspective deep-dives (multi-perspective only)
├── research.json                 # External research: best practices, pitfalls, sources
└── handoff.json                  # Structured handoff (only on "执行任务")
File When Schema
discussion.md Phase 1+ All analysis content: metadata, rounds, multi-perspective synthesis, conclusions, recommendations, intent/findings coverage matrices
state.json Phase 0+ session_id, topic, depth, dimensions[], perspectives[], focus_areas[], current_round, current_phase, confidence{dimensions{}, overall, weakest, history[]}, quality{pressure_pass_done, challenge_modes_used[], stall_counter, last_findings_count, readiness_gate_passed, residual_risks[]}
exploration-codebase.json Phase 2 session_id, timestamp, topic, dimensions[], relevant_files[{path, annotation, dimensions[]}], patterns[], module_map{}, questions_for_user[], _metadata
explorations/{name}.json Phase 2 perspective, relevant_files[], key_findings[], code_anchors[{file, lines, snippet, significance}], call_chains[{entry, chain, files}], questions_for_user[], _metadata
research.json Phase 2 topic, mode, timestamp, findings[{finding, detail, confidence, source_url}], best_practices[{practice, rationale, source}], alternatives[{option, pros, cons, verdict}], pitfalls[{issue, mitigation, source}], codebase_gaps[{gap, current_approach, recommended_approach}], sources[{title, url, key_takeaway}]
handoff.json Phase 4 source, session_id, session_folder, summary, implementation_scope[{objective, rationale, priority, target_files[], acceptance_criteria[], change_summary}], code_anchors[], key_files[], key_findings[], decision_context[], exploration_artifacts{exploration_codebase, explorations, perspectives, research, deep_dives[]} — keys align with workflow-lite-plan artifactMapping

Removed from separate files (now in discussion.md): explorations.json, perspectives.json, conclusions.json. Synthesis, conclusions, and recommendations are written directly to discussion.md sections.


Read the full file on GitHub · 688 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. 3d ago First seen · 688 lines · 19 tokens per session scan A fa8b221a8679

Subscribe to this mod's changes

analyze-with-file is a command published in the GitHub repository catlog22/Claude-Code-Workflow (2,134 stars, last pushed 2mo ago), licensed MIT. It adds 19 tokens to every session and 7,050 once invoked, about $0.0001 per session on Opus 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.