why

why is a command for Claude Code from DojoCodingLabs/code-sensei. It costs 12 tokens per session (589 once invoked), scanned A, original, MIT.

A command that explains why the coding assistant made a particular decision or chose a specific approach.

In plain words
What is it for?
Use it to ask about a named decision or to examine the most important recent choice, including alternatives and trade-offs.
Why use it?
It helps you understand the reasoning behind recent code changes instead of accepting them without explanation.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the code-sensei plugin — 10 skills, 10 commands, 1 agent, 3 hooks shipped together

Good fit Use it to ask about a named decision or to examine the most important recent choice, including alternatives and trade-offs.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/dojocodinglabs/code-sensei/why
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/DojoCodingLabs/code-sensei

Made for: Claude Code.

Or install code-sensei, the plugin that ships this one along with the rest of its 10 skills, 10 commands, 1 agent, 3 hooks.

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 why

README.md
[![agentmods](https://agentmods.dev/badge/commands/dojocodinglabs/code-sensei/why/github.svg)](https://agentmods.dev/commands/dojocodinglabs/code-sensei/why)
Your own site
<a href="https://agentmods.dev/commands/dojocodinglabs/code-sensei/why"><img src="https://agentmods.dev/badge/commands/dojocodinglabs/code-sensei/why/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 why

Your own site · 80×15
<a href="https://agentmods.dev/commands/dojocodinglabs/code-sensei/why"><img src="https://agentmods.dev/badge/commands/dojocodinglabs/code-sensei/why.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 589 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 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.1 $0.00012 $0.00589
Opus 5.5 $0.00005 $0.00236
Sonnet 5.5 $0.00002 $0.00118
Haiku 4.5 $0.00001 $0.00059

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

Security

Grade A, and why

why 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

Copies of this mod

1 near-identical copy found in the catalogue:

  • why — 100% identical, 0 lines differ
commands/why.md · 79 lines

How it starts

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

Why

You are CodeSensei 🥋 by Dojo Coding. The user is curious about WHY Claude made a specific decision. This is the curiosity command — it means the user is thinking critically, which deserves bonus XP.

Instructions

  1. Read the user's profile from ~/.code-sensei/profile.json for belt level

  2. If the user provided a specific question (e.g., /code-sensei:why did Claude use PostgreSQL?), answer that directly

  3. If no specific question, analyze the most recent actions Claude took and identify the most significant decision that was made, then explain it

  4. Structure your explanation based on belt level:

    White/Yellow Belt:

    🤔 Why did Claude do that?
    ━━━━━━━━━━━━━━━━━━━━━━━━
    
    What Claude chose: [Simple description]
    
    Why: [Real-world analogy explanation]
    
    What else could have worked: [One alternative, simply explained]
    
    Why Claude picked this one: [The deciding factor, in plain language]
    

    Orange/Green Belt:

    🤔 Decision Breakdown
    ━━━━━━━━━━━━━━━━━━━━━
    
    Decision: [Technical name] — [simple description]
    
    Options considered:
    → [Option A]: [Pro/Con in 1 sentence each]
    → [Option B]: [Pro/Con in 1 sentence each]
    
    Why this choice: [2-3 sentence reasoning]
    
    When you'd choose differently: [Scenario where the other option wins]
    

    Blue Belt and above:

    🤔 Architecture Decision
    ━━━━━━━━━━━━━━━━━━━━━━━━
    
    Decision: [Technical description]
    
    Tradeoffs:
    | Approach | Performance | Complexity | Scalability |
    |----------|------------|------------|-------------|
    | [Chosen] | ...        | ...        | ...         |
    | [Alt 1]  | ...        | ...        | ...         |
    
    Rationale: [Engineering reasoning]
    When to revisit: [Conditions that would change this decision]
    
  5. Award curiosity bonus:

    • +10 XP for using /why (curiosity is rewarded!)
    • Update profile
  6. End with:

    🧠 Curiosity bonus! Asking "why" is how engineers think.
    ⚡ +10 XP | [Belt] — [XP]/[threshold] XP
    

Read the full file on GitHub · 79 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 · 79 lines · 12 tokens per session scan A b2a603a80870

Subscribe to this mod's changes

why is a command published in the GitHub repository DojoCodingLabs/code-sensei (16 stars, last pushed 1mo ago), licensed MIT. It adds 12 tokens to every session and 589 once invoked, about $0.0000 per session on Opus 5.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.

Related

why compared with commands from other repositories

why next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
whyDojoCodingLabs/code-senseiCommand161mo agoMITA12Claude Code
cloudflare-durable-objects:debugsecondsky/claude-skillsCommand2578d agoMITA33Claude Code
cloudflare-durable-objects:setupsecondsky/claude-skillsCommand2578d agoMITA32Claude Code
cloudflare-durable-objects:optimizesecondsky/claude-skillsCommand2578d agoMITA32Claude Code
cloudflare-workers:migratesecondsky/claude-skillsCommand2578d agoMITA32Claude Code
cloudflare-workers:optimizesecondsky/claude-skillsCommand2578d agoMITA29Claude Code
maz-ui:snippetssecondsky/claude-skillsCommand2578d agoMITA27Claude Code