Circuit

Circuit is a skill for Claude Code from zjunlp/Mechanist. It costs 91 tokens per session (809 once invoked), scanned A, original, MIT.

A method for finding the smallest connected set of parts in a transformer language model that causes a particular behavior. Transformer parts can include attention heads and other processing layers.

In plain words
What is it for?
Use it to study why a language model produces a behavior, compare mechanisms across models, or investigate possible behavior changes. Finding these connected parts can be costly and depends on the chosen task and test method.
Why use it?
It explains how model components work together, rather than only listing which individual parts seem relevant. The result can be checked on separate examples to see whether it truly causes the behavior.

Skill for Claude Code

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

Part of the mechanist plugin — 54 skills, 4 agents shipped together

Good fit Use it to study why a language model produces a behavior, compare mechanisms across models, or investigate possible behavior changes. Finding these connected parts can be costly and depends on the chosen task and test method.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zjunlp/mechanist/circuit-discovery
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 zjunlp/Mechanist --skill circuit-discovery
Clone the repo
git clone --depth 1 https://github.com/zjunlp/Mechanist

Made for: Claude Code.

Or install mechanist, the plugin that ships this one along with the rest of its 54 skills, 4 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 Circuit

README.md
[![agentmods](https://agentmods.dev/badge/skills/zjunlp/mechanist/circuit-discovery/github.svg)](https://agentmods.dev/skills/zjunlp/mechanist/circuit-discovery)
Your own site
<a href="https://agentmods.dev/skills/zjunlp/mechanist/circuit-discovery"><img src="https://agentmods.dev/badge/skills/zjunlp/mechanist/circuit-discovery/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 Circuit

Your own site · 80×15
<a href="https://agentmods.dev/skills/zjunlp/mechanist/circuit-discovery"><img src="https://agentmods.dev/badge/skills/zjunlp/mechanist/circuit-discovery.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 91 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 809 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00091 $0.00809
Opus 5 $0.00046 $0.00404
Sonnet 5 $0.00018 $0.00162
Haiku 4.5 $0.00009 $0.00081

Measured 9d ago against content hash 816d3dd8f647, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

Circuit 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 9d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (attribution-based-edge-scoring/scripts/usage_example.py, intervention-based-edge-search/scripts/acdc_run_demo.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.

skills/mechanism-skills/circuit-discovery/SKILL.md · 25 lines

How it starts

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

Advantage

Circuit discovery moves beyond per-object localization to deliver a structured, mechanism-level explanation: it returns not only which components matter, but how they communicate. The resulting circuits are evaluated for faithfulness on a held-out task distribution, so the recovered subgraph can be verified to actually implement the behavior rather than merely correlating with it. This makes circuits the natural unit for downstream analyses such as cross-model comparison, behavior editing, and mechanism-level claims about generalization.

Limitation

Recovering a circuit is substantially more expensive than scoring isolated objects, because the search space is the set of edges in the computational graph and faithfulness must be checked under interventions. Pure ablation-based approaches scale poorly with model and graph size, while gradient-based approximations trade exactness for speed and can miss edges whose effect is non-linear. Results also depend on the choice of task distribution, counterfactual / corrupted inputs, and the metric used to score faithfulness, so different configurations can yield different "circuits" for ostensibly the same behavior.

Submethods

Circuit discovery typically takes two forms: exact iterative search via ablation, or fast gradient-based attribution. A third, more recent paradigm — feature-based replacement models — replaces dense components such as MLPs with sparse-feature decoders (e.g. transcoders) so that the discovered circuit lives in interpretable feature space rather than over raw neurons; Anthropic's circuit-tracer is a representative open-source implementation. This skill does not ship a dedicated demo for that paradigm — see the feature-dictionary-learning/transcoder skill, which links to circuit-tracer.

  • Exact Iterative Search via Ablation A typical approach is Automatic Circuit Discovery (ACDC). This approach treats circuit discovery as an iterative graph-pruning problem. Starting from the full computational graph, ACDC walks edges in reverse topological order and tests each one by patching its endpoint with an activation from a corrupted input; if removing the edge does not degrade the chosen task metric beyond a threshold, the edge is pruned. Repeating this until convergence yields a minimal subgraph that preserves the behavior, providing a causal, intervention-grounded circuit at the cost of many forward passes per edge. You can find a demo for this method in ./intervention-based-edge-search. This demo illustrates how to perform automated circuit discovery in transformer models by editing the computational graph, running activation patching across edges, and extracting minimal task-specific circuits for mechanistic interpretability studies.

Read the full file on GitHub · 25 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. 9d ago First seen · 25 lines · 91 tokens per session scan A 816d3dd8f647

Subscribe to this mod's changes

Circuit is a skill published in the GitHub repository zjunlp/Mechanist (74 stars, last pushed 13d ago), licensed MIT. It adds 91 tokens to every session and 809 once invoked, about $0.0005 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.