synaxi-predict

Predicts the cost, turn count, and pass rate of a Claude Code task before it runs — so you can pick the right model without wasting tokens on a bad fit. Closes the loop by capturing actual results and feeding them back into the model.
Part of the Synaxi ecosystem.
Synaxi is a macOS app that cuts Claude API costs by stripping token waste from every request before it leaves your machine — deduplicating tool schemas, pruning stale conversation history, compressing verbose JSON, and more. Average reduction: 40%+ per request, with no code changes and under 1ms added latency. Free for personal use.
synaxi-predict tackles the complementary problem: picking the right model before the task runs. Together they cover both sides of Claude cost control — less waste per token, and fewer tokens on the wrong model.
How it works
/synaxi-predict Fix the failing migration
│
▼
Model Est. cost Turns Pass
─────────────────────────────────────────────
single-haiku $ 0.35 28.1 8% ◀ recommended
single-sonnet $ 0.62 18.4 11%
│
▼ [you pick a model]
│
▼
Subagent runs the task with the chosen model
│
├─ bin/parse-session reads the subagent's session JSONL
│ → exact turns, token counts, real cost (not estimated)
│
├─ Eval agent checks git diff + test output → passed: true/false
│
└─ bin/record-actual logs prediction vs. actuals
→ feeds back into next training run
Predictions use an MLP trained on ~53k agent runs (SWE-bench, SWE-smith, OpenHands, loong0814, real Claude Code runs). Input features: TF-IDF on task text + tree-sitter code complexity features from the current repo (see Features).
Install
Inside any Claude Code session:
/plugin marketplace add BeadW/synaxi-predict
/plugin install synaxi-predict
On the next session start, Claude Code automatically:
- Installs the Python package (
pip install -e)
- Downloads the model artifact (~190MB) from GitHub Releases into your platform data directory (
~/Library/Application Support/synaxi-predict/ on macOS, ~/.local/share/synaxi-predict/ on Linux)
Updates happen the same way — bump version in .claude-plugin/plugin.json, release, and the hook re-runs on next session.
Copy .env.example to .env and add your ANTHROPIC_API_KEY if you plan to run benchmarks.
Manual install (development)
git clone https://github.com/BeadW/synaxi-predict ~/synaxi-predict
cd ~/synaxi-predict
git lfs pull # download trained model (~190MB)
pip install -e .
Usage
Manual: /synaxi-predict
In any Claude Code session, type:
/synaxi-predict Fix the failing login migration
Claude runs the predictor, shows the table, and asks which model you want. After you pick, it dispatches a subagent with that model, then automatically records the actual cost and turns against the prediction.
Automatic: synaxi-predict skill
Once installed, Claude invokes this skill automatically whenever it decides to spawn a subagent — no explicit command needed. The prediction table is computed at skill load time via dynamic injection (tree-sitter code features included), so there's no extra tool call overhead.
CLI
# Predict for a task (shows all models)
bin/predict "Add OAuth login" --repo-path /path/to/project
# Predict for Claude Code models only
bin/predict "Add OAuth login" --models single --repo-path .
# List all supported models
bin/predict --list-models
# Show model training date
bin/predict --version
# Parse a subagent session for exact metrics (agentId from Agent tool result)
bin/parse-session <agentId> /path/to/project
# Record actuals manually
bin/record-actual <pred_id> --turns 18 --cost 0.42 --passed true
Features
Each prediction combines three input groups:
1. Text features — TF-IDF (L2-normalised) over the model name prepended to the task description. Captures task type, verb, domain keywords.
2. Tree-sitter code features — extracted from the Python files in your repo at prediction time. Requires tree-sitter and tree-sitter-python (included in core dependencies). If unavailable the model falls back to text features only.