logic-explain

logic-explain is a skill for Claude Code from hyhmrright/logic-lens. It costs 171 tokens per session (708 once invoked), scanned A, original, MIT.

A step-by-step explanation of what a particular piece of code does for one stated input scenario. It follows calls between functions and tracks how names and data types change.

In plain words
What is it for?
Use it to trace a function call, understand why a given input produces a particular result, and clarify how values change across the code.
Why use it?
It helps explain unexpected program behavior by showing the exact execution path instead of giving only a summary.

Skill for Claude Code

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

Part of the logic-lens plugin — 11 skills, 6 commands, 3 agents, 2 hooks shipped together

Good fit Use it to trace a function call, understand why a given input produces a particular result, and clarify how values change across the code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hyhmrright/logic-lens/logic-explain
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.

Any agent
npx skills add hyhmrright/logic-lens --skill logic-explain
Clone the repo
git clone --depth 1 https://github.com/hyhmrright/logic-lens

Made for: Claude Code.

Or install logic-lens, the plugin that ships this one along with the rest of its 11 skills, 6 commands, 3 agents, 2 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 logic-explain

README.md
[![agentmods](https://agentmods.dev/badge/skills/hyhmrright/logic-lens/logic-explain.svg)](https://agentmods.dev/skills/hyhmrright/logic-lens/logic-explain)
Your own site
<a href="https://agentmods.dev/skills/hyhmrright/logic-lens/logic-explain"><img src="https://agentmods.dev/badge/skills/hyhmrright/logic-lens/logic-explain.svg" alt="Measured on agentmods" height="20"></a>
Per session 171 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 708 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.00171 $0.00708
Opus 5 $0.00086 $0.00354
Sonnet 5 $0.00034 $0.00142
Haiku 4.5 $0.00017 $0.00071

Measured 8d ago against content hash 5caaf33f77e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

logic-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 8d 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.

skills/logic-explain/SKILL.md · 46 lines

How it starts

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

Logic-Lens — Execution Explain

Setup

Use lazy loading per ../_shared/common.md §13:

  1. Read ../_shared/common.md only for language, report header variants, scope routing, and loading budget.
  2. Read only the relevant step in logic-explain-guide.md as you reach it.
  3. Load ../_shared/semiformal-guide.md, ../_shared/semiformal-checklist.md, and ../_shared/report-template.md on demand when the current step needs them.

Note: logic-risks.md is intentionally skipped — logic-explain does not produce L-code findings, and Remedy is intentionally out of scope for this mode. If the trace reveals a bug, stop and recommend logic-review or logic-locate. When handing off, do not discard work already done — present the premises established and trace steps completed under a "Partial trace context (carry into next skill):" heading so the user can pass them directly to the follow-on skill.

Process

Step 0. Language + scope routing. Detect language per common.md §1. Confirm a single function + a single input scenario. If the user wants bug-finding without a scenario, hand off to logic-review.

Step 1. Entry point and scenario (guide Step 1) — name the function, the input scenario, and what the user is trying to understand.

Step 2. Build premises (guide Step 2) — resolve every non-obvious name, state the types of key variables at entry, note global/module state accessed.

Step 3. Produce step-by-step trace (guide Step 3) — numbered, interprocedural, active voice; cross function boundaries whenever relevant to the user's scenario. Keep the trace scenario-bound; do not branch into alternative paths unless they explain the user's confusion.

Step 4. Highlight non-obvious behavior (guide Step 4) — name resolutions, implicit coercions, hidden side effects; the "gotchas" the casual reader would miss.

Step 5. Summarize actual vs. assumed (guide Step 5) — one sentence each; this is the core value for the user.

Mode line in report: Execution Explain (Chinese: 执行解释).

Read the full file on GitHub · 46 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 46 lines · 171 tokens per session scan A 5caaf33f77e6

Subscribe to this mod's changes

logic-explain is a skill published in the GitHub repository hyhmrright/logic-lens (22 stars, last pushed 9d ago), licensed MIT. It adds 171 tokens to every session and 708 once invoked, about $0.0009 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

ai-development-guide

Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates. Use when reviewing general/backend implementation choices, code smells, failures, or implementation completeness.

shinpr/claude-code-workflows · 43 tokens

recipe-diagnose

Investigate problem, verify findings, and derive solutions.

shinpr/claude-code-workflows · 15 tokens

bug-hunter

Precision-first adversarial bug hunting for runtime, logic, data, concurrency, and security defects. Uses deterministic risk triage, evidence-bounded retrieval, Hunter/Skeptic/Referee review, optional hybrid verification, and explicit immutable Fixer scope. Scan-only and single-pass by default; complete-coverage…

codexstar69/bug-hunter · 105 tokens

hunter

Deep behavioral code analysis agent for Bug Hunter. Performs multi-phase scanning to find logic errors, security vulnerabilities, race conditions, and runtime bugs. Uses doc-lookup (Context Hub + Context7) for framework verification. Reports structured JSON findings.

codexstar69/bug-hunter · 50 tokens

skeptic

Adversarial code reviewer for Bug Hunter. Rigorously challenges each reported bug to determine if it's real or a false positive. Uses doc-lookup (Context Hub + Context7) to verify framework claims before disproval. The immune system that kills false positives.

codexstar69/bug-hunter · 56 tokens

fixer

Surgical code fixer for Bug Hunter. Implements minimal, precise fixes for verified bugs. Uses doc-lookup (Context Hub + Context7) to verify correct API usage in patches. Respects fix strategy classifications (safe-autofix vs manual-review vs larger-refactor).

codexstar69/bug-hunter · 57 tokens