Skip to content

Commit 49eaae8

Browse files
fidgetcodingruvnet
andcommitted
[bot:cli-maxxing] Claude-first: upfront sub gate + retry-hardened install (2026-04-17)
Nathan's ask: users should be warned about the paid claude.ai requirement BEFORE the 20-min install downloads anything, and the Claude Code install itself must not fail silently — it's the one tool everything else depends on. install.sh: - Subscription gate banner immediately after opening title, before Step 1 runs. Prompts "Press Enter to continue" if stdin is a tty; gracefully continues with a warning in non-interactive mode. Directs to https://claude.ai/ with Pro/Max guidance. - Hard gate after Step 1 + reload_path: runs `claude --version` and exits 1 with a clear troubleshooting banner if it doesn't work. Stops the pipeline instead of configuring downstream steps against a missing binary. step-1-install.sh / install_claude_code: - Retry loop (3 attempts, 5s/10s backoff) around `npm install -g @anthropic-ai/claude-code`. - Each attempt rehydrates nvm so the shim dir is visible. - Hard verify via `claude --version` (execution, not just PATH presence) — surfaces broken installs instead of claiming success. - "already installed" branch also now verifies execution. README.md: - Prominent [!IMPORTANT] callout at the top of "Before You Start" warning about the paid subscription requirement and linking to claude.ai. Notes that the installer prompts upfront. Shellcheck clean at warning+. Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 7859805 commit 49eaae8

3 files changed

Lines changed: 92 additions & 7 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ Install `cli-maxxing` first. `creativity-maxxing` and `2ndbrain-maxxing` can be
4545

