arch

arch is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 14 tokens per session (6,299 once invoked), scanned C, original, MIT.

An architecture-design command that turns an approved specification into a technical design. It documents system structure, technology choices, connections between parts, diagrams, decision records, and API contracts.

In plain words
What is it for?
Use it after the complete specification has been approved and before task planning. It helps design new systems or document the architecture of an existing one.
Why use it?
It makes important design choices explicit before implementation begins. This reduces confusion about how components should fit together and how they should communicate.

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/dinhnguyenngoc/spec-driven-claude-code/arch
Clone the repo
git clone --depth 1 https://github.com/dinhnguyenngoc/spec-driven-claude-code

Made for: Claude Code.

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 arch

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/arch.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/arch)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/arch"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/arch.svg" alt="Measured on agentmods" 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 6,299 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.00014 $0.06299
Opus 5 $0.00007 $0.03150
Sonnet 5 $0.00003 $0.01260
Haiku 4.5 $0.00001 $0.00630

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

Security

Grade C, and why

arch 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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

**Service id:** <service-id> <!-- canonical key; matches Project Profile → Service id + the system service-catalog -->
.claude/commands/arch.md · 326 lines

How it starts

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

/arch — Architecture Design

"Good architecture enables agility."

Purpose

Transform requirements into technical architecture before planning implementation tasks. This ensures alignment on system design, technology choices, and integration patterns.

Workspace Mode: if the session root declares Mode: workspace → resolve the target repo per CLAUDE.md §Workspace Mode before anything else; every path, probe, and gate below is relative to the target repo, and the workspace disk-check applies at the gate.

Prerequisites

  • A specification exists (specs/SPEC.md from /spec)
  • The spec passed Gate 1 — header Status is Approved, not Draft (stop and finish /spec sign-off otherwise)
  • The spec's Coverage is full — a SPEC marked Coverage: partial (scoped) (produced by /spec --scope) → STOP: finish the baseline first (further --scope slices, or a full REVERSE). Rationale: /arch's completeness gates read the SPEC — NFR completeness cross-checks specs/SPEC.md §NFR, and the Flow-Disposition candidate list reads specs/wireframes/flows/ — so against a partial spec they would pass while covering only part of the system. That is worse than not running at all: it yields a signed-off architecture carrying false assurance. (A SPEC with no Coverage field predates the field → treated as full — backward-compatible, same convention as Output Language.)
  • Understanding of non-functional requirements (scale, performance, security)

References to Rules

The following rules provide detailed standards. The Purpose column is self-sufficient for routine design decisions — do NOT open these files wholesale at the start. Open a specific rule only when a concrete decision genuinely needs its threshold/detail (e.g., read system-design.md only when a scaling/caching choice is actually on the table). This avoids reading several large rule files on every /arch run.

Rule Purpose
principles-and-practices.md Master reference — architecture default (§3 Modular Monolith + Clean Architecture; ADR required for any deviation), NFR-dependent infrastructure (§5 opt-in triggers)
tech-stack.md Approved technologies & decision criteria
system-design.md CAP theorem, scaling, caching patterns
project-structure.md Clean Architecture layers
api-conventions.md REST standards, versioning
ascii-diagram-guide.md Diagram format — Use ASCII art for all diagrams

Read the full file on GitHub · 326 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 · 326 lines · 14 tokens per session scan C 8bdd41a99e35

Subscribe to this mod's changes

arch is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (20 stars, last pushed 5d ago), licensed MIT. It adds 14 tokens to every session and 6,299 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.