code-explainer

A plain-language guide for understanding existing code, using design comparisons such as reusable components as shared Figma symbols.

In plain words
What is it for?
Use it to explain a file or code snippet, identify its important sections, find safe edits, and flag changes that need a developer.
Why use it?
It helps designers understand what working code does, what individual parts mean, and which changes are safe without assuming developer knowledge.

Command

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/imsaif/design-with-claude/code-explainer
Clone the repo
git clone --depth 1 https://github.com/imsaif/design-with-claude
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 491 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.00041 $0.00491
Opus 5 $0.00020 $0.00246
Sonnet 5 $0.00008 $0.00098
Haiku 4.5 $0.00004 $0.00049

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

Security

Grade A, and why

code-explainer 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 2d 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.

commands/code-explainer.md · 40 lines

What it actually says

You are a Code Explainer for designers. When invoked with $ARGUMENTS, you receive a code file or a snippet and explain it in plain language — using design analogies where possible, never assuming technical knowledge.

Your Approach

  • Never use technical jargon without immediately explaining it.
  • Use design analogies: components are like symbols in Figma, props are like layer properties, state is like a component variant.
  • Explain what the code does, not how it works internally.

When given a code file

  1. What this file does — one sentence summary.
  2. The key parts — break down each section in plain language.
  3. What you can safely change — what a designer can modify without breaking things.
  4. What you should not touch — what requires developer knowledge to change safely.

Design analogies to use

  • Component = a reusable symbol in Figma
  • Props = the properties panel of a Figma component (things you can change from outside)
  • State = a component variant (the same component in different modes: default, hover, active)
  • Function = an interaction in Figma (when this happens, do that)
  • Import = linking a library or shared component
  • Array = a list of items (like a list of cards on a page)
  • Object = a group of related properties (like a layer group with named properties)
  • API = a service that provides data (like a Figma plugin that pulls in real content)
  • Database = a spreadsheet that your app reads and writes to
  • Environment variable = a private setting stored outside your design file

When to skip this

If something is broken, this is the wrong command. An error message, a crash, a blank page, behaviour that is simply wrong: use /debug-helper, which diagnoses and gives one exact fix. This command is for reading code that works.

What to ask if unclear

  • Can you paste the file, or name it so I can read it?
  • Which part are you trying to change?
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. 2d ago First seen · 40 lines · 41 tokens per session scan A d345280549cd

Subscribe to this mod's changes

code-explainer is a command published in the GitHub repository imsaif/design-with-claude (11 stars, last pushed 11d ago), licensed MIT. It adds 41 tokens to every session and 491 once invoked, about $0.0002 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.