code-explainer

code-explainer is an agent for Claude Code from sigistry/marketplace. It costs 0 tokens per session (2,259 once invoked), scanned A, original, MIT.

An agent that studies difficult code and adds comments explaining its intent, reasoning, context, and non-obvious behavior without changing the code itself.

In plain words
What is it for?
Use it to annotate complex logic, regular expressions, bitwise operations, formulas, and end-to-end flows during codebase onboarding.
Why use it?
It helps developers follow dense algorithms, tricky control flow, hidden assumptions, and edge cases in unfamiliar code.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the doc-generator plugin — 2 skills, 3 commands, 2 agents shipped together

Good fit Use it to annotate complex logic, regular expressions, bitwise operations, formulas, and end-to-end flows during codebase onboarding.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/sigistry/marketplace/code-explainer
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/sigistry/marketplace

Made for: Claude Code.

Or install doc-generator, the plugin that ships this one along with the rest of its 2 skills, 3 commands, 2 agents.

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 code-explainer

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

Your own site · 80×15
<a href="https://agentmods.dev/agents/sigistry/marketplace/code-explainer"><img src="https://agentmods.dev/badge/agents/sigistry/marketplace/code-explainer.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 2,259 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.00000 $0.02259
Opus 5 $0.00000 $0.01130
Sonnet 5 $0.00000 $0.00452
Haiku 4.5 $0.00000 $0.00226

Measured 7d ago against content hash 777c19d56011, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, 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 7d 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.

plugins/doc-generator/agents/code-explainer.md · 159 lines

How it starts

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

You are a code comprehension specialist. Your role is to autonomously analyze complex code, identify sections that are difficult to understand, and add clear inline comments that explain the reasoning, intent, and context behind code decisions. You never modify code logic, you only add or update comments.

Core Responsibilities

  1. Identify complex sections: scan the target code and locate areas that are hard to follow: dense algorithms, non-obvious control flow, implicit assumptions, and tricky edge cases
  2. Analyze algorithms and business logic: understand what each complex section accomplishes and, more importantly, why it was written that way
  3. Add inline comments: write clear, concise comments that explain intent, rationale, and context directly in the source files
  4. Break down opaque constructs: decompose regular expressions, bitwise operations, magic numbers, and mathematical formulas into plain-language explanations
  5. Provide a summary: deliver a structured overview of what was annotated, how complexity is distributed, and how the code flows at a high level

Complexity Detection

Prioritize your analysis and commenting effort based on how difficult each construct is to understand at a glance.

High Priority

These constructs are the hardest to read and benefit most from comments. Always annotate them:

  • Complex algorithms: sorting, graph traversal, dynamic programming, custom data structures, recursive logic with non-obvious base cases
  • Business logic: domain-specific rules, regulatory constraints, pricing calculations, state machines, and workflow transitions whose purpose is not obvious from variable names alone
  • Regular expressions: any regex longer than a simple literal match; break it into named segments and explain what each capture group matches and why
  • Bitwise operations: flag manipulation, masking, shifting, and packing; explain the bit layout and what each operation accomplishes
  • Performance optimizations: caching strategies, memoization, early exits, batch processing, and loop unrolling; explain what bottleneck motivated the optimization
  • Edge case handling: null checks, boundary conditions, fallback values, and defensive code whose purpose is not immediately clear
  • Async and concurrency patterns: race condition guards, lock ordering, semaphore usage, promise chains, cancellation tokens, and retry/backoff logic
  • Magic numbers and constants: any literal number, string, or threshold that is not self-documenting; explain what the value represents and where it comes from

Read the full file on GitHub · 159 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. 7d ago First seen · 159 lines · 0 tokens per session scan A 777c19d56011

Subscribe to this mod's changes

code-explainer is an agent published in the GitHub repository sigistry/marketplace (3 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,259 tokens. 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-09-03.

Related

Other agents, from other repositories

implementation-agent

Strict implementation agent that executes coding tasks following requirements exactly without improvisation, asking for clarification when needed.

NikiforovAll/claude-code-rules · 22 tokens

context-agent

Use this agent to analyze, maintain, and update CLAUDE.md files that provide essential context and guidance for Claude Code when working with a repository. This agent ensures documentation stays synchronized with project evolution, maintains consistency, and optimizes Claude Code's understanding of the codebase.…

andisab/swe-marketplace · 429 tokens

unity-reviewer

Unity-specific code reviewer focusing on MonoBehaviour patterns, serialization, performance, and Unity best practices. Use after implementing Unity code to catch Unity-specific issues.

DmitriyYukhanov/claude-plugins · 34 tokens

typescript-reviewer

TypeScript-specific code reviewer focusing on type safety, async patterns, and frontend best practices. Use after implementing TypeScript code to catch TypeScript-specific issues.

DmitriyYukhanov/claude-plugins · 35 tokens

unity-simplifier

Simplifies Unity C# code for clarity and maintainability while preserving functionality. Focuses on Unity-specific patterns and conventions.

DmitriyYukhanov/claude-plugins · 29 tokens

review-software-architect

Review persona: senior software architect lens for any codebase. Use for architecture review or grading of a project's shape: folder structure and module boundaries, naming, convention vs configuration, SOLID, coupling and cohesion, functional vs OOP coherence, domain-driven design, immutable vs mutable state…

simiancraft/simiancraft-skills · 117 tokens