Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/avelikiy/great_ctonpx agentmods add commands/avelikiy/great_cto/crystallizeWrote 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/avelikiy/great_cto/crystallize)<a href="https://agentmods.dev/commands/avelikiy/great_cto/crystallize"><img src="https://agentmods.dev/badge/commands/avelikiy/great_cto/crystallize.svg" alt="Measured on agentmods" 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.00012 | $0.08410 |
| Opus 5 | $0.00006 | $0.04205 |
| Sonnet 5 | $0.00002 | $0.01682 |
| Haiku 4.5 | $0.00001 | $0.00841 |
Grade A, and why
crystallize scanned grade A with 0 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 today.
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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 716 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the great_cto knowledge crystallization command. You read incident knowledge extractions (KE files), promote them to global patterns (GP files), and propose concrete improvements to agent workflow files. Human approves every agent change.
Privacy rule: GP files and proposals never contain project names, client names,
URLs, credentials, or identifying data. Generic technology descriptors only.
See skills/great_cto/references/knowledge-extraction.md for the full privacy checklist.
Setup
KE_DIR=~/.great_cto/extractions
GP_DIR=~/.great_cto/global-patterns
PROPOSAL_DIR=~/.great_cto/proposals
METRICS_DIR=~/.great_cto/metrics
mkdir -p "$KE_DIR" "$GP_DIR" "$PROPOSAL_DIR" "$METRICS_DIR"
# Plugin dir (for agent files)
PLUGIN_DIR=$(find ~/.claude -name "ARCHETYPES.md" -path "*/great_cto/*" 2>/dev/null | sort -V | tail -1 | xargs dirname)
[ -z "$PLUGIN_DIR" ] && PLUGIN_DIR=$(dirname "$(find . .great_cto \
-name "ARCHETYPES.md" 2>/dev/null | head -1)" 2>/dev/null)
TODAY=$(date +%Y-%m-%d)
Dispatch by argument
ARG="${1:-status}"
case "$ARG" in
# `approve GP-NNNN [--no-eval "<reason>"]` — the flag is the ONLY way to
# activate a pattern that carries no eval evidence, and the reason is logged.
approve) SUBCOMMAND=approve; GP_ID="$2"
if [ "$3" = "--no-eval" ]; then NO_EVAL_REASON="${*:4}"; fi ;;
reject) SUBCOMMAND=reject; GP_ID="$2"; REASON="${@:3}" ;;
rollback) SUBCOMMAND=rollback; GP_ID="$2" ;;
propose) SUBCOMMAND=propose; GP_ID="$2" ;; # NEW: Sprint 3 — PR-gate
prune) SUBCOMMAND=prune ;;
status) SUBCOMMAND=status ;;
*) SUBCOMMAND=review ;; # default: show pending KEs + proposals
esac
Subcommand: status / review (default)
Show all pending KE files not yet promoted + all proposals awaiting approval.
echo "=== CRYSTALLIZE STATUS ==="
echo ""
# Pending KE files
PENDING_KE=$(ls "$KE_DIR"/KE-*.yaml 2>/dev/null | while read f; do
if ! grep -q "^promoted_to:" "$f" 2>/dev/null; then echo "$f"; fi
done)
KE_COUNT=$(echo "$PENDING_KE" | grep -c "." 2>/dev/null || echo 0)
echo "Pending extractions (KE): $KE_COUNT"
if [ "$KE_COUNT" -gt 0 ]; then
echo "$PENDING_KE" | while read ke; do
KE_ID=$(grep "^ke_id:" "$ke" | awk '{print $2}')
AGENT=$(grep "^target_agent:" "$ke" | awk '{print $2}')
CONF=$(grep "^confidence:" "$ke" | awk '{print $2}')
ITER=$(grep "^ iterations:" "$ke" | awk '{print $2}')
MTTR=$(grep "^mttr_reduction_estimate:" "$ke" | sed "s/mttr_reduction_estimate: //")
echo " • $KE_ID → $AGENT (confidence=$CONF iter=$ITER mttr_reduction=$MTTR)"
done
fi
echo ""
# Pending proposals
PENDING_PROP=$(ls "$PROPOSAL_DIR"/PROPOSAL-*.md 2>/dev/null | while read f; do
if grep -q "^Status: PENDING_APPROVAL" "$f" 2>/dev/null; then echo "$f"; fi
done)
PROP_COUNT=$(echo "$PENDING_PROP" | grep -c "." 2>/dev/null || echo 0)
echo "Pending proposals (GP): $PROP_COUNT"
if [ "$PROP_COUNT" -gt 0 ]; then
echo "$PENDING_PROP" | while read prop; do
GP_ID=$(grep "^GP_ID:" "$prop" | awk '{print $2}')
TARGET=$(grep "^Target agent:" "$prop" | sed "s/Target agent: //")
EVIDENCE=$(grep "^Evidence:" "$prop" | sed "s/Evidence: //")
echo " • $GP_ID → $TARGET — $EVIDENCE"
done
echo ""
echo "Run: /crystallize approve <GP-ID> | /crystallize reject <GP-ID> <reason>"
fi
# Active pattern stats
ACTIVE=$(ls "$GP_DIR"/GP-*.md 2>/dev/null | \
xargs grep -l "^status: active" 2>/dev/null | wc -l | tr -d ' ')
TOTAL_HITS=$(grep -rh "^hits:" "$GP_DIR" 2>/dev/null | \
awk -F': ' '{sum+=$2} END{print sum+0}')
echo ""
echo "Active patterns: ${ACTIVE:-0} | Total hits: ${TOTAL_HITS:-0}"
echo "Run /crystallize (no args) to review, or /crystallize prune to archive stale patterns"
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.
- today Changed 144b72c190e8
- 4d ago First seen · 716 lines · 12 tokens per session scan A e5d5bffc30e4
crystallize is a command published in the GitHub repository avelikiy/great_cto (89 stars, last pushed today), licensed MIT. It adds 12 tokens to every session and 8,410 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other commands, from other repositories
bugfix
TDD-driven bugfix workflow: tester writes failing test (RED) → developer fixes (GREEN) → developer refactors (REFACTOR) → reviewer validates. Accepts issue number, description, or both. Auto-creates PR unless --no-pr flag is passed.
fec-debug
Front-end problem diagnosis and repair: covering build failures, runtime errors, UI exceptions, and interface problems, using a unified diagnostic framework to classify problems by type.
fec-tdd
Use front-end TDD workflow to implement functions, fix bugs, or refactor logic: first write failing tests, then implement minimal code, and then refactor.
dead-code-scan
Scan for dead code, unused imports, duplicates, and zombie code across the project.
esp-debug
Help debug ESP32 crashes, hangs, and peripheral issues.
develop
Implement skill development issues with TDD-governed workflow.