scanner-extension

scanner-extension is an agent for coding agents from Goldziher/basemind. It costs 50 tokens per session (514 once invoked), scanned A, original, MIT.

An implementation guide for adding support for another programming language to basemind's code scanner. It uses tree-sitter, a parsing tool that identifies code structure.

In plain words
What is it for?
Use it to add language file types, identify functions and other code elements, write scanner queries, create fixtures, and add a real-project test case.
Why use it?
It helps ensure the new language is registered, parsed correctly, tested with examples, and checked against a real project.

Agent

Part of the basemind plugin — 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server shipped together

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.

agentmods
npx agentmods add agents/goldziher/basemind/scanner-extension
Clone the repo
git clone --depth 1 https://github.com/Goldziher/basemind

Or install basemind, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server.

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 scanner-extension

README.md
[![agentmods](https://agentmods.dev/badge/agents/goldziher/basemind/scanner-extension.svg)](https://agentmods.dev/agents/goldziher/basemind/scanner-extension)
Your own site
<a href="https://agentmods.dev/agents/goldziher/basemind/scanner-extension"><img src="https://agentmods.dev/badge/agents/goldziher/basemind/scanner-extension.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 514 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00050 $0.00514
Opus 5 $0.00025 $0.00257
Sonnet 5 $0.00010 $0.00103
Haiku 4.5 $0.00005 $0.00051

Measured 4d ago against content hash 4b15b33af1e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scanner-extension 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 4d 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.

.ai-rulez/agents/scanner-extension.md · 35 lines

What it actually says

scanner-extension

You add a new language to basemind's tree-sitter extraction. Follow the language-support skill exactly.

Process

  1. Confirm the user named the target language and (optionally) provided a sample repo to harden against.
  2. Locate the grammar:
    • Prefer tree-sitter-language-pack if it bundles the language.
    • Fall back to the upstream tree-sitter-<lang> crate.
  3. Fetch the upstream queries/tags.scm from the canonical tree-sitter- repo as the starting point.
  4. Walk the skill's six steps: register lang + extensions, write L1 queries, write L2 queries, add fixtures, add harden canary, update README.
  5. Verify code mode outline + mode references against the fixture before touching harden.

Query translation discipline

Tree-sitter capture names are language-specific. function.definition in one grammar is function_definition in another. Always:

  • Open the actual grammar's grammar.js (or compiled node-types.json) to confirm node names.
  • Map captures explicitly to basemind's SymbolKind enum — don't introduce a new kind unless the language genuinely has a concept the existing ones can't represent (e.g. Elixir protocols).
  • Cover Function, Method, Struct/Class, Trait/Interface, Type, Const, Module. Decorators / generics / TS namespaces are explicitly deferred — do not add captures for them.

Pitfalls

  • Don't forget the file-extension glob in src/scanner.rs. Symptom of forgetting: tool returns 0 hits for a known symbol.
  • Don't reorder SymbolKind variants — they're persisted as u8 ordinals in the Fjall index.
  • Populate start_row / start_col on every Call extracted from L2; code mode references reports them.
  • Eager L2 is on by default; the harden canary must work with it on. If the new language needs eager L2 off for some reason, that's a design problem — escalate.
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. 4d ago First seen · 35 lines · 50 tokens per session scan A 4b15b33af1e1

Subscribe to this mod's changes

scanner-extension is an agent published in the GitHub repository Goldziher/basemind (91 stars, last pushed 8d ago), licensed MIT. It adds 50 tokens to every session and 514 once invoked, about $0.0003 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 agents, from other repositories

sverklo-explore

Drop-in replacement for Claude Code's built-in Explore subagent. Uses sverklo's hybrid-retrieval MCP tools (BM25 + ONNX embeddings + PageRank, 36 tools) to answer file-discovery and code-search questions with 60% fewer tokens than naive grep. Use this when you need to locate definitions, trace references, understand…

sverklo/sverklo · 96 tokens

cursor

Agent "cursor" from mareurs/codescout, covering cursor, one-time setup, register codescout as an mcp server, add workflow skills and add the code-reviewer agent.

mareurs/codescout · 0 tokens

task-plan-architect

Uses the smartest available Claude model to expand one broad GitHub issue into a bounded set of implementation-ready subtasks, choosing the preferred LLM/model for each subtask and linking the resulting task tree in comments.

MercurieVV/ScalaSemantic · 47 tokens

lesson-learner

Use proactively when the user asks to encode insights or guidelines into CLAUDE.md. Triggers include phrases like "update your memory", "remember to do this", "learn from this", or "add this to the guidelines". Extracts generalizable principles from context and proposes targeted improvements to project documentation.

CRJFisher/ariadne · 66 tokens

codesage-feature-reviewer

Review one CodeSage feature slice and return strict JSON findings.

iliaal/codesage · 19 tokens

triage

Cheap sequential classifier. Reads one GitHub issue, decides whether it is a standard coding task or an analytic task, routes it to the right engine+model (or marks it for step-by-step analytic planning), and emits a compact JSON routing decision. Use before dispatching work to the parallel pool.

MercurieVV/ScalaSemantic · 63 tokens