Borrowing it
Nothing to install: this file belongs to jens-duttke/usage-monitor-for-claude. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/jens-duttke/usage-monitor-for-claude/main/.claude/commands/pre-merge.mdgit clone --depth 1 https://github.com/jens-duttke/usage-monitor-for-claudeWrote 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/commands/jens-duttke/usage-monitor-for-claude/pre-merge)<a href="https://agentmods.dev/commands/jens-duttke/usage-monitor-for-claude/pre-merge"><img src="https://agentmods.dev/badge/commands/jens-duttke/usage-monitor-for-claude/pre-merge/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.
<a href="https://agentmods.dev/commands/jens-duttke/usage-monitor-for-claude/pre-merge"><img src="https://agentmods.dev/badge/commands/jens-duttke/usage-monitor-for-claude/pre-merge.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00000 | $0.03925 |
| Opus 5 | $0.00000 | $0.01962 |
| Sonnet 5 | $0.00000 | $0.00785 |
| Haiku 4.5 | $0.00000 | $0.00392 |
Grade A, and why
pre-merge scanned grade A with 2 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 12d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
1. Walk the call graph for every new/changed function. Any leaf that performs I/O over a socket, opens a connection, navigates a webview, executes an external tool capable of fetching/sending (e.g. `curl`, `wget`, `Invok Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
Non-exhaustive starting hints (use them as search anchors, not as a complete list): `eval`, `exec`, `compile`, `__import__`, `importlib.*`, `runpy.*`, `code.InteractiveInterpreter`, `ast.parse` followed by `exec`, `pickl How it starts
The opening of the file, as written. The whole thing — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Maintainer-only. This is the last line of defense before code enters main.
Argument: $ARGUMENTS
Argument handling:
- If
$ARGUMENTScontains a PR URL or#NNreference → audit that pull request viagh. - If
$ARGUMENTSis empty → audit the locally staged changes (your own work).
Mindset: adversarial. Assume the diff might contain a mistake, a misunderstanding, or a deliberate backdoor. Your job is to disprove that assumption before merging. Do not skip steps. Do not accept claims at face value. Verify everything against primary sources.
Users of this app handle their own Anthropic credentials and trust the binary to be safe at a glance. A single malicious or careless merge breaks that trust permanently.
Step 0: Identify and load the change set
If a PR was provided in $ARGUMENTS
- Extract the PR number from the URL or
#NNreference. - Run
gh pr view <PR> --json number,title,body,author,headRefName,baseRefName,url,stateto load metadata. - Run
gh pr diff <PR>to load the actual diff. - Run
gh pr checks <PR>to verify CI status. - Read the linked Issue or Discussion (if any) via
gh issue vieworgh api. - Note the PR author's GitHub handle - you will need it for the CHANGELOG credit later.
If no PR was provided
- Run
git diff --staged. If empty, also checkgit statusand ask the user what to audit. - Treat the user's prior conversation context as the "PR description".
Record the stated intent of the change in one or two sentences. You will check every line against this intent.
Step 1: Verify the diff against the stated intent
Read every changed line. For each non-trivial change, walk through the code path manually:
- Given realistic input, what does the function actually do?
- Does the implementation match what the PR claims?
- Are there side effects beyond what the PR describes?
Critical questions for every change - answer each one:
- Is this change actually necessary for the stated goal? Could the goal be achieved with less surface area?
- What edge cases could break this? (boundary values, malicious input, race conditions, concurrent events, missing/null fields)
- What if the function is invoked in an unexpected order or state?
- Does anything in the diff feel "extra" - touching files or code with no obvious connection to the stated goal? Treat unexplained scope creep as a red flag.
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.
- 12d ago First seen · 244 lines · 0 tokens per session scan A a3ffcf4856fc
pre-merge is a command published in the GitHub repository jens-duttke/usage-monitor-for-claude (282 stars, last pushed 2d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,925 tokens. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
pr
Analyze changes, detect scope issues, and create a well-structured PR.
review
Unified review orchestrator — detect changes, dispatch reviewers, validate findings, optionally post GitHub inline comments.
generate-linear-worklog
You are tasked with generating a technical work log comment for a Linear issue based on recent git commits.
add-changelog
Generate and maintain project changelog.
git-status
Command "git-status" from qdhenry/Claude-Command-Suite, covering git status command and instructions.
changelog-demo-command
Command "changelog-demo-command" from qdhenry/Claude-Command-Suite, covering demo command for changelog and instructions.