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 commands/cognitx-leyton/codegraph/testgit clone --depth 1 https://github.com/cognitx-leyton/codegraphWhat 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.00014 | $0.01314 |
| Opus 5 | $0.00007 | $0.00657 |
| Sonnet 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 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.
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.
- yesterday First seen · 141 lines · 14 tokens per session scan C c81dbae7bea2
test is a command published in the GitHub repository cognitx-leyton/codegraph (11 stars, last pushed 1mo 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. 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
feedback
Security Design Review — PRD/기획서 기반 보안 의견서·검토 의견서 생성.
compliance
이전 보안 진단 보고서의 Finding들이 패치되었는지 확인하고, 변경된 코드에서 신규 취약점을 탐색합니다.
va
Vulnerability Assessment — 8차원 아키텍처 진단 + Self-Verify + Evidence Verification.
pentest
Penetration Testing — 시나리오 기반 모의해킹 + POC + 라이브 검증 (State Delta 기반).
redteam
Red Team Operations — 인프라 설정 보안 리뷰 + MITRE ATT&CK + Detection Engineering.
verify
Adversarial Verification — 보안 진단 보고서 독립 검증 (Autonomous First).