scan-for-defects-semantic

scan-for-defects-semantic is a skill for Claude Code, Codex from HuginnIndustries/CodeCartographer. It costs 87 tokens per session (1,213 once invoked), scanned A, original, MIT.

A focused code review for bugs involving concurrency, resource handling, security boundaries, API agreements, and state-machine behavior.

In plain words
What is it for?
It helps check code against documented contracts and protocols after the architecture and earlier mechanical checks are available.
Why use it?
These problems often cannot be identified reliably without knowing what the system promises to do and how its states and events should work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps check code against documented contracts and protocols after the architecture and earlier mechanical checks are available.

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

Made for: Claude Code, Codex.

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 scan-for-defects-semantic

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/huginnindustries/codecartographer/defect-scan-semantic"><img src="https://agentmods.dev/badge/skills/huginnindustries/codecartographer/defect-scan-semantic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,213 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.00087 $0.01213
Opus 5.5 $0.00035 $0.00485
Sonnet 5.5 $0.00017 $0.00243
Haiku 4.5 $0.00009 $0.00121

Measured 1mo ago against content hash 5bcb620bdaf8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

scan-for-defects-semantic 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 1mo 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.

.codecarto/findings/defect-scan-semantic/SKILL.md · 64 lines

How it starts

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

Scan For Defects — Semantic Pass

This phase runs the deep, semantic half of the defect-scan methodology. The findings here only become legible once you know what the code is supposed to do — that is what the contracts and protocols phases give you. The early mechanical bugs (passes 1, 2, 6) were caught in the earlier defect-scan-mechanical phase.

The source code to analyze is in the parent directory (../ relative to .codecarto/).

Prerequisites

Required:

  • findings/architecture/architecture-map.md
  • findings/contracts/behavioral-contracts.md — pass 5 needs this to define "violation."
  • findings/protocols/protocols-and-state.md — passes 3 and 5 need this for state machine and event-ordering analysis.
  • findings/defect-scan-mechanical/mechanical-defects.md — read so you do not re-flag what the mechanical phase already covered.

Read when a finding turns on it: the source of a dependency the code trusts (under node_modules/, the vendored tree, or the SDK's published source), at the pinned version. The evidence rules allow "that system's own source" to settle an external-behavior claim about it, and passes 4 and 5 keep meeting claims of that shape — what a lock does on release, what a session runtime frees on dispose. Reading the pinned source is cheaper than a runtime probe and turns the claim into an observed fact; say which file and version you read.

If any prerequisite is missing, stop and surface the gap. The semantic pass is the paid-for benefit of running the mechanical phase early; do not regress it by running the semantic pass blind.

Pass Execution Order

Run these three passes sequentially. Read the pass file, scan the source, record findings, then move to the next pass. Each pass file is reused from the legacy defect-scan phase.

Pass File Focus
3 findings/defect-scan/passes/03-concurrency-and-resources.md Race conditions, lock issues, async pitfalls, resource leaks
4 findings/defect-scan/passes/04-security-and-trust.md Input validation, auth gaps, secrets in code, trust boundaries
5 findings/defect-scan/passes/05-api-contract-violations.md Spec vs. implementation drift, return type mismatches, state machine violations

Read the full file on GitHub · 64 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. 1mo ago Changed · +7 lines 5bcb620bdaf8
  2. 1mo ago Changed · +2 lines 724d5e8a762c
  3. 1mo ago First seen · 55 lines · 87 tokens per session scan A f6509a00929d

Subscribe to this mod's changes

scan-for-defects-semantic is a skill published in the GitHub repository HuginnIndustries/CodeCartographer (7 stars, last pushed 4d ago), licensed MIT. It adds 87 tokens to every session and 1,213 once invoked, about $0.0003 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

Other skills, from other repositories

code-review

Reviews code for bugs, security issues, and best practices.

promptfoo/promptfoo · 11 tokens

resolve-review-pr

Review an existing fix PR using the audited repro and full diff, preserving branch and approval rules.

omnigent-ai/omnigent · 23 tokens

ix

Answer structural questions about a codebase — what a symbol is, what calls it, what a change breaks, where the hotspots are — from a persistent code graph via the ix CLI, instead of grepping.

ix-infrastructure/Ix · 44 tokens

deep-analysis

Performs focused, depth-first investigation of specific reverse engineering questions through iterative analysis and database improvement. Answers questions like "What does this function do?", "Does this use crypto?", "What's the C2 address?", "Fix types in this function". Makes incremental improvements (renaming…

cyberkaida/reverse-engineering-assistant · 98 tokens

ctf-rev

Solve CTF reverse engineering challenges using systematic analysis to find flags, keys, or passwords. Use for crackmes, binary bombs, key validators, obfuscated code, algorithm recovery, or any challenge requiring program comprehension to extract hidden information.

cyberkaida/reverse-engineering-assistant · 52 tokens

pyghidra-scripting

Write and run Python (PyGhidra) code inside the Ghidra session that ReVa's MCP server is already attached to, using the five ReVa scripting tools — run-script, list-scripts, read-script, write-script, edit-script. Use this whenever the user asks to execute Python against the current program, reach for the Ghidra Flat…

cyberkaida/reverse-engineering-assistant · 209 tokens