code-explainer

A code-reading guide that explains functions, algorithms, and snippets in everyday language. It is intended for understanding existing code, not creating new code.

In plain words
What is it for?
Use it to walk through a function, explain an algorithm, clarify a code snippet, or learn how a file works.
Why use it?
It helps when unfamiliar code is difficult to follow or you need to understand the order and purpose of its steps.

Skill for Claude CodeCodex

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 skills/microsoft/waza/code-explainer
Any agent
npx skills add microsoft/waza --skill code-explainer
Clone the repo
git clone --depth 1 https://github.com/microsoft/waza

Made for: Claude Code, Codex.

Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,146 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.00135 $0.01146
Opus 5 $0.00068 $0.00573
Sonnet 5 $0.00027 $0.00229
Haiku 4.5 $0.00014 $0.00115

Measured 3d ago against content hash 8b01f2320b06, 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 3d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (fixtures/factorial.py, fixtures/fetch_user.js, fixtures/squares.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

examples/code-explainer/SKILL.md · 145 lines

How it starts

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

Code Explainer

A skill that explains code snippets in clear, educational language. Helps developers understand unfamiliar code, algorithms, and programming patterns.

Skill Activation Triggers

Use this skill immediately when the user asks to:

  • "Explain this code"
  • "What does this function do?"
  • "Break down this algorithm"
  • "Help me understand this snippet"
  • "Walk me through this code"
  • "What's happening in this file?"

Key Indicators:

  • User shares a code snippet and asks for explanation
  • User is confused about existing code
  • User wants to learn how something works
  • User asks "what does X do?" about code

Do NOT use when:

  • User wants to write new code
  • User wants to fix a bug
  • User wants code review with suggestions
  • User wants refactoring recommendations

Quick Reference

Property Value
Input Code snippet + optional language hint
Output Plain language explanation
Best for Learning, onboarding, code comprehension

Explanation Guidelines

Structure

A good code explanation should include:

  1. Overview - One sentence summary of what the code does
  2. Step-by-step breakdown - Walk through the logic
  3. Key concepts - Explain any patterns or techniques used
  4. Example - Show sample input/output if applicable

Tone

  • Educational and approachable
  • Avoid jargon unless explaining it
  • Use analogies when helpful
  • Assume the reader is smart but unfamiliar with this specific code

Language-Specific Tips

Language Focus On
Python List comprehensions, decorators, generators
JavaScript Async/await, closures, callbacks
SQL JOINs, subqueries, aggregations
Java OOP patterns, generics, streams

Examples

Example 1: Python Recursion

User prompt:

Explain this code:
```python
def factorial(n):
    if n <= 1:
        return 1
    return n * factorial(n - 1)

Good response:

This is a recursive function that calculates the factorial of a number.

Overview: It multiplies a number by all positive integers less than it (e.g., 5! = 5 × 4 × 3 × 2 × 1 = 120).

Step by step:

  1. Base case (if n <= 1): If n is 0 or 1, return 1 (since 0! and 1! both equal 1)
  2. Recursive case: Otherwise, multiply n by factorial(n-1)

Example: factorial(4) → 4 × factorial(3) → 4 × 3 × factorial(2) → 4 × 3 × 2 × factorial(1) → 4 × 3 × 2 × 1 = 24

Example 2: JavaScript Async/Await

User prompt:

What does this code do?
```javascript
async function fetchUserData(userId) {
  try {
    const response = await fetch(`/api/users/${userId}`);
    if (!response.ok) throw new Error('User not found');
    return await response.json();
  } catch (error) {
    console.error('Failed:', error);
    return null;
  }
}

Read the full file on GitHub · 145 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 · 145 lines · 135 tokens per session scan A 8b01f2320b06

Subscribe to this mod's changes

code-explainer is a skill published in the GitHub repository microsoft/waza (1,288 stars, last pushed 4d ago), licensed MIT. It adds 135 tokens to every session and 1,146 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

trulens-notebook-execution

Execute and display Jupyter notebooks for TruLens demos and quickstarts.

truera/trulens · 21 tokens

eli5

Explain research, papers, or technical ideas in plain English with minimal jargon, concrete analogies, and clear takeaways. Use when the user says "ELI5 this", asks for a simple explanation of a paper or research result, wants jargon removed, or asks what something technically dense actually means.

companion-inc/feynman · 63 tokens

deck-course-module

暖纸背景 + Playfair, 左侧学习目标常驻, 含 MCQ 自测页.

nexu-io/html-anything · 25 tokens

master-yinguang

Use when user asks about 印光大师, 净土, 念佛, 持名念佛, 十念法, 摄耳谛听, 老实念佛, 信愿行, 带业往生, 仗佛慈力, 自力他力, 竖出横超, 往生, 极乐, 阿弥陀佛, 净土三经, 敦伦尽分, 闲邪存诚, 因果报应, 文钞, 一函遍复, or wants teaching in 印光大师 Yinguang's voice. Triggers include "印光"、"文钞"、"老实念佛"、"信愿行"、"带业往生"、"仗佛慈力"、"横超竖出"、"都摄六根"、"净念相继"、"敦伦尽分"、"闲邪存诚"、"因果"、"十念法"、"摄耳谛听"、"一函遍复"、"净土三经"、"往生" — invoke…

xr843/Master-skill · 274 tokens

explore-unknowns

Guide the user through a quadrant walk that maps the unknowns of a task — open by listing the known knowns, then work through known unknowns, unknown knowns, and unknown unknowns one stage at a time, ending with a complete four-quadrant map in the user's hands. Use when a request is ambiguous or underspecified, the…

dzhng/skills · 162 tokens

obsidian-to-clew-import

Convert an Obsidian vault or wiki-linked markdown graph into a validated structured-learning graph package for Clew. Use when the user wants to inspect a vault, preview whether it imports cleanly, preserve explicit relation markers, choose only the few import settings that matter, and produce a fail-closed package…

miuuyy/Clew · 72 tokens