explain-code

A code explanation tool that turns source code into plain structured descriptions and Excalidraw diagrams. Excalidraw is a browser-based drawing format with a hand-drawn style.

In plain words
What is it for?
It helps explain functions and classes and create class, flow, entity-relationship, component, feature, and sequence diagrams.
Why use it?
It makes unfamiliar code structure, relationships, and execution flow easier to understand than reading files alone.

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

Made for: Claude Code, Codex.

Per session 111 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,121 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.00111 $0.02121
Opus 5 $0.00056 $0.01060
Sonnet 5 $0.00022 $0.00424
Haiku 4.5 $0.00011 $0.00212

Measured yesterday against content hash 96583b787bb8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

explain-code 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 yesterday.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/generate_diagram.py, scripts/validate_excalidraw.py, scripts/validate.sh), 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.

explain-code/SKILL.md · 321 lines

How it starts

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

Code Visualizer with Excalidraw

Explain source code through structured text explanations and hand-drawn style Excalidraw diagrams.

About Excalidraw

  • Open source at excalidraw.com and GitHub
  • Hand-drawn/sketchy aesthetic
  • Real-time collaboration support
  • Browser-based, no sign-up required
  • .excalidraw JSON format
  • Embeddable via @excalidraw/excalidraw npm package

Workflow

  1. Receive code input with optional context
  2. Analyze code structure, patterns, and flow
  3. Select appropriate diagram type(s)
  4. Generate text explanation with key insights
  5. Create .excalidraw JSON diagram
  6. Output to user's working directory or specified location

Input Handling

Accept code in these formats:

<code language="python">
def example():
    pass
</code>

Or with context:

<code language="typescript" context="Authentication module for REST API">
...
</code>

Or request type:

<request type="class_diagram">
Visualize the User authentication system
</request>

Code Analysis

Parse and Identify

Code Element What to Extract
Functions Name, params, return type, calls
Classes Name, methods, properties, inheritance
Modules Imports, exports, dependencies
APIs Endpoints, methods, request/response
Data Models, schemas, transformations

Identify Patterns

  • Control flow (conditionals, loops, error handling)
  • Data flow (input → processing → output)
  • Design patterns (singleton, factory, observer, etc.)
  • Architecture patterns (MVC, layered, microservices)

Diagram Selection

Code Characteristic Recommended Diagram
OOP with inheritance Class Diagram
Process/algorithm logic Flow Diagram
Database models ER Diagram
System modules Component Diagram
API interactions Sequence Diagram
Feature breakdown Feature Diagram
State management State Diagram
High-level overview Architecture Diagram

Read the full file on GitHub · 321 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. yesterday First seen · 321 lines · 111 tokens per session scan A 96583b787bb8

Subscribe to this mod's changes

explain-code is a skill published in the GitHub repository Badhansen/dev-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 111 tokens to every session and 2,121 once invoked, about $0.0006 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-31.

Related

Other skills, from other repositories

loom-prometheus

Prometheus monitoring and alerting for cloud-native observability. Use for writing PromQL queries, configuring scrape targets, creating alerting and recording rules, instrumenting applications, and setting up service discovery. Not for dashboards (use loom-grafana) or log analysis (use loom-logging-observability).

cosmix/loom · 66 tokens

giil

Get Image [from] Internet Link - Zero-setup CLI for downloading full-resolution images from iCloud, Dropbox, Google Photos, and Google Drive share links. Four-tier capture strategy, browser automation, HEIC conversion, album support. Node.js/Playwright.

Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations · 56 tokens

dingtalk_channel_connect

Use a headed browser to automatically complete DingTalk channel integration for QwenPaw. Applicable when the user mentions DingTalk, developer console, Client ID, Client Secret, bot, Stream mode, binding or configuring a channel. Supports pausing when a login page is detected and resuming after the user logs in.

agentscope-ai/QwenPaw · 69 tokens

browser_cdp

当用户明确希望连接到已运行的 Chrome 浏览器、扫描本地 CDP 端口、显式指定 cdpport,或让多个 agent / 工具共享同一个浏览器时,使用本 skill。browser 默认不开放调试端口;仅当用户明确希望其他本地工具附加时才显式传入 cdpport。.

agentscope-ai/QwenPaw · 85 tokens

browser_visible

当用户需要控制 browser 的浏览器启动方式时,使用本 skill。browser 默认由 Playwright 直接管理、不开放调试端口(需让其他本地工具附加时显式传 cdpport);headed 控制是否显示窗口,privatemode 保留用于兼容、不再改变默认行为,browserargs 传入额外的 Chromium 启动参数,executablepath 指定自定义浏览器可执行文件路径。.

agentscope-ai/QwenPaw · 108 tokens

browser_visible

Use this skill when the user needs to control the browser launch mode for browser. By default browser is managed by Playwright and opens no debugging port (pass an explicit cdpport to let another local tool attach); headed controls whether the window is visible, and privatemode is kept for backward compatibility and…

agentscope-ai/QwenPaw · 75 tokens