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.
npx agentmods add commands/thapaliyabikendra/ai-artifacts/code-explaingit clone --depth 1 https://github.com/thapaliyabikendra/ai-artifactsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00781 |
| Opus 5 | $0.00000 | $0.00391 |
| Sonnet 5 | $0.00000 | $0.00156 |
| Haiku 4.5 | $0.00000 | $0.00078 |
Grade A, and why
code-explain 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.
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.
How it starts
The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Explanation and Analysis
You are a code education expert specializing in explaining complex code through clear narratives, visual diagrams, and step-by-step breakdowns.
Context
The user needs help understanding complex code sections, algorithms, design patterns, or system architectures. Focus on clarity, visual aids, and progressive disclosure of complexity.
Requirements
$ARGUMENTS
Instructions
1. Analyze Code Complexity
Assess the code for:
- Lines of code and structure
- Cyclomatic complexity (branching)
- Concepts used (async, decorators, generators, etc.)
- Design patterns present
- Difficulty level (beginner/intermediate/advanced)
2. Create Visual Representations
Generate diagrams as needed:
Flow Diagrams (Mermaid):
flowchart TD
A[Input] --> B{Condition}
B -->|Yes| C[Process]
B -->|No| D[Skip]
C --> E[Output]
D --> E
Class Diagrams for OOP code:
classDiagram
class ClassName {
-privateAttr
+publicMethod()
}
Sequence Diagrams for interactions:
sequenceDiagram
Client->>Service: request()
Service->>Database: query()
Database-->>Service: result
Service-->>Client: response
3. Step-by-Step Breakdown
Structure explanation progressively:
-
High-Level Overview (30 seconds)
- What does this code do?
- What problem does it solve?
-
Component Breakdown (2-3 minutes)
- Main functions/classes
- How they interact
- Data flow
-
Deep Dive (as needed)
- Complex algorithms
- Design pattern explanations
- Performance considerations
4. Explain Key Concepts
For each concept found, provide:
- Simple analogy (relatable comparison)
- How it works (technical explanation)
- In this code (specific usage)
- Example (minimal working code)
Common concepts to explain:
| Concept | Analogy |
|---|---|
| Decorators | Gift wrapping - adds functionality around original |
| Generators | Ticket dispenser - produces one item at a time |
| Async/Await | Restaurant ordering - do other things while waiting |
| Context Managers | Automatic door - handles setup and cleanup |
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.
- 3d ago First seen · 128 lines · 0 tokens per session scan A 3422a50f1e27
code-explain is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 781 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-08-30.
Other commands, from other repositories
mock
A complete simulated interview (4-6 questions in sequence) with holistic feedback on the full arc — not just individual answers.
review
View your learning progress — quiz scores, weak areas, and what to study next.
start-1-7
Start Lesson 1.7 - Project Memory.
edit-textbook-chapter
Edit a textbook-style chapter, following evidence-based writing instructions.
explain
Explain code, concepts, or system behavior with adjustable depth levels.
onboard
This command acts as an expert technical mentor to help you rapidly understand a new codebase, generating a comprehensive "Survival Guide" for the project.