Borrowing it
Nothing to install: this file belongs to cognitx-leyton/codegraph. 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/cognitx-leyton/codegraph/main/.claude/commands/test.mdgit clone --depth 1 https://github.com/cognitx-leyton/codegraphWrote 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/cognitx-leyton/codegraph/test)<a href="https://agentmods.dev/commands/cognitx-leyton/codegraph/test"><img src="https://agentmods.dev/badge/commands/cognitx-leyton/codegraph/test/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/cognitx-leyton/codegraph/test"><img src="https://agentmods.dev/badge/commands/cognitx-leyton/codegraph/test.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.00014 | $0.01314 |
| Opus 5.5 | $0.00006 | $0.00526 |
| Sonnet 5.5 | $0.00003 | $0.00263 |
| Haiku 4.5 | $0.00001 | $0.00131 |
Grade C, and why
test scanned grade C 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 2mo 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.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf "$_tmpdir" How it starts
The opening of the file, as written. The whole thing — 141 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test (Step 10)
Scope: $ARGUMENTS (default: all)
Run progressive validation — from unit tests through real-world indexing.
Stage 1: Unit Tests
cd codegraph
.venv/bin/python -m pytest tests/ -q
python -m compileall codegraph/ -q
Pass criteria: All tests pass, zero warnings, byte-compile clean.
Stage 2: Install Test
Test that the published package is installable with version assertion and retry for PyPI propagation lag:
SCOPE="${ARGUMENTS:-all}"
if [[ "$SCOPE" != "all" && "$SCOPE" != "install" && "$SCOPE" != "" ]]; then
echo "SKIP: install test (scope is '$SCOPE', not 'install' or 'all')"
else
LATEST=$(grep '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
MAX_ATTEMPTS=3
BACKOFF=15
INSTALL_OK=false
for attempt in $(seq 1 $MAX_ATTEMPTS); do
_tmpdir=$(mktemp -d)
TMPVENV="$_tmpdir/venv"
python3 -m venv "$TMPVENV"
"$TMPVENV/bin/pip" install "cognitx-codegraph[python]==$LATEST" --no-cache-dir -q
INSTALLED=$("$TMPVENV/bin/pip" show cognitx-codegraph 2>/dev/null | grep '^Version:' | awk '{print $2}')
INSTALLED=${INSTALLED:-NONE}
rm -rf "$_tmpdir"
if [ "$INSTALLED" = "$LATEST" ]; then
echo "Install OK — version $INSTALLED verified (attempt $attempt/$MAX_ATTEMPTS)"
INSTALL_OK=true
break
fi
if [ "$attempt" -lt "$MAX_ATTEMPTS" ]; then
echo "Attempt $attempt/$MAX_ATTEMPTS: expected $LATEST, got $INSTALLED. Retrying in ${BACKOFF}s..."
sleep $BACKOFF
BACKOFF=$((BACKOFF * 2))
else
echo "Install FAILED — expected $LATEST but got $INSTALLED after $MAX_ATTEMPTS attempts"
exit 1
fi
done
fi
Pass criteria: Installed version matches pyproject.toml version exactly. Retries up to 3 times with exponential backoff (15s, 30s) for PyPI propagation lag.
Note: The
exit 1ensures a non-zero exit in standalone / CI contexts. When run as a Claude Code slash command, Claude also reads the "Install FAILED" echo to determine the outcome.
Tip: Run
/test unitto skip the install test during local development.
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.
- 2mo ago First seen · 141 lines · 14 tokens per session scan C c81dbae7bea2
test is a command published in the GitHub repository cognitx-leyton/codegraph (12 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 14 tokens to every session and 1,314 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other commands, from other repositories
session
Complete guide to managing pair programming sessions.
test-tdd
Run when user calls /test-tdd. Scans modified files, locates their corresponding unit/integration test suites, and runs them.
kill-mutants
Analyze surviving mutants from a mutation testing run and write targeted unit tests to kill them. Re-runs mutations to confirm kills.
lg:node
Create, modify, and manage nodes in LangGraph graphs including LLM nodes, tool nodes, human-in-the-loop, subgraphs, and conditional nodes.
story-and-test
For the component(s) in scope.
test
Execute a comprehensive test run for the following target.