4646
[Back to top](#quick-nav)
4747

48+
> [!IMPORTANT]
49+
> **You need a paid [claude.ai](https://claude.ai) subscription before anything below is useful.**
50+
>
51+
> The Claude Code CLI installs for free — but USING Claude requires a paid plan. If you don't have one yet, [sign up first](https://claude.ai) (Claude Pro is the minimum tier at $20/mo; Max is recommended for heavy use). Otherwise the installer downloads ~500 MB of tooling that has nothing to talk to.
52+
>
53+
> The installer will prompt you upfront — press Enter if you're subscribed, Ctrl+C to bail and sign up first.
54+
4855
- Your computer needs to be from roughly **2020 or later** (macOS Big Sur+ or a recent Linux).
4956
- You need an **internet connection** since the scripts download everything live.
5057
- **Don't run it as root.** Just open your terminal normally and paste the command.

install.sh

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ set -uo pipefail
99
# Usage: bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/install.sh)
1010
# =============================================================================
1111

12+
RED='\033[0;31m'
1213
GREEN='\033[0;32m'
1314
YELLOW='\033[1;33m'
1415
BLUE='\033[0;34m'
@@ -53,13 +54,63 @@ echo -e "${BLUE} Running all steps in order, skipping what's already done${NC}"
5354
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
5455
echo ""
5556

57+
# Subscription gate — before any downloads. The CLI is free; Claude itself
58+
# requires a paid claude.ai plan. No plan = the whole install is wasted time,
59+
# so catch it upfront instead of after 20 min of brew + MCP downloads.
60+
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
61+
echo -e "${YELLOW} IMPORTANT — Claude subscription required${NC}"
62+
echo -e "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
63+
echo ""
64+
echo " This installer sets up Claude Code (the terminal CLI) for free,"
65+
echo " but USING Claude requires a paid claude.ai plan. No plan = the"
66+
echo " rest of this install is wasted time."
67+
echo ""
68+
echo -e " No plan yet? Sign up: ${GREEN}https://claude.ai/${NC}"
69+
echo " • Claude Pro is the minimum tier (\$20/mo)"
70+
echo " • Max plan recommended for heavy use"
71+
echo ""
72+
echo -e " Already subscribed? ${GREEN}Press Enter${NC} to continue."
73+
echo -e " Need to sign up first? ${GREEN}Press Ctrl+C${NC}, come back after."
74+
echo ""
75+
if [ -t 0 ]; then
76+
# shellcheck disable=SC2162
77+
read -p " Press Enter to continue... " _CLAUDE_SUB_CONFIRM || true
78+
else
79+
echo -e "${YELLOW} [non-interactive mode — continuing. Make sure you have a plan.]${NC}"
80+
fi
81+
echo ""
82+
5683
# Step 1
5784
echo -e "${YELLOW}>>> Step 1 — Get Claude Running${NC}"
5885
echo ""
5986
curl -fsSL "$BASE_URL/step-1/step-1-install.sh" | bash
6087
# BUG A fix: Step 1 installs brew+nvm; re-source them into this shell so the
6188
# remaining curl|bash steps (Ghostty/Arc/2/3/9/final) can actually find them.
6289
reload_path
90+
91+
# Hard gate: if claude didn't land, stop everything. Every downstream step
92+
# configures Claude integrations — pointless without claude actually working.
93+
if ! command -v claude &>/dev/null || ! claude --version &>/dev/null; then
94+
echo ""
95+
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
96+
echo -e "${RED} CRITICAL — Claude Code did not install${NC}"
97+
echo -e "${RED}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
98+
echo ""
99+
echo " Step 1 finished but 'claude --version' does not work. Without"
100+
echo " claude on PATH, the remaining steps can't configure anything"
101+
echo " useful — stopping here."
102+
echo ""
103+
echo " Most common causes + fixes:"
104+
echo " 1. Fresh terminal needed — close this window, open a new one,"
105+
echo " run 'claude --version'. If it works, re-run this installer."
106+
echo " 2. npm registry blocked — check internet; try again."
107+
echo " 3. Old Node.js — 'node -v' should report v18 or higher."
108+
echo ""
109+
echo " Fix one of the above, then re-run:"
110+
echo -e " ${GREEN}bash <(curl -fsSL https://raw.githubusercontent.com/lorecraft-io/cli-maxxing/main/install.sh)${NC}"
111+
echo ""
112+
exit 1
113+
fi
63114
echo ""
64115

65116
# Bonus — Ghostty Terminal (optional, won't reinstall if already present)

step-1/step-1-install.sh

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -296,15 +296,42 @@ install_node() {
296296
# where the passwd shell is bash but Terminal actually runs zsh.
297297
# -----------------------------------------------------------------------------
298298
install_claude_code() {
299-
if command -v claude &>/dev/null; then
300-
success "Claude Code already installed"
299+
if command -v claude &>/dev/null && claude --version &>/dev/null; then
300+
success "Claude Code already installed ($(claude --version 2>/dev/null))"
301301
else
302-
info "Installing Claude Code..."
303-
npm install -g @anthropic-ai/claude-code 2>/dev/null \
304-
|| sudo npm install -g @anthropic-ai/claude-code
302+
info "Installing Claude Code (the single most important tool — retrying up to 3x)..."
303+
local attempt=0
304+
local max_attempts=3
305+
local installed=0
306+
while [ $attempt -lt $max_attempts ]; do
307+
attempt=$((attempt + 1))
308+
if npm install -g @anthropic-ai/claude-code 2>/dev/null \
309+
|| sudo npm install -g @anthropic-ai/claude-code; then
310+
# Rehydrate nvm in case the shim dir just got populated.
311+
export NVM_DIR="$HOME/.nvm"
312+
# shellcheck source=/dev/null
313+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
314+
if command -v claude &>/dev/null && claude --version &>/dev/null; then
315+
installed=1
316+
break
317+
fi
318+
fi
319+
if [ $attempt -lt $max_attempts ]; then
320+
local backoff=$((attempt * 5))
321+
warn "Claude Code install attempt $attempt/$max_attempts failed — retrying in ${backoff}s..."
322+
sleep "$backoff"
323+
fi
324+
done
325+
326+
if [ $installed -ne 1 ]; then
327+
fail "Claude Code installation failed after $max_attempts attempts. Check internet + npm registry access (https://registry.npmjs.org/), then re-run this installer."
328+
fi
305329

306-
command -v claude &>/dev/null || fail "Claude Code installation failed"
307-
success "Claude Code installed"
330+
# Final hard verify: the binary must execute, not just exist on PATH.
331+
if ! claude --version &>/dev/null; then
332+
fail "Claude Code installed but 'claude --version' does not execute. Try opening a new terminal and running 'claude --version'; if that works, re-run the installer."
333+
fi
334+
success "Claude Code installed ($(claude --version 2>/dev/null))"
308335
fi
309336

310337
# Add Claude Code shortcuts to every RC file. Idempotent per-file — re-runs

0 commit comments

Comments
 (0)