forked from bchanot/claude
fix(banner): drop stale passive-cost constants and the budget row
The banner, plugin-advisor and status-reporter kept hand-copied token costs (gstack 2750, ui-ux 400) that the 2026-09-28 prune fixed only in doctor.sh. The banner budget row and its now-dead detect_plan are gone; the agents point to make doctor for the measured cost.
This commit is contained in:
1 parent
a655b06eee
commit
1971b8d0f5
6 files changed
+51
-116
No files matched your search
+22
-22
@@ -104,7 +104,7 @@ PROFILE: [active skill profile — name + match%, or "<name> (default — not ap
|
||||
SIGNALS: [detected signals]
|
||||
COMPLEXITY: <score>% — <simple|moderate|complex|enterprise>
|
||||
PLAN: <Max|Pro|Free (echoed from REQUEST) | unknown (not provided)> (budget: ~<N>t | n/a)
|
||||
COST ESTIMATE: ~Xt passive tokens (all active plugins combined)
|
||||
COST ESTIMATE: run make doctor (measured; no per-plugin constants here)
|
||||
|
||||
RECOMMENDATIONS:
|
||||
✅ KEEP : [plugin] — [reason]
|
||||
@@ -147,9 +147,9 @@ ACTION REQUIRED? YES / NO
|
||||
| `multi-session` | gsd v2 CLI | — | Run `gsd` in terminal, not CC plugin |
|
||||
| `fast-libs` | context7 | — | Doc freshness critical |
|
||||
| `multi-agent` + `complex-arch` | gsd v2 CLI | — | GSD v2 preferred for multi-session coordination |
|
||||
| `simple` / single-session | — | gsd, gstack, ui-ux-pro-max | Saves ~3000-5000t |
|
||||
| `simple` / single-session | — | gsd, gstack, ui-ux-pro-max | Saves passive tokens |
|
||||
| `embedded` / firmware | — | all toggles (superpowers skills vendored, always on) | workflow: /analyze → /hotfix or /bugfix or /ship-feature |
|
||||
| backend/lib/CLI only | — | ui-ux-pro-max, gstack | ~3100t saved |
|
||||
| backend/lib/CLI only | — | ui-ux-pro-max, gstack | passive tokens saved |
|
||||
| small project / hotfix | — | gstack, gsd | Use /hotfix, /bugfix, or /feat |
|
||||
|
||||
**GSD v2 note:** `gsd-pi` is a standalone CLI (Pi SDK), not a Claude Code plugin. Zero passive token cost in CC sessions. Recommend when: feature > 1 day, multiple isolated context windows needed, crash recovery, cost tracking, or parallel workers. Usage: `gsd` in terminal → `/gsd auto`.
|
||||
@@ -190,17 +190,17 @@ When the plugin-advisor detects a `simple` or `hotfix` signal, suggest the appro
|
||||
|
||||
### Recommended sets by project type
|
||||
|
||||
| Project type | Plugins ON | OFF | Passive cost |
|
||||
|---|---|---|---|
|
||||
| Backend API / microservice | (superpowers skills always on), context7 (if fast libs) | ui-ux-pro-max, gstack | ~0t |
|
||||
| Frontend SPA / SSR | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles, context7 | gstack | ~600t |
|
||||
| Full-stack SaaS | (superpowers skills always on), gstack, ui-ux-pro-max, impeccable, design-motion-principles, context7 | — | ~3400t |
|
||||
| CLI tool / library | (superpowers skills always on) | all toggles | ~0t |
|
||||
| Multi-session large feature | (superpowers skills always on) + gsd v2 CLI (external) | — | ~0t CC |
|
||||
| Quick fix / hotfix | (superpowers skills always on) | all toggles | ~0t |
|
||||
| Design system / component lib | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles | gstack, gsd | ~400t |
|
||||
| Fast-evolving libs (Next.js etc.) | (superpowers skills always on), context7 | — | ~200t |
|
||||
| Enterprise multi-agent orchestration | (superpowers skills always on) + gsd v2 (external) | plugin-dev | ~0t CC |
|
||||
| Project type | Plugins ON | OFF |
|
||||
|---|---|---|
|
||||
| Backend API / microservice | (superpowers skills always on), context7 (if fast libs) | ui-ux-pro-max, gstack |
|
||||
| Frontend SPA / SSR | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles, context7 | gstack |
|
||||
| Full-stack SaaS | (superpowers skills always on), gstack, ui-ux-pro-max, impeccable, design-motion-principles, context7 | — |
|
||||
| CLI tool / library | (superpowers skills always on) | all toggles |
|
||||
| Multi-session large feature | (superpowers skills always on) + gsd v2 CLI (external) | — |
|
||||
| Quick fix / hotfix | (superpowers skills always on) | all toggles |
|
||||
| Design system / component lib | (superpowers skills always on), ui-ux-pro-max, impeccable, design-motion-principles | gstack, gsd |
|
||||
| Fast-evolving libs (Next.js etc.) | (superpowers skills always on), context7 | — |
|
||||
| Enterprise multi-agent orchestration | (superpowers skills always on) + gsd v2 (external) | plugin-dev |
|
||||
|
||||
> rtk is always on at 0 context tokens; security-guidance is always on and
|
||||
> costs quota out of band (LLM reviews), not context — both omitted from
|
||||
@@ -212,7 +212,7 @@ When the plugin-advisor detects a `simple` or `hotfix` signal, suggest the appro
|
||||
RULE: IF "mobile" signal (React Native/Expo/Flutter detected):
|
||||
→ gstack OFF — no browser QA on mobile
|
||||
→ Docker NOT relevant — no server-side containerization for mobile
|
||||
→ ui-ux-pro-max OPTIONAL (~400t) — only if design system complexity is high
|
||||
→ ui-ux-pro-max OPTIONAL — only if design system complexity is high
|
||||
|
||||
RULE: IF "monorepo" signal detected:
|
||||
→ scan each top-level package individually for frontend/deploy/fast-libs signals
|
||||
@@ -222,25 +222,25 @@ RULE: IF "monorepo" signal detected:
|
||||
→ passive cost estimate = highest-cost package profile (other packages add nothing)
|
||||
|
||||
RULE: IF "frontend" signal OR .tsx/.jsx count > 0:
|
||||
→ ui-ux-pro-max ON if "design-system" signal (~400t)
|
||||
→ ui-ux-pro-max ON if "design-system" signal
|
||||
→ impeccable ON (external skill, 0t passive — ~/.claude/skills/pack-design/skills/impeccable)
|
||||
→ design-motion-principles ON if anim-lib-installed or description mentions animation/motion (external, 0t passive)
|
||||
|
||||
RULE: IF "deploy" AND "browser-qa" signals:
|
||||
→ gstack ON (~2750t) — full-product workflow
|
||||
→ gstack ON — full-product workflow
|
||||
|
||||
RULE: IF "multi-session" OR multi-day feature:
|
||||
→ Recommend gsd v2 CLI: npm install -g gsd-pi → gsd → /gsd auto
|
||||
→ Zero passive CC token cost
|
||||
|
||||
RULE: IF "fast-libs" (Next.js/React 18+/Prisma/Supabase/Drizzle):
|
||||
→ context7 ON (~200t)
|
||||
→ context7 ON (CLI; its find-docs skill always loads)
|
||||
|
||||
RULE: IF "multi-agent" AND "complex-arch":
|
||||
→ gsd v2 CLI recommended (0t passive, multi-session coordination)
|
||||
|
||||
RULE: IF "simple" OR "hotfix":
|
||||
→ Disable all toggles. ~800t base only.
|
||||
→ Disable all toggles, base only.
|
||||
|
||||
RULE: IF "embedded" signal (firmware, bare-metal, microcontroller, or Makefile+C without Node/Rust/Go):
|
||||
→ Disable ALL toggles including gstack, context7, plugin-dev
|
||||
@@ -252,11 +252,11 @@ RULE: IF "embedded" signal (firmware, bare-metal, microcontroller, or Makefile+C
|
||||
→ NOTE: print "embedded project detected — minimal plugin footprint recommended"
|
||||
|
||||
RULE: IF plugin-dev ON AND no `skill-creation` signal detected:
|
||||
→ WARN: plugin-dev active but no skill-creation signal (~100t saved if disabled)
|
||||
→ WARN: plugin-dev active but no skill-creation signal (saves its passive tokens if disabled)
|
||||
→ Disable unless you're actively building custom plugins or skills
|
||||
|
||||
RULE: IF `skill-creation` signal:
|
||||
→ plugin-dev ON (~100t)
|
||||
→ plugin-dev ON
|
||||
→ superpowers skills (vendored, always on): used for skill scaffolding (writing-skills)
|
||||
|
||||
RULE: IF `browser-qa` signal (e2e tests, Playwright/Cypress/Puppeteer in deps):
|
||||
@@ -264,7 +264,7 @@ RULE: IF `browser-qa` signal (e2e tests, Playwright/Cypress/Puppeteer in deps):
|
||||
→ context7 OPTIONAL (depends on framework version)
|
||||
|
||||
RULE: IF `design-system` signal (tokens, theme files, Storybook present):
|
||||
→ ui-ux-pro-max ON (~400t)
|
||||
→ ui-ux-pro-max ON
|
||||
→ impeccable ON (external skill, 0t passive)
|
||||
→ design-motion-principles ON (external skill, 0t passive)
|
||||
→ WARN if all three OFF with this signal: significant design gap
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: status-reporter
|
||||
description: Read-only project-status engine — dispatched by /status. Collects plugin roster + passive-cost estimate (doctor.sh constants), git state, build/tests, GSD milestone into one snapshot.
|
||||
description: Read-only project-status engine — dispatched by /status. Collects plugin roster (passive cost via make doctor), git state, build/tests, GSD milestone into one snapshot.
|
||||
tools: Read, Bash, Glob, Grep
|
||||
model: haiku
|
||||
effort: low
|
||||
@@ -25,15 +25,9 @@ cat ~/.claude/lib/../version.txt 2>/dev/null || echo "unknown" # lib symlink re
|
||||
bash "$HOME/.claude/lib/profile.sh" -C "$PWD" current --plain 2>/dev/null | grep -E '^(profile|pack-[a-z0-9-]+)=' || echo "profile-unavailable"
|
||||
command -v rtk &>/dev/null && echo "rtk: installed" || echo "rtk: missing"
|
||||
command -v gsd &>/dev/null && gsd --version 2>/dev/null | head -1 || echo "gsd: not installed"
|
||||
|
||||
# Passive token cost — source of truth: doctor.sh's constants block
|
||||
# (PLUGIN_TOKENS + <n> per detect_* line). Read it, sum ONLY the plugins
|
||||
# found active above. Never invent a number outside these constants.
|
||||
grep -E 'PLUGIN_TOKENS \+ [0-9]+' "$(readlink -f "$HOME/.claude/lib")/../doctor.sh" 2>/dev/null
|
||||
# grep empty (doctor.sh missing/moved) → report the plugin count only and
|
||||
# defer cost to /plugin-check.
|
||||
```
|
||||
|
||||
The passive token cost is not computed here: `make doctor` measures it.
|
||||
`~/.claude/plugins/cache` = installed, not active. `Plugins ON:` = rtk (if present) + the names printed by `list_on_plugins` (part before `@`) + the `pack-*=on` packs.
|
||||
Check `~/.claude.json` for active MCP servers.
|
||||
|
||||
@@ -141,7 +135,7 @@ PROJECT STATUS
|
||||
|
||||
CONFIG
|
||||
Version : v<N>
|
||||
Plugins ON: <list> (~<X>t passive — doctor.sh constants; full audit → /plugin-check)
|
||||
Plugins ON: <list> (passive cost: make doctor; full audit → /plugin-check)
|
||||
GSD v2 : installed / not installed
|
||||
|
||||
PROJECT
|
||||
|
||||
+1
-38
@@ -159,42 +159,6 @@ if [ -n "${CLAUDE_CODE_EFFORT_LEVEL:-}" ]; then
|
||||
EFFORT_WARN="⚠️ CLAUDE_CODE_EFFORT_LEVEL=${CLAUDE_CODE_EFFORT_LEVEL} set: skill/agent effort pins ignored"
|
||||
fi
|
||||
|
||||
# Detect plan and set passive token budget
|
||||
PLAN=$(detect_plan 2>/dev/null || echo "pro")
|
||||
case "$PLAN" in
|
||||
max) _budget=20000; PLAN_LABEL="Max" ;;
|
||||
pro) _budget=11000; PLAN_LABEL="Pro" ;;
|
||||
*) _budget=11000; PLAN_LABEL="Pro" ;;
|
||||
esac
|
||||
|
||||
# Quick passive token cost estimate
|
||||
# Only count plugins that are ACTIVE (detected as ON), not just installed
|
||||
# superpowers dropped 2026-09-28 (tier 2 of the skill-catalog prune): its
|
||||
# 7 vendored skills are counted by the skill catalog, not a plugin cost.
|
||||
_passive_t=0
|
||||
|
||||
# Token costs for toggle plugins — map display name to cost
|
||||
declare -A _plugin_costs=(
|
||||
[gstack]=2750
|
||||
[ui-ux-pro-max]=400
|
||||
[plugin-dev]=100
|
||||
[context7]=200
|
||||
[graphify]=300
|
||||
)
|
||||
for _p in "${TOGGLE_ACTIVE[@]}"; do
|
||||
_cost="${_plugin_costs[$_p]:-0}"
|
||||
_passive_t=$((_passive_t + _cost))
|
||||
done
|
||||
_budget_pct=$((_passive_t * 100 / _budget))
|
||||
if [ "$_budget_pct" -gt 50 ]; then
|
||||
TOKEN_WARN="⚠️ ~${_passive_t}t passif (${_budget_pct}% budget $PLAN_LABEL)"
|
||||
elif [ "$_budget_pct" -gt 25 ]; then
|
||||
TOKEN_WARN="~${_passive_t}t passif (${_budget_pct}% budget $PLAN_LABEL)"
|
||||
else
|
||||
TOKEN_WARN=""
|
||||
fi
|
||||
unset _passive_t _budget_pct _budget
|
||||
|
||||
echo ""
|
||||
echo "┌─ Claude Code config ──────────────────────────────────┐"
|
||||
# "ALWAYS ON" row — actual state, not hardcoded. RTK is a binary on PATH;
|
||||
@@ -267,7 +231,6 @@ else
|
||||
fi
|
||||
unset _active_count _inactive_count
|
||||
printf "│ 🖥️ CLI : %-40s│\n" "$GSD_STATUS"
|
||||
[ -n "$TOKEN_WARN" ] && printf "│ 💰 %-44s│\n" "${TOKEN_WARN:0:44}"
|
||||
printf "│ 📦 v%-45s│\n" "$CONFIG_VERSION"
|
||||
if [ -n "$GF_REFRESHED" ]; then
|
||||
_gf_line="hooks refreshed: $GF_REFRESHED → commit .githooks/"
|
||||
@@ -460,4 +423,4 @@ fi
|
||||
unset _ss_digest
|
||||
|
||||
echo ""
|
||||
unset TOKEN_WARN PROFILE_PLAIN
|
||||
unset PROFILE_PLAIN
|
||||
+1
-25
@@ -4,7 +4,7 @@
|
||||
# Sourced by: session-start.sh, doctor.sh, agents/status-reporter.md
|
||||
#
|
||||
# detect_* return 0 (detected) or 1 (not detected), silently — callers
|
||||
# handle messaging. detect_plan and list_on_plugins print to stdout.
|
||||
# handle messaging. list_on_plugins prints to stdout.
|
||||
# ============================================================
|
||||
|
||||
# --- Always-on plugins ---
|
||||
@@ -86,27 +86,3 @@ detect_graphifyy() {
|
||||
# Graphifyy — codebase knowledge graph, installed via pipx
|
||||
command -v graphify &>/dev/null
|
||||
}
|
||||
|
||||
|
||||
# --- Plan detection ---
|
||||
|
||||
detect_plan() {
|
||||
# Detect Claude plan: max or pro.
|
||||
# Never call the `claude` CLI here: it starts a session whose
|
||||
# SessionStart hook calls detect_plan again (BLK-043).
|
||||
# Checks ~/.claude.json for model access hints.
|
||||
# Returns plan name on stdout, always exits 0.
|
||||
local claude_json="$HOME/.claude.json"
|
||||
if [ -f "$claude_json" ]; then
|
||||
# Max plan: has opus model access or max flag
|
||||
if grep -q '"planType".*"max"' "$claude_json" 2>/dev/null; then
|
||||
echo "max"; return 0
|
||||
fi
|
||||
# Check cached features for max indicators
|
||||
if grep -q '"tengu_cobalt_compass": true' "$claude_json" 2>/dev/null \
|
||||
&& grep -q '"tengu_harbor": true' "$claude_json" 2>/dev/null; then
|
||||
echo "max"; return 0
|
||||
fi
|
||||
fi
|
||||
echo "pro"
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# lib/tests/detect-plan.test.sh
|
||||
# Regression for BLK-043: detect_plan must never call the claude CLI
|
||||
# (a hook-launched claude re-enters session-start.sh: fork bomb).
|
||||
# lib/tests/hook-recursion-guard.test.sh
|
||||
# Regression for BLK-043: session-start.sh must guard against re-entry
|
||||
# and never call the claude CLI (a hook-launched claude re-enters the
|
||||
# hook: fork bomb).
|
||||
set -u
|
||||
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
LIB="${DETECT_PLUGINS_LIB:-$ROOT/lib/detect-plugins.sh}"
|
||||
HOOK="$ROOT/hooks/session-start.sh"
|
||||
WORK=$(mktemp -d) || exit 1
|
||||
trap 'rm -rf "$WORK"' EXIT
|
||||
@@ -17,27 +17,11 @@ check() { if [ "$2" = "$3" ]; then pass=$((pass+1)); else fail=$((fail+1));
|
||||
. "$ROOT/lib/tests/claude-stub.sh" || exit 1
|
||||
claude_stub_install "$WORK"
|
||||
|
||||
# detect_plan, no .claude.json: pro, no claude call.
|
||||
mkdir -p "$WORK/empty"
|
||||
out=$(HOME="$WORK/empty" bash -c 'source "$1"; detect_plan' _ "$LIB")
|
||||
check T1-no-json-plan "$out" pro
|
||||
check T1-no-json-calls "$(claude_stub_calls)" 0
|
||||
|
||||
# detect_plan, max markers: max, no claude call.
|
||||
mkdir -p "$WORK/maxhome"
|
||||
printf '{"tengu_cobalt_compass": true, "tengu_harbor": true}\n' \
|
||||
>"$WORK/maxhome/.claude.json"
|
||||
: >"$CLAUDE_LOG"
|
||||
out=$(HOME="$WORK/maxhome" bash -c 'source "$1"; detect_plan' _ "$LIB")
|
||||
check T2-max-plan "$out" max
|
||||
check T2-max-calls "$(claude_stub_calls)" 0
|
||||
|
||||
# Hook HOME: real ~/.claude entries + max fixture (no fallback needed).
|
||||
# Hook HOME: real ~/.claude entries.
|
||||
mkdir -p "$WORK/hookhome/.claude" "$WORK/proj"
|
||||
for e in "$HOME"/.claude/*; do
|
||||
ln -s "$e" "$WORK/hookhome/.claude/$(basename "$e")"
|
||||
done
|
||||
cp "$WORK/maxhome/.claude.json" "$WORK/hookhome/.claude.json"
|
||||
|
||||
# Guard: hook exits 0 silently when already running.
|
||||
out=$(cd "$WORK/proj" && HOME="$WORK/hookhome" SESSION_START_RUNNING=1 \
|
||||
@@ -62,5 +46,5 @@ chmod +x "$WORK/stub/git"
|
||||
check T4-child-sees-guard "$(head -1 "$GIT_LOG")" 1
|
||||
check T4-hook-no-claude-calls "$(claude_stub_calls)" 0
|
||||
|
||||
printf 'detect-plan: %d passed, %d failed\n' "$pass" "$fail"
|
||||
printf 'hook-recursion-guard: %d passed, %d failed\n' "$pass" "$fail"
|
||||
[ "$fail" -eq 0 ]
|
||||
@@ -89,6 +89,10 @@ check SB3-toggle-on-uiux "$(has "$(row '🟢 ON' "$out")" ui-ux-pro-max)" 1
|
||||
ok="$(row '✅ ON' "$out")"
|
||||
check SB3-onrow-no-pr-review "$(has "$ok" pr-review-toolkit)" 0
|
||||
|
||||
# SB9: no passive-cost row and no plan budget in the banner
|
||||
check SB9-no-cost-row "$(has "$out" 💰)" 0
|
||||
check SB9-no-budget "$(has "$out" budget)" 0
|
||||
|
||||
# uiux <home> <proj>: exit status of detect_uiux_pro_max, PROFILE_PLAIN unset
|
||||
uiux() {
|
||||
(cd "$WORK/$2" && unset PROFILE_PLAIN && HOME="$WORK/$1" bash -c \
|
||||
@@ -126,5 +130,19 @@ check SB7-empty-list-rtk-only "$ao" rtk
|
||||
# SB8: no hook run of this suite called the claude CLI (BLK-043)
|
||||
check SB8-no-claude-calls "$(claude_stub_calls)" 0
|
||||
|
||||
# SB10: no hand-copied passive-cost figure or dead plan path left
|
||||
# gone <file> <regex> [filter]: 1 when no line (after the filter) matches
|
||||
gone() {
|
||||
if grep -v "${3:-^\$}" "$ROOT/$1" | grep -qE -- "$2"; then echo 0
|
||||
else echo 1; fi
|
||||
}
|
||||
check SB10-hook-costs "$(gone hooks/session-start.sh \
|
||||
'_plugin_costs|TOKEN_WARN|detect_plan')" 1
|
||||
check SB10-lib-detect-plan "$(gone lib/detect-plugins.sh detect_plan)" 1
|
||||
check SB10-reporter-const "$(gone agents/status-reporter.md \
|
||||
'PLUGIN_TOKENS|~[1-9][0-9-]*t')" 1
|
||||
check SB10-advisor-figures "$(gone agents/plugin-advisor.md \
|
||||
'~[1-9][0-9-]*t' 'plan budget')" 1
|
||||
|
||||
printf 'session-banner: %d passed, %d failed\n' "$pass" "$fail"
|
||||
[ "$fail" -eq 0 ]
|
||||
Reference in new issue
Block a user