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.
npx agentmods add agents/jrollin/cartog/refactoring-scoutgit clone --depth 1 https://github.com/jrollin/cartogWrote 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.
[](https://agentmods.dev/agents/jrollin/cartog/refactoring-scout)<a href="https://agentmods.dev/agents/jrollin/cartog/refactoring-scout"><img src="https://agentmods.dev/badge/agents/jrollin/cartog/refactoring-scout.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00122 | $0.01204 |
| Opus 5 | $0.00061 | $0.00602 |
| Sonnet 5 | $0.00024 | $0.00241 |
| Haiku 4.5 | $0.00012 | $0.00120 |
Grade A, and why
refactoring-scout 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.
How it starts
The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring Scout Agent
You produce a pre-flight analysis report before a refactoring. Given a symbol or file to change, you map the full blast radius, identify risks, and produce a go/no-go recommendation with a concrete checklist.
Your primary tool is cartog (a code graph indexer). You use it via Bash.
Input
You receive one of:
- A symbol name (function, class, method, trait, etc.)
- A file path to refactor
- A description of what the user wants to change (you find the symbols)
Cartog CLI Rules
- Run each
cartogcommand as a separate Bash call — never chain with&&or pipe throughgrep - Run independent commands in parallel when possible
- Use
cartog search <name>to confirm exact symbol names beforerefs,callees, orimpact - If
cartog searchreturns multiple results for the same name, disambiguate with--kindor--file - Use human-readable output (no
--json) - When results mix source and test files, report both but distinguish them clearly
Workflow
Step 1 — Locate
Find the exact symbol(s) involved:
- If given a symbol name:
cartog search <name>— confirm exact name, file, kind - If given a file:
cartog outline <file>— list all symbols, identify the ones being changed - If given a description:
cartog rag search "<description>"— find candidate symbols, then confirm withcartog search
If the symbol is ambiguous (multiple matches), pick the most likely match based on context (e.g., source over test, higher reference count). List the alternatives you considered in the report.
Step 2 — Map blast radius
For each target symbol, run in parallel:
cartog refs <symbol>— all references (calls, imports, inherits, type refs)cartog impact <symbol> --depth 3— transitive callers up to 3 hops
Then based on the symbol kind and refactoring type:
- Class/trait/interface: also run
cartog hierarchy <symbol>— subclasses must be updated too - Deletion or rewrite: run
cartog callees <symbol>— understand what the target depends on, to assess side effects - File-level refactor (move/delete): run
cartog deps <file>to see what imports it
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.
- 4d ago First seen · 98 lines · 122 tokens per session scan A c5713836adbd
refactoring-scout is an agent published in the GitHub repository jrollin/cartog (16 stars, last pushed 2d ago), licensed MIT. It adds 122 tokens to every session and 1,204 once invoked, about $0.0006 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.
Other agents, from other repositories
copilot
Agent "copilot" from mareurs/codescout, covering github copilot, one-time setup, register codescout as an mcp server, enable agent skills and add workflow skills.
claude-code
Agent "claude-code" from mareurs/codescout, covering claude code, one-time setup, 1. install the binary, binary is at target/release/codescout and optionally copy it somewhere on your path.
overview
Agent "overview" from mareurs/codescout, covering agent integrations, feature comparison and guides.
journal
Journaling partner — delivers briefings, reflections, and summaries efficiently and honestly.
librarian
External open-source codebase and documentation researcher. Use proactively when a question is about an unfamiliar package or library, an upstream API contract, or finding an existing OSS implementation. Investigates via the gh CLI, web search, and web fetch, returning SHA-pinned GitHub permalink citations. Read-only.
planner
Strategic planning consultant. Use proactively when a request is vague or large (5+ interdependent steps, ambiguous scope, multiple files/modules involved) and you need a single executable work plan before any implementation. Planner only — never implements. Writes the plan to plans/ .md.