terse-sharp: Command for Claude Code

.claude/commands/mine-sessions.md

mine-sessions is a command for Claude Code from amusleh-spotware-com/terse-sharp. It costs 136 tokens per session (32,238 once invoked), scanned B, original, MIT.

A command that examines Claude Code sessions across projects to measure tool calls, waiting time, token use, latency, and other sources of wasted effort.

In plain words
What is it for?
Use it to analyze recent sessions, find costly call sequences and productivity problems, and report findings related to accuracy, modern .NET code, and performance.
Why use it?
It replaces guesses about agent efficiency with measurements while keeping each project’s content separate.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is amusleh-spotware-com/terse-sharp's own configuration. It tells Claude Code how to work on terse-sharp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything terse-sharp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to amusleh-spotware-com/terse-sharp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/amusleh-spotware-com/terse-sharp/main/.claude/commands/mine-sessions.md
Clone the repo
git clone --depth 1 https://github.com/amusleh-spotware-com/terse-sharp

Made for: Claude Code.

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 mine-sessions

README.md
[![agentmods](https://agentmods.dev/badge/commands/amusleh-spotware-com/terse-sharp/mine-sessions/github.svg)](https://agentmods.dev/commands/amusleh-spotware-com/terse-sharp/mine-sessions)
Your own site
<a href="https://agentmods.dev/commands/amusleh-spotware-com/terse-sharp/mine-sessions"><img src="https://agentmods.dev/badge/commands/amusleh-spotware-com/terse-sharp/mine-sessions/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 mine-sessions

Your own site · 80×15
<a href="https://agentmods.dev/commands/amusleh-spotware-com/terse-sharp/mine-sessions"><img src="https://agentmods.dev/badge/commands/amusleh-spotware-com/terse-sharp/mine-sessions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 136 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 32,238 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00136 $0.32238
Opus 5 $0.00068 $0.16119
Sonnet 5 $0.00027 $0.06448
Haiku 4.5 $0.00014 $0.03224

Measured 9d ago against content hash cfedcae27045, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

mine-sessions scanned grade B 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 9d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find ~/.claude/projects -name '*.jsonl' -mtime -$((WEEKS*7)) | wc -l
.claude/commands/mine-sessions.md · 1,938 lines

How it starts

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

🚫 HARD GATE — findings are measured to the character, never impressionistic, and never leak another project's content.

$ARGUMENTS — a number of weeks to scan. Absent or unparseable → 1 week. Nothing else takes input from the user; do not ask, do not confirm the window.

The five goals this command exists to serve. Every phase feeds at least one; every row logged in M9 is tagged with the one it serves; and M11 proves all five were mined or states what was checked and why that goal came back clean. They are not ranked by taste — they are ranked by what a failure costs:

Tag Goal What a finding for it looks like
[accuracy] the agent stops falling into traps that force the user to intervene an extra user prompt, a rejected edit, a retry with different arguments, a confident wrong answer acted on — measured in M5C
[modern] the agent emits modern .NET — latest C# syntax, current APIs a legacy construct in text the agent wrote, counted per 1000 emitted lines and confirmed against the workspace — measured in M5B
[perf] the agent emits code that is not slow sync-over-async, sync file I/O, an allocation on a per-file/per-line/per-symbol path in emitted text — measured in M5B
[speed] the agent finishes the task sooner, in fewer calls wall time per task, tool calls per task, a serial round trip that had no dependency, a blind wait, a re-run of work whose inputs never moved — measured in M4
[cost] the agent pays fewer tokens for the same answer payload, framing, round trips, batches — measured in M2, M3 and M6

[accuracy] and [speed] are co-primary, and both outrank [cost]. An intervention costs a whole turn at M2's turn p50, plus the tokens of the re-issued work, plus the context already spent on the wrong path — so a payload row of equal token size is worth less than an intervention row. And a round trip costs the corpus model gap (tool_result → next tool_use, measured p50 6 097 ms on 35 967 gaps in the 1-week window of 2026-08-26) plus the tool's own p50 — so a row that deletes one call per task is worth more than a row that shortens one response, because the wall clock the user waits through is dominated by how many times the loop turns, not by how wide each answer is. Rank accordingly in M9.

The three [speed] metrics, and they are the run's headline numbers. Every run reports all three in M11 against the previous run, and a run that reports none of them has not measured [speed] and says so as a degraded run:

Metric Where it comes from Baseline, 1 week to 2026-08-26
tool calls per task cycle M4's cycle table — user turn to the next user turn mean 25.6, p90 84
wall time per task cycle the same table p50 1.3 min, p90 51.9 min, mean 44.8 min
round-trip latency model gap p50 + the called tool's p50 6 097 ms of model gap, before the tool runs at all

Eight gates that outrank everything else in this command:

  1. A finding without a number is not a finding. "Reads feel wasteful" is banned. "36 Read calls in one session, 214 KB of tool results, ~53 500 tokens, against 10 search_text calls" is a finding. Every row carries a count, a byte/token/millisecond figure and the corpus it came from.
  2. Nothing is too small to count — but a trim is only real once a tokenizer says so. This command's reason to exist is the long tail: a two-space column separator, a repeated (truncated=false), an absolute path, one redundant word in a tool [Description] re-sent on every request of every session. A multi-space run costs exactly 1 token wherever it appears, so a 4-column table pays 3 tokens per row for alignment nobody reads — over 40 000 rows that is 120 000 tokens, and it outranks most new tools. "Too small to log" is a banned phrase here; small findings are aggregated into one row per family, never dropped (M9.4). The mirror rule is equally binding: a trim that measures zero is not a finding either. Blank lines, trailing whitespace and abbreviation each measured ≤0.1% and 19-of-20 exactly zero on real payloads (M3.2). Proposing one of those is the same defect as failing to notice the padding — both spend the reader's attention on a number that is not there.
  3. Never copy content out of another project's transcript. These sessions are from a private employer codebase (cTraderDev, ctd-worktrees-*, cTraderAutomateApi, …) and IMPROVEMENTS.md is pushed to a public repository. A row may name: tool names, call counts, byte sizes, token estimates, millisecond timings, error codes, and a project's directory slug. A row may never contain: source code, file paths inside those repos, type or member names, ticket text, user prompts, or a quoted tool result. When in doubt, state the shape (a 40 KB whole-file read of a test file) not the value. The measurement script enforces a mechanical version of this rule and you enforce the rest by hand in M10.2.
  4. Character economy is a claim about tokens, so state both. Chars are what the script can count; tokens are what is paid. The measured ratio over real TerseSharp responses is 4.18 chars/token, which is why M2 estimates at chars // 4 — and why an estimate is all it is. Prefer trims that delete whole tokens (a separator, a padded column, a repeated line prefix, a whole field) over trims that shorten one: deleting characters from inside a word usually saves nothing at all, because a common word is already a single token.
  5. Every claim names the instrument that verified it. Three are admissible, in this order: (a) the corpus — a count from the M2 scan over the real transcripts; (b) a tokenizer experiment — an encode-before/encode-after on a real payload, in both o200k_base and cl100k_base, labelled directional because neither is Claude's; (c) a primary source — a vendor document or a paper, fetched and quoted, never a summary of a summary; (d) the workspaceanalyze, search_regex, get_symbol_source, build or run_tests over TerseSharp's own source, which is the only instrument that can confirm a pattern the transcripts show being written rather than being read. Where an outside claim contradicts the corpus, the corpus wins and the row says so. A claim that survived none of the three is written UNVERIFIED in the report and is not allowed into IMPROVEMENTS.md at all. This gate exists because a previous run of this command shipped a trim ledger whose three headline classes were each worth ~0.1%, sourced from plausible reasoning that nobody encoded.

Read the full file on GitHub · 1,938 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. 9d ago First seen · 1,938 lines · 136 tokens per session scan B cfedcae27045

Subscribe to this mod's changes

mine-sessions is a command published in the GitHub repository amusleh-spotware-com/terse-sharp (2 stars, last pushed 4d ago), licensed MIT. It adds 136 tokens to every session and 32,238 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it B 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-31.