c4-architecture

c4-architecture is a command for Claude Code from EngineerWithAI/engineerwith-agents. It costs 0 tokens per session (3,405 once invoked), scanned A, a copy of c4-architecture, MIT.

A command that documents an existing codebase using the C4 architecture model. C4 describes software at four levels: the code, its components, deployable containers such as services or databases, and the wider system context.

In plain words
What is it for?
Use it to analyze a repository from detailed code upward and produce documentation for code, components, containers, system relationships, APIs, and architecture diagrams.
Why use it?
It turns a repository’s implementation details into architecture documentation that can be understood by both technical and non-technical readers.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md).

Good fit Use it to analyze a repository from detailed code upward and produce documentation for code, components, containers, system relationships, APIs, and architecture diagrams.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/engineerwithai/engineerwith-agents/c4-architecture
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/EngineerWithAI/engineerwith-agents

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 c4-architecture

README.md
[![agentmods](https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/c4-architecture/github.svg)](https://agentmods.dev/commands/engineerwithai/engineerwith-agents/c4-architecture)
Your own site
<a href="https://agentmods.dev/commands/engineerwithai/engineerwith-agents/c4-architecture"><img src="https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/c4-architecture/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 c4-architecture

Your own site · 80×15
<a href="https://agentmods.dev/commands/engineerwithai/engineerwith-agents/c4-architecture"><img src="https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/c4-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,405 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 97% copy Near-identical to another mod 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.00000 $0.03405
Opus 5.5 $0.00000 $0.01362
Sonnet 5.5 $0.00000 $0.00681
Haiku 4.5 $0.00000 $0.00341

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

Security

Grade A, and why

c4-architecture 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 3mo 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.

Origin

This is a copy

97% identical to c4-architecture — 100 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

plugins/c4-architecture/commands/c4-architecture.md · 386 lines

How it starts

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

C4 Architecture Documentation Workflow

Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.

[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]

Overview

This workflow creates comprehensive C4 architecture documentation following the official C4 model by:

  1. Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
  2. Component Level: Synthesizing code documentation into logical components within containers
  3. Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
  4. Context Level: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)

Note: According to the C4 model, you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.

All documentation is written to a new C4-Documentation/ directory in the repository root.

Phase 1: Code-Level Documentation (Bottom-Up Analysis)

1.1 Discover All Subdirectories

  • Use codebase search to identify all subdirectories in the repository
  • Sort directories by depth (deepest first) for bottom-up processing
  • Filter out common non-code directories (node_modules, .git, build, dist, etc.)
  • Create list of directories to process

Read the full file on GitHub · 386 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. 3mo ago First seen · 386 lines · 0 tokens per session scan A 8adc8a1d2ed5

Subscribe to this mod's changes

c4-architecture is a command published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,405 tokens. A static security scan graded it A with 0 findings. It is 97% identical to c4-architecture, differing in 100 lines, and is treated as a copy.

Related

c4-architecture compared with commands from other repositories

c4-architecture next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
c4-architectureEngineerWithAI/engineerwith-agentsCommand410mo agoMITA0Claude Code
checklistgithub/spec-kitCommand153ktodayMITA13Claude Code
clarifygithub/spec-kitCommand153ktodayMITA27Claude Code
specifygithub/spec-kitCommand153ktodayMITA13Claude Code
analyzegithub/spec-kitCommand153ktodayMITA26Claude Code
convergegithub/spec-kitCommand153ktodayMITA35Claude Code
implementgithub/spec-kitCommand153ktodayMITA14Claude Code