forked from bchanot/claude
auto-detect plan, complexity scoring, ctx7 cache, graphify in workflows
- detect_plan() auto-detects Max/Pro/Free from ~/.claude.json - session-start budget adapts to plan (Max=20k, Pro=11k, Free=5k) - token counting now uses only ACTIVE plugins, not installed binaries - statusline shows plan label + session duration instead of start time - plugin-advisor: complexity assessment (0-100%) drives tool selection - plugin-advisor: auto-activation with confirmation (PHASE 4) - ruflo OFF by default, GSD v2 preferred for multi-session - init-project: ctx7 pre-fetch + graphify scaffold + graphify full - ship-feature: ctx7 cache check before implementation - frontend-design disabled in installer (doublon with ui-ux-pro-max) - python3 -c moved from deny to ask (unblocks graphify) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
0dac12b885
commit
66beae16b7
@@ -72,3 +72,33 @@ detect_graphifyy() {
|
||||
# Graphifyy — codebase knowledge graph, installed via pipx
|
||||
command -v graphify &>/dev/null
|
||||
}
|
||||
|
||||
|
||||
# --- Plan detection ---
|
||||
|
||||
detect_plan() {
|
||||
# Detect Claude plan: max, pro, or free.
|
||||
# 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
|
||||
# Fallback: check if claude CLI reports plan
|
||||
local plan
|
||||
plan=$(claude config get planType 2>/dev/null || true)
|
||||
case "$plan" in
|
||||
max|Max|MAX) echo "max" ;;
|
||||
pro|Pro|PRO) echo "pro" ;;
|
||||
free|Free|FREE) echo "free" ;;
|
||||
*) echo "pro" ;; # default assumption
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user