diff --git a/CLAUDE.md b/CLAUDE.md index 25b158d..60fce09 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,9 +36,9 @@ Caveman makes AI coding agents respond in compressed caveman-style prose — cut | `skills/caveman-help/SKILL.md` | Quick-reference card. One-shot display, not a persistent mode. | | `caveman-compress/SKILL.md` | Compress sub-skill behavior. | | `skills/cavecrew/SKILL.md` | Cavecrew decision guide — when to delegate to caveman subagents vs vanilla. Edit only here. | -| `agents/cavecrew-investigator.md` | Read-only locator subagent. Output contract: `path:line — symbol — note`. | +| `agents/cavecrew-investigator.md` | Read-only locator subagent (haiku). Output contract: `path:line — symbol — note`. | | `agents/cavecrew-builder.md` | Surgical 1-2 file editor subagent. Refuses 3+ file scope. | -| `agents/cavecrew-reviewer.md` | Diff/file reviewer subagent. One-line findings with severity emoji. | +| `agents/cavecrew-reviewer.md` | Diff/file reviewer subagent (haiku). One-line findings with severity emoji. | ### Auto-generated / auto-synced — do not edit directly diff --git a/README.md b/README.md index 126abfe..895a58c 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ irm https://raw.githubusercontent.com/JuliusBrussee/caveman/main/install.ps1 | i Detects 30+ agents (Claude Code, Gemini CLI, Codex, Cursor, Windsurf, Cline, Copilot, Continue, Kilo, Roo, Augment, Aider Desk, Amp, Bob, Crush, Devin, Droid, ForgeCode, Goose, iFlow, JetBrains Junie, Kiro CLI, Mistral Vibe, OpenHands, opencode, Qwen Code, Qoder, Rovo Dev, Tabnine, Trae, Warp, Replit Agent, Antigravity, …). Runs each one's native install. Skips what you not have. Safe to re-run. -By default the installer wires Claude Code's hooks + statusline + stats badge on top of the plugin install. Pass `--minimal` to skip the hooks and just install the plugin/extension. Pass `--all` to also drop per-repo rule files into the current directory and register the [`caveman-shrink`](#caveman-shrink-mcp-middleware) MCP proxy. +By default the installer wires Claude Code's hooks + statusline + stats badge and registers the [`caveman-shrink`](#caveman-shrink-mcp-middleware) MCP proxy on top of the plugin install. Pass `--minimal` to skip the extras and just install the plugin/extension. Pass `--all` to also drop per-repo rule files into the current directory. | Flag | What | |---|---| @@ -150,7 +150,7 @@ By default the installer wires Claude Code's hooks + statusline + stats badge on | `--dry-run` | Preview, write nothing | | `--only ` | One target only (repeatable) | | `--with-hooks` | Claude Code: also wire standalone hooks + statusline + stats badge. **On by default.** | -| `--with-mcp-shrink` | Claude Code: register the [caveman-shrink](#caveman-shrink-mcp-middleware) MCP proxy. Opt-in until the package ships on npm. | +| `--with-mcp-shrink` | Claude Code: register the [caveman-shrink](#caveman-shrink-mcp-middleware) MCP proxy via `npx caveman-shrink`. **On by default.** | | `--with-init` | Drop always-on rule files into the current repo (Cursor / Windsurf / Cline / Copilot / AGENTS.md). Off by default; turned on by `--all`. | | `--list` | Print full agent matrix and exit | | `--force` | Re-run even if already installed | @@ -229,7 +229,7 @@ Level stick until you change it or session end. | `/caveman-help` | Quick-reference card. All modes, skills, commands. | | `/caveman-stats` | Real session token usage + estimated savings + USD. Lifetime aggregation via `--all`, time window via `--since 7d`, tweetable line via `--share`. Reads the Claude Code session JSONL directly, no model-side guessing. Claude Code only. | | `/caveman:compress ` | Rewrites a memory file (e.g. `CLAUDE.md`) into caveman-speak. Saves backup as `.original.md`. Cuts ~46% of *input* tokens every session start. Code/URLs/paths preserved byte-for-byte. | -| `cavecrew-investigator/builder/reviewer` | Caveman subagents for Claude Code. Subagent tool-output gets injected back into main context — these emit ~60% fewer tokens than vanilla `Explore` / reviewer agents, so main context lasts longer across long sessions. Investigator (read-only locator), builder (1-2 file surgical edit, refuses 3+), reviewer (one-line findings). | +| `cavecrew-investigator/builder/reviewer` | Caveman subagents for Claude Code. Subagent tool-output gets injected back into main context — these emit ~60% fewer tokens than vanilla `Explore` / reviewer agents, so main context lasts longer across long sessions. Investigator (read-only locator, haiku), builder (1-2 file surgical edit, refuses 3+), reviewer (one-line findings, haiku). | **Statusline savings badge** — on by default. After your first `/caveman-stats` run the statusline appends `[CAVEMAN] ⛏ 12.4k` (lifetime tokens saved) and updates every time `/caveman-stats` runs. Don't want it? Set `CAVEMAN_STATUSLINE_SAVINGS=0` to silence. @@ -261,7 +261,7 @@ Stdio proxy that wraps any MCP server, intercepts `tools/list` / `prompts/list` } ``` -V1 does not touch tool-call response bodies or request payloads. Register via `install.sh --with-mcp-shrink` once `npx caveman-shrink` resolves on npm. Full docs: [`mcp-servers/caveman-shrink/`](mcp-servers/caveman-shrink). +Published on npm as [`caveman-shrink`](https://www.npmjs.com/package/caveman-shrink). V1 does not touch tool-call response bodies or request payloads. Auto-registered by `install.sh` (use `--minimal` to skip). Full docs: [`mcp-servers/caveman-shrink/`](mcp-servers/caveman-shrink). ## Benchmarks diff --git a/agents/cavecrew-investigator.md b/agents/cavecrew-investigator.md index 01cb01d..6f350da 100644 --- a/agents/cavecrew-investigator.md +++ b/agents/cavecrew-investigator.md @@ -6,6 +6,7 @@ description: > caveman-compressed so the main thread eats ~60% fewer tokens than vanilla Explore. Refuses to suggest fixes. tools: Read, Grep, Glob, Bash +model: haiku --- Caveman-ultra. Drop articles/filler/hedging. Code/symbols/paths exact, backticked. Lead with answer. diff --git a/agents/cavecrew-reviewer.md b/agents/cavecrew-reviewer.md index 6bc5cae..a6a2c94 100644 --- a/agents/cavecrew-reviewer.md +++ b/agents/cavecrew-reviewer.md @@ -6,6 +6,7 @@ description: > Use for "review this PR", "review my diff", "audit this file". Skips formatting nits unless they change meaning. tools: Read, Grep, Bash +model: haiku --- Caveman-ultra. Findings only. No "looks good", no "I'd suggest", no preamble. diff --git a/install.ps1 b/install.ps1 index 07a94ea..ce57a9d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -10,10 +10,9 @@ # # Run `install.ps1 -Help` for the full reference (flags + agent matrix). # -# Defaults: -WithHooks ON when Claude Code is detected, -WithMcpShrink OFF -# (opt-in until the proxy ships on npm), -WithInit OFF. Use -Minimal to skip -# everything except the plugin/extension install. Use -All to also drop -# per-repo rule files into $PWD. +# Defaults: -WithHooks ON, -WithMcpShrink ON (when Claude Code is detected), +# -WithInit OFF. Use -Minimal to skip everything except the plugin/extension +# install. Use -All to also drop per-repo rule files into $PWD. [CmdletBinding()] param( @@ -61,9 +60,8 @@ FLAGS -WithHooks Claude Code: also wire SessionStart/UserPromptSubmit hooks + statusline + stats badge. ON by default. -NoHooks Opt out of the default-on hooks install. - -WithMcpShrink Claude Code: register caveman-shrink MCP proxy. OFF by default - until the package ships on npm. - -NoMcpShrink Reserved opt-out (currently a no-op since the default is OFF). + -WithMcpShrink Claude Code: register caveman-shrink MCP proxy. ON by default. + -NoMcpShrink Opt out of the default-on MCP shrink registration. -WithInit Drop per-repo rule files into `$PWD for Cursor / Windsurf / Cline / Copilot / AGENTS.md. OFF by default. -SkipSkills Don't run the npx-skills auto-detect fallback. @@ -97,13 +95,14 @@ if ($All) { $WithInit = $true $WithMcpShrink = $true } -# Default-auto: -WithHooks defaults ON (unless -Minimal or -NoHooks). -# -WithMcpShrink stays opt-in until 'caveman-shrink' ships on npm — auto-on -# would register an `npx -y caveman-shrink` config that 404s on first use. +# Default-auto: turn ON unless caller passed -Minimal or the explicit -No* +# opt-out switch. if (-not $WithHooks -and -not $NoHooks -and -not $Minimal) { $WithHooks = $true } -if ($NoMcpShrink) { $WithMcpShrink = $false } +if (-not $WithMcpShrink -and -not $NoMcpShrink -and -not $Minimal) { + $WithMcpShrink = $true +} if ($Minimal) { $WithHooks = $false $WithMcpShrink = $false @@ -345,9 +344,8 @@ if ($List) { Note " Detection probes per agent live in install.ps1 \$Providers." Note " Soft entries detect via config-dir presence only (no CLI on PATH)." Write-Host "" - Note " Defaults: -WithHooks ON, -WithMcpShrink OFF, -WithInit OFF." + Note " Defaults: -WithHooks ON, -WithMcpShrink ON, -WithInit OFF." Note " -All turns all three on, -Minimal turns all three off." - Note " -WithMcpShrink will resolve once 'caveman-shrink' is published to npm." exit 0 } @@ -426,22 +424,22 @@ function Install-Claude { } } - # -WithMcpShrink: register the proxy. Until 'caveman-shrink' ships on npm, - # registration would store a config that 404s the first time Claude tries - # to spawn it. Probe npm first and bail out cleanly if missing. + # -WithMcpShrink: register the proxy. Probe npm first so a transient + # registry outage downgrades to a clean manual-config skip instead of + # registering an `npx -y caveman-shrink` entry that 404s on every spawn. if ($WithMcpShrink) { Say " → wiring caveman-shrink MCP proxy (-WithMcpShrink)" - $packageOnNpm = $false if (Has-Cmd "npm") { + $packageOnNpm = $false try { $null = & npm view $McpShrinkPkg 2>$null; $packageOnNpm = ($LASTEXITCODE -eq 0) } catch {} - } - if (-not $packageOnNpm) { - Warn " 'npm view $McpShrinkPkg' returned no metadata — package not on npm yet." - Note " Skipping registration. Re-run with -WithMcpShrink once the package is published," - Note " or copy the snippet below into your MCP config and point it at a local clone." - Record-Skipped "caveman-shrink" "package not on npm yet" - Write-Host "" - return + if (-not $packageOnNpm) { + Warn " 'npm view $McpShrinkPkg' returned no metadata — registry unreachable or package missing." + Note " Skipping registration. Re-run -WithMcpShrink when the registry is reachable," + Note " or copy the snippet below into your MCP config and point it at a local clone." + Record-Skipped "caveman-shrink" "npm registry probe failed" + Write-Host "" + return + } } $hasMcpAdd = $false if (Has-Cmd "claude") { diff --git a/install.sh b/install.sh index 3d4f261..4419a19 100755 --- a/install.sh +++ b/install.sh @@ -21,17 +21,17 @@ INIT_SCRIPT_URL="$RAW_BASE/tools/caveman-init.js" MCP_SHRINK_PKG="caveman-shrink" # ── Flags + state (no associative arrays — bash 3.2 safe) ────────────────── -# WITH_HOOKS defaults to "auto" → ON unless --minimal is set. WITH_MCP_SHRINK -# stays opt-in until the caveman-shrink npm package is published; auto-on -# would register an `npx -y caveman-shrink` config that 404s on first use. -# WITH_INIT also opt-in because it writes per-repo rule files into $PWD — -# too surprising for a bare curl|bash. +# WITH_HOOKS / WITH_MCP_SHRINK default to "auto" → ON unless --minimal is set +# or the caller passed an explicit override. WITH_INIT stays opt-in because +# it writes per-repo rule files into $PWD — too surprising for bare curl|bash. +# We still probe `npm view caveman-shrink` before registration so a transient +# npm outage downgrades to a manual-snippet skip instead of a broken config. DRY=0 FORCE=0 SKIP_SKILLS=0 WITH_HOOKS=auto WITH_INIT=0 -WITH_MCP_SHRINK=0 +WITH_MCP_SHRINK=auto ALL=0 MINIMAL=0 LIST_ONLY=0 @@ -78,8 +78,7 @@ FLAGS Cursor/Windsurf/Cline/Copilot/AGENTS.md. Off by default. --with-mcp-shrink Claude Code: register the caveman-shrink MCP middleware proxy (or print the JSON snippet for manual setup). - Off by default until the proxy is published to npm — - opt in once `npx caveman-shrink` resolves. + On by default — pass --minimal to skip. --list Print the full provider matrix and exit. --no-color Disable ANSI color codes (auto-disabled on non-TTY). -h, --help Show this help and exit. @@ -192,7 +191,7 @@ if [ "$MINIMAL" = 1 ]; then WITH_INIT=0 fi [ "$WITH_HOOKS" = "auto" ] && WITH_HOOKS=1 -# WITH_MCP_SHRINK has no "auto" value — opt-in until the proxy is on npm. +[ "$WITH_MCP_SHRINK" = "auto" ] && WITH_MCP_SHRINK=1 # ── Color helpers ────────────────────────────────────────────────────────── if [ "$NO_COLOR" = 1 ]; then @@ -367,9 +366,8 @@ if [ "$LIST_ONLY" = 1 ]; then note " Detection probes per agent live in install.sh PROVIDER_DETECT." note " Soft entries detect via config-dir presence only (no CLI on PATH)." echo - note " Defaults: --with-hooks ON, --with-mcp-shrink OFF, --with-init OFF." + note " Defaults: --with-hooks ON, --with-mcp-shrink ON, --with-init OFF." note " --all turns all three on, --minimal turns all three off." - note " --with-mcp-shrink will resolve once 'caveman-shrink' is published to npm." exit 0 fi @@ -506,16 +504,17 @@ install_claude() { fi fi - # --with-mcp-shrink: register the proxy (or print the snippet). Until the - # npm package is published, warn the user that registration will register a - # config that 404s the first time Claude tries to spawn it. + # --with-mcp-shrink: register the proxy (or print the snippet). Probe the + # npm registry first so a transient registry outage degrades to a clean + # manual-config skip instead of registering an `npx -y caveman-shrink` + # entry that 404s every time Claude tries to spawn it. if [ "$WITH_MCP_SHRINK" = 1 ]; then say " → wiring caveman-shrink MCP proxy (--with-mcp-shrink)" - if ! npm view "$MCP_SHRINK_PKG" >/dev/null 2>&1; then - warn " 'npm view $MCP_SHRINK_PKG' returned no metadata — package not on npm yet." - note " Skipping registration. Re-run with --with-mcp-shrink once the package is published," + if has npm && ! npm view "$MCP_SHRINK_PKG" >/dev/null 2>&1; then + warn " 'npm view $MCP_SHRINK_PKG' returned no metadata — registry unreachable or package missing." + note " Skipping registration. Re-run --with-mcp-shrink when the registry is reachable," note " or copy the snippet below into your MCP config and point it at a local clone." - record_skipped "caveman-shrink" "package not on npm yet" + record_skipped "caveman-shrink" "npm registry probe failed" elif has claude && claude mcp --help >/dev/null 2>&1; then # Newer Claude Code CLIs expose `claude mcp add`. Wrap stdio: proxy # spawns the upstream as a child. Without an upstream the proxy is a diff --git a/plugins/caveman/agents/cavecrew-investigator.md b/plugins/caveman/agents/cavecrew-investigator.md index 01cb01d..6f350da 100644 --- a/plugins/caveman/agents/cavecrew-investigator.md +++ b/plugins/caveman/agents/cavecrew-investigator.md @@ -6,6 +6,7 @@ description: > caveman-compressed so the main thread eats ~60% fewer tokens than vanilla Explore. Refuses to suggest fixes. tools: Read, Grep, Glob, Bash +model: haiku --- Caveman-ultra. Drop articles/filler/hedging. Code/symbols/paths exact, backticked. Lead with answer. diff --git a/plugins/caveman/agents/cavecrew-reviewer.md b/plugins/caveman/agents/cavecrew-reviewer.md index 6bc5cae..a6a2c94 100644 --- a/plugins/caveman/agents/cavecrew-reviewer.md +++ b/plugins/caveman/agents/cavecrew-reviewer.md @@ -6,6 +6,7 @@ description: > Use for "review this PR", "review my diff", "audit this file". Skips formatting nits unless they change meaning. tools: Read, Grep, Bash +model: haiku --- Caveman-ultra. Findings only. No "looks good", no "I'd suggest", no preamble.