/code-buddy:code-buddyfrom Code Buddy
Operates the `buddy` multi-provider AI coding-agent CLI: run headless prompts, force local Ollama models, start HTTP/fleet server, and run autonomous fleet loops.
Ships in Code Buddy. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
buddy)Code Buddy is an agentic coding CLI: given a prompt it reads files, calls tools, edits code, runs commands, and can act fully autonomously. This skill is about operating that CLI correctly — the non-obvious parts are provider/model selection and headless flags.
There is no single buddy binary guaranteed on PATH. Resolve in this order:
command -v buddy # global install (npm i -g @phuetz/code-buddy, or `npm link` in the repo)
./node_modules/.bin/tsx src/index.ts # dev, from the repo root (no build needed) ← default inside this repo
node dist/index.js # built (after `npm run build`)
Inside this repo buddy is usually NOT linked — use ./node_modules/.bin/tsx src/index.ts.
buddy -p "<prompt>" --output-format text # process one prompt and exit (alias: --print)
buddy -p "<prompt>" --output-format json # machine-readable result
Headless mode auto-approves operations. Exit code reflects success/failure. --output-format json is best when another program parses the result.
Provider auto-detection order (first wins): CODEBUDDY_PROVIDER env → an active ChatGPT login (~/.codebuddy/codex-auth.json) → OLLAMA_HOST → API keys. An active ChatGPT login overrides OLLAMA_HOST — so setting OLLAMA_HOST alone is NOT enough to use a local model.
To force a free local Ollama model, set CODEBUDDY_PROVIDER=ollama explicitly:
CODEBUDDY_PROVIDER=ollama OLLAMA_HOST=http://localhost:11434 GROK_MODEL=qwen3.6:35b-a3b-q4_K_M \
buddy -p "<prompt>" --permission-mode acceptEdits
GROK_MODEL (or --model <m>) sets the model; --base-url/GROK_BASE_URL sets the endpoint.qwen3+ — it emits structured tool calls. qwen2.5:7b is chat-only (it prints tool calls as text and can't edit). The helper scripts/buddy-local.sh bakes in these defaults.CODEBUDDY_PROVIDER; buddy login (ChatGPT, $0 marginal) or set GROK_API_KEY/OPENAI_API_KEY/ANTHROPIC_API_KEY/GEMINI_API_KEY. Check with buddy whoami.buddy can edit files and run shell commands. Control the blast radius:
--permission-mode <mode> — default | plan (read-only research) | acceptEdits (auto-apply edits) | dontAsk | bypassPermissions.--yolo — full autonomy (400 tool rounds, cost cap). Only with a contained workspace.--allowedTools "<glob,...>" / --disallowedTools "<glob,...>" — restrict the tool surface.cwd set to a throwaway/sandbox dir so the agent can't touch unintended files.# Ask without mutating anything (research/plan only)
buddy -p "Explain how the fleet bridge wires peers" --permission-mode plan
# Make a focused code change headless on a paid model, JSON result
buddy -p "Add input validation to parseConfig and a test" --permission-mode acceptEdits -o json
# Same, free + local (tool-capable model), via the helper
scripts/buddy-local.sh "Implement slugify in slugify.mjs so node slugify.check.mjs exits 0"
# Golden-path workflows (WritePolicy.strict / apply_patch)
buddy dev plan "<goal>" # writes PLAN.md, exit 1 if empty
buddy dev run -y --type fix-tests
buddy dev pr # title/body + gh or local origin push
buddy dev fix-ci --log ci.log # do not omit --log on a non-TTY
# Diagnose the environment
buddy doctor
buddy server --port 3000 # HTTP + WebSocket `/ws` on ONE port — required for the multi-AI fleet
buddy autonomy run --watch # continuous autonomous loop: claim + run colab tasks, free-first models
buddy autonomy install # install it as an always-on systemd/launchd service
buddy colab status # inspect the shared fleet task queue
buddy fleet status # fleet routing + presence
A complete, runnable example of driving the real agent autonomously over a task set lives in the repo at scripts/autonomy-lab/ (tsx scripts/autonomy-lab/run.ts).
For the full command surface (50+ subcommands), every relevant flag, and detailed local-model setup, read references/cli-reference.md. Load it only when a needed command/flag is not covered above.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub phuetz/code-buddy --plugin code-buddyOther plugins' skills for the same job