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 skills/mareurs/codescout/analyze-usagenpx skills add mareurs/codescout --skill analyze-usagegit clone --depth 1 https://github.com/mareurs/codescoutWhat 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.00042 | $0.03335 |
| Opus 5 | $0.00021 | $0.01667 |
| Sonnet 5 | $0.00008 | $0.00667 |
| Haiku 4.5 | $0.00004 | $0.00333 |
Grade A, and why
analyze-usage scanned grade A with 1 finding 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 yesterday.
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.
Reads agent configuration directorieslowAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
find ~/.claude/projects -name "<session_id_prefix>*" 2>/dev/null Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 374 lines — stays where its author put it; the contents beside it link to each section on GitHub.
analyze-usage
Overview
Scan all codescout usage.db databases across workspace projects, run a fixed set of SQL
queries, and produce a comprehensive markdown report covering: tool popularity, error
patterns, latency distribution, overflow behavior, and session summaries. Saves report to
file and prints a compact inline summary.
When to Use
- User invokes
/analyze-usage→ run the full analysis report - User invokes
/analyze-usage clear→ clear all projects' usage data - User invokes
/analyze-usage clear <project>→ clear one project's usage data - User asks for a tool usage health check, error audit, or anti-pattern review
- User wants an actionable improvement list for codescout tools
- User wants to reset statistics before a new measurement period
When NOT to Use
- Single ad-hoc query — just run
sqlite3directly - Real-time monitoring — this is a point-in-time snapshot
Steps
1. Discover DBs
find ~/work -path "*/.codescout/usage.db"
~/work is the standard project root on this machine. Adjust if projects live elsewhere.
Optional: if a project name or path was given as argument, filter results to that path only.
If no DBs found: stop and report: "No usage.db files found under ~/work. Check that codescout projects have been activated at least once."
After running query A for each DB, skip projects with fewer than 20 calls — include them only as a row in a summary table at the end of the report rather than with full per-project sections.
Note: find may return nested DBs (e.g. codescout/crates/librarian-mcp/.codescout/usage.db). Include these as separate projects — each sub-project DB tracks its own activation context.
Store the list of DB paths — loop over each one in Steps 2–4.
2. For Each DB — Run SQL Queries (9 total)
Run each query below via run_command. Replace <db> with the full DB path.
Invoke pattern:
sqlite3 -line <db> "SELECT ..."
The -line flag formats output as column = value pairs — readable in markdown reports. Replace SELECT ... with the full query text for each section.
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.
- yesterday First seen · 374 lines · 42 tokens per session scan A 75349fe9b152
analyze-usage is a skill published in the GitHub repository mareurs/codescout (21 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 3,335 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
roam
Codebase comprehension via roam-code CLI. Use when exploring codebases, planning modifications, debugging failures, assessing PR risk, or checking architecture health. Triggers on: understanding project structure, pre-change safety checks, finding symbols/files, blast radius analysis, affected tests, health scoring…
lsp-inspect
Full code quality audit for a file, package, or directory. Supports batch mode (directory walk with --top ranking), comparison mode (--diff for branch-only issues), severity calibration by blast radius, fix suggestions, and confidence tiers. Applies a check taxonomy (dead symbols, silent failures, error wrapping…
lsp-architecture
Generate a structural architecture overview of a codebase: languages, package map, entry points, dependency graph, and hotspots. One call for the big picture.
lsp-dead-code
Enumerate exported symbols in a file and surface those with zero references across the workspace. Use when auditing for dead code, cleaning up APIs, or checking which exports are safe to remove.
lsp-refactor
End-to-end safe refactor workflow — blast-radius analysis, speculative preview, apply to disk, verify build, run affected tests. Inlines lsp-impact + lsp-safe-edit + lsp-verify + lsp-test-correlation into one coordinated sequence.
lsp-safe-edit
Wrap any code edit with before/after diagnostic comparison. Speculatively previews the change first (previewedit), then applies to disk only if the error delta is acceptable. If post-edit errors appear, surfaces code actions for quick fixes. Handles single and multi-file edits.