ワンクリックで
token-stats
Show token economics comparing usage with turbo-search vs without. Demonstrates actual savings from search-first approach.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Show token economics comparing usage with turbo-search vs without. Demonstrates actual savings from search-first approach.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | token-stats |
| description | Show token economics comparing usage with turbo-search vs without. Demonstrates actual savings from search-first approach. |
Show the token savings achieved by using search-first exploration vs blind file reading.
When the user invokes /token-stats, analyze token usage and display savings.
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")
ACTIVITY_FILE="$REPO_ROOT/.simba/search/activity.log"
# Count files read this session
if [ -f "$ACTIVITY_FILE" ]; then
echo "=== Session Activity ==="
FILES_READ=$(grep -c "READ:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
FILES_EDITED=$(grep -c "EDIT:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
SEARCHES=$(grep -c "SEARCH:" "$ACTIVITY_FILE" 2>/dev/null || echo "0")
echo "Files read: $FILES_READ"
echo "Files edited: $FILES_EDITED"
echo "Searches performed: $SEARCHES"
else
echo "No activity log found for this session"
fi
REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || echo "$PWD")
# Total files in codebase
TOTAL_FILES=$(rg --files "$REPO_ROOT" 2>/dev/null | wc -l | tr -d ' ')
# Estimate total tokens (rough: ~1.33 tokens per word, ~3 words per line)
TOTAL_LINES=$(rg -c '' "$REPO_ROOT" 2>/dev/null | awk -F: '{s+=$2} END {print s}')
ESTIMATED_TOTAL_TOKENS=$((TOTAL_LINES * 4 / 3))
echo ""
echo "=== Codebase Size ==="
echo "Total indexable files: $TOTAL_FILES"
echo "Total lines: $TOTAL_LINES"
echo "Estimated tokens: $ESTIMATED_TOTAL_TOKENS"
uv run python -m simba.search stats
Based on the gathered data, calculate and present:
Token Economics Model:
| Scenario | Calculation | Typical Cost |
|---|---|---|
| Blind exploration | Read 20+ files to find relevant code | ~50,000 tokens |
| With turbo-search | Search (50 tokens) + Read 3-5 targeted files | ~5,000 tokens |
| Savings | ~90% |
Present this table to the user:
TOKEN ECONOMICS DASHBOARD
Codebase: [PROJECT_NAME]
Total Files: [X] | Total Lines: [Y] | Est. Tokens: [Z]
THIS SESSION
Searches performed: [N] (~50 tokens each)
Files read (targeted): [M] (~1,000 tokens each)
Files edited: [K]
ESTIMATED USAGE WITH PLUGIN: ~[X] tokens
ESTIMATED WITHOUT (blind read): ~[Y] tokens
SAVINGS: ~[Z]% ([Y-X] tokens saved)
HISTORICAL (ALL SESSIONS)
Total sessions: [N]
Total files tracked: [M]
Knowledge entries: [K]
Facts stored: [F]
Cumulative savings: ~[X] tokens
(Based on [S] search-first explorations)
Use these estimates for calculations:
SEARCH_COST = 50 # tokens per qmd search
FILE_READ_COST = 1000 # avg tokens per file read
BLIND_EXPLORATION_FILES = 20 # files typically read without search
TARGETED_READ_FILES = 3 # files read with search-first approach
# With plugin
with_plugin = (SEARCHES * SEARCH_COST) + (FILES_READ * FILE_READ_COST)
# Without plugin (estimate)
without_plugin = BLIND_EXPLORATION_FILES * FILE_READ_COST
# Savings
savings_tokens = without_plugin - with_plugin
savings_percent = (savings_tokens / without_plugin) * 100
End with actionable suggestions:
Pro Tips to Maximize Savings:
- Use 'qmd search' before reading any file
- Run /remember at session end to build context
- Check /memory-stats for accumulated knowledge
- The more you use it, the smarter it gets!
Enforce Simba's Codex lifecycle routine for coding tasks. Use when starting or finishing implementation work in a Simba-enabled repo to run `simba codex-status` at start, handle any still-pending raw Codex transcript extraction, and run `simba codex-finalize` before final handoff.
Extract learnings from session transcripts and store in semantic memory database
Self-correcting memory recall — when recalled memories are ambiguous or conflicting, re-query for the specific entity (or ask) before answering, and never fabricate when memory is insufficient
Review recent memories and remove invalid or misleading ones from the semantic memory database
View statistics and recent entries from the persistent memory database. Shows session count, knowledge areas, facts, and recent activity.
Local hybrid search for markdown notes and docs. Use BEFORE reading files to save tokens - search first, read only what's relevant. Provides 90% token savings on exploration tasks.