margaret-scan

margaret-scan is a skill for Claude Code from sofiahernandes/margaret. It costs 136 tokens per session (910 once invoked), scanned A, original, MIT.

A focused code review for finding unnecessary complexity and over-engineering in a change or an entire codebase.

In plain words
What is it for?
Use it to spot unnecessary dependencies, one-use abstractions, dead flexibility, duplicate built-in functionality, unused options, and custom code that can be removed.
Why use it?
It shows what can be deleted or replaced with simpler standard-library, platform, or existing-code solutions.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the margaret plugin — 8 skills, 4 commands shipped together

Good fit Use it to spot unnecessary dependencies, one-use abstractions, dead flexibility, duplicate built-in functionality, unused options, and custom code that can be removed.

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

Made for: Claude Code.

Or install margaret, the plugin that ships this one along with the rest of its 8 skills, 4 commands.

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 margaret-scan

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sofiahernandes/margaret/margaret-scan"><img src="https://agentmods.dev/badge/skills/sofiahernandes/margaret/margaret-scan.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 910 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.00136 $0.00910
Opus 5.5 $0.00054 $0.00364
Sonnet 5.5 $0.00027 $0.00182
Haiku 4.5 $0.00014 $0.00091

Measured 22d ago against content hash d0eec69499c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

margaret-scan 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 22d 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/margaret-scan/SKILL.md · 68 lines

How it starts

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

Hunt exclusively for complexity that doesn't earn its keep. One finding per line: where it lives, what to remove, what stands in its place. Success looks like a smaller tree, not a longer report.

Two scopes:

  • diff (default): only the current change is in play.
  • repo (pass repo, or the user asks for an "audit"/"whole codebase"): walk the full tree instead, biggest win listed first. Look for: packages duplicating stdlib or platform behavior, interfaces with exactly one implementer, factories manufacturing a single product, pass-through wrappers that add no behavior, single-export files, unused flags/config, and homegrown reimplementations of stdlib functions.

Diff scope is the branch against its upstream default — the same three commands /margaret-guard uses, so both skills always see the same change set:

git diff --name-only origin/HEAD...   # files
git log --no-decorate origin/HEAD...  # commits
git diff --merge-base origin/HEAD     # content

No upstream (detached HEAD, or no origin)? Fall back to git diff HEAD and say which scope you used.

Reporting shape

L<line>: <tag> <finding>. <fix>. — prefix with <file>: for anything spanning multiple files (diffs with several files, or a repo scan).

Tags:

  • cut: unreachable code, unused flexibility, a feature nobody asked for. Fix: remove it, nothing replaces it.
  • builtin: custom code duplicating what the standard library already ships. Name the stdlib call.
  • platform: a dependency or handwritten code standing in for a platform capability. Name the capability.
  • overbuilt: one-implementation interface, a config knob nobody flips, a layer with a single caller.
  • condense: identical behavior expressible in fewer lines. Show the shorter version.

Examples

❌ "This SlugGenerator class seems like it might be handling more cases than strictly necessary — worth double-checking whether every branch is needed?"

✅ L18-45: builtin: 30-line slug class reimplementing string normalization. str.lower().replace(' ', '-') plus a regex strip, 2 lines.

Read the full file on GitHub · 68 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. 22d ago Changed · +10 lines d0eec69499c2
  2. 3mo ago First seen · 58 lines · 136 tokens per session scan A 399aed50c75b

Subscribe to this mod's changes

margaret-scan is a skill published in the GitHub repository sofiahernandes/margaret (2 stars, last pushed 20d ago), licensed MIT. It adds 136 tokens to every session and 910 once invoked, about $0.0005 per session on Opus 5.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

margaret-scan compared with skills from other repositories

margaret-scan next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
margaret-scansofiahernandes/margaretSkill220d agoMITA136Claude Code
deep-reviewulises-jeremias/agent-toolkitSkill28todayMITA57Claude Code
gh-address-commentsulises-jeremias/agent-toolkitSkill28todayMITA51Claude Code
review-allpaultyng/skill-issueSkill8yesterdayMITA102Claude Code, Codex
active-reviewpaultyng/skill-issueSkill8yesterdayMITA0Claude Code, Codex
review-api-compatpaultyng/skill-issueSkill8yesterdayMITA69Claude Code, Codex
review-documentationpaultyng/skill-issueSkill8yesterdayMITA83Claude Code, Codex