analyze-usage

A reporting tool for reviewing how Codescout command-line tools have been used across projects.

In plain words
What is it for?
Use it for tool-health audits, error-pattern reviews, usage reports, anti-pattern checks, or clearing recorded usage data for one or all projects.
Why use it?
It shows common tools, errors, response times, failed or oversized outputs, and session patterns in one report instead of requiring manual database checks.

Skill for Claude CodeCodex

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 skills/mareurs/codescout/analyze-usage
Any agent
npx skills add mareurs/codescout --skill analyze-usage
Clone the repo
git clone --depth 1 https://github.com/mareurs/codescout

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,335 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00042 $0.03335
Opus 5 $0.00021 $0.01667
Sonnet 5 $0.00008 $0.00667
Haiku 4.5 $0.00004 $0.00333

Measured yesterday against content hash 75349fe9b152, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

.claude/skills/analyze-usage/SKILL.md · 374 lines

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 sqlite3 directly
  • 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.

Read the full file on GitHub · 374 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. yesterday First seen · 374 lines · 42 tokens per session scan A 75349fe9b152

Subscribe to this mod's changes

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.

Related

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…

Cranot/roam-code · 86 tokens

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…

blackwell-systems/agent-lsp · 126 tokens

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.

blackwell-systems/agent-lsp · 36 tokens

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.

blackwell-systems/agent-lsp · 43 tokens

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.

blackwell-systems/agent-lsp · 57 tokens

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.

blackwell-systems/agent-lsp · 59 tokens