Recommendation Scoring#
Overview#
Decant surfaces up to 12 signal recommendations per run, ranked by a numeric score and drawn from a pool of independently-computed signal generators . Each generator applies its own eligibility filter and scoring formula; the results are merged, sorted descending by score, and sliced to the top 12 . All signals look at a rolling 30-day window .
The two Recommendation kinds are:
signalβ data-derived from the session archive; scored and ranked.catalogβ evergreen best-practice suggestions; alwaysscore: 0and appended after signals .
Signal Generators and Their Scores#
All generators live in src/recommendations.ts.
Error Hotspots β rate Γ calls#
errorHotspots() is the highest-priority signal class. Eligibility: a tool must have β₯ 20 calls and an error rate β₯ 12%. Score formula:
score = (errors / calls) Γ calls // i.e. raw error count
A tool with a 50% error rate on 200 calls scores 100, while a 12% rate on 20 calls scores 2.4. This means tools with both high rates and high volume consistently surface at the top.
Churn Files β editors Γ 1.5#
churnFiles() finds files edited in β₯ 6 distinct sessions in the window. Score: editors Γ 1.5 . A file edited in 10 sessions scores 15.
Hot Context Files β readers#
hotContextFiles() finds files read in β₯ 8 sessions with β€ 2 edit sessions β stable context being re-derived every time. Score: readers . Up to 2 files are emitted.
Search-Heavy Usage β ratio Γ 2#
searchHeavy() triggers when Grep/Glob calls-per-session exceeds 5.0 (with a minimum of 20 sessions in the window). Score: ratio Γ 2 . At a ratio of 8 searches/session the score is 16.
Abandoned Rate β pct / 3#
abandonedRate() triggers when the abandoned-session share exceeds 25%, with a minimum of 10 classified sessions. Score: pct / 3 . A 60% abandon rate scores 20.
Ingest Health β affected Γ 2#
ingestHealth() triggers when β₯ 10% of sessions carry ingest diagnostics, with a minimum of 15 sessions in the window. Score: affected Γ 2 .
Cost Concentration β fixed 5#
costConcentration() triggers when a single model accounts for β₯ 40% of total estimated spend. Score is a fixed 5 regardless of the concentration percentage .
Heavy-Tool and Heavy-Server Flattening#
heavyTools and heavyServers are intentionally scored below the issue-oriented signals to prevent high usage volume from outranking genuine problems.
| Generator | Threshold | Score formula | Example (200 calls) |
|---|---|---|---|
heavyTools() | β₯ 200 calls, top-2 non-MCP tools | USAGE_SIGNAL_SCORE = 2 | 2 |
heavyServers() | β₯ 50 calls, top-3 MCP servers | USAGE_SIGNAL_SCORE = 2 | 2 |
Both generators use a flat score of 2 regardless of call volume. Usage volume alone is not a problem, so these signals are kept at a fixed floor that loses to every issue-flagging signal. An error hotspot with a 12% rate on 20 calls (the minimum eligibility) scores 2.4 and outranks any usage signal; a tool with 2000 calls at 0% errors still scores 2.
heavyTools is also capped at the top 2 non-MCP tools and heavyServers at the top 3 MCP servers before any threshold check.
Final Ranking#
After all generators run, the merged list is sorted by:
scoredescendingkeyascending (lexicographic tiebreaker)
The top 12 are returned . Catalog recommendations are appended with score: 0 and displayed after all signals.
Key Source#
src/recommendations.tsβ all signal generators, scoring formulas, eligibility thresholds, and thesignals()aggregator.