sa — Morph Code
A fork of Claude Code with multi-provider LLM support, WarpGrep semantic code search, and subagent orchestration. Runs from source with Bun.
Install
curl -fsSL subagents.com/install | bash
Or with npm:
npm install -g subagent-cli
Requires Bun runtime.
Usage
sa
sa -p "refactor the auth module"
sa -p "explain this codebase" --print
sa --model claude-sonnet-4-6
sa --model opus
sa agents
What's different from Claude Code
Multi-provider LLM — Uses pi-ai under the hood. Set PI_ENGINE=on to route through OpenAI, Google, Mistral, or any supported provider instead of Anthropic.
WarpGrep agent — Semantic code search powered by Morph. When MORPH_API_KEY is set, a warpgrep subagent becomes available that understands code structure, not just text patterns.
Explore & Plan agents — Always enabled. The Explore agent prefers WarpGrep over regex grep when available.
Subagent tools — WarpGrep and FastApply (smart code editing) are registered as first-class tools, available to all agents.
Agents
$ sa agents
9 active agents
Built-in agents:
Explore · haiku — Fast codebase exploration (uses WarpGrep when available)
Plan · inherit — Architecture and implementation planning
warpgrep · haiku — Semantic code search via Morph
general-purpose · inherit — Research, code search, multi-step tasks
claude-code-guide · haiku — Questions about features and usage
statusline-setup · sonnet — Configure status line
Environment variables
ANTHROPIC_API_KEY | Yes (or OAuth) | Anthropic API access |
MORPH_API_KEY | No | Enables WarpGrep, FastApply, and warpgrep agent |
OPENAI_API_KEY | No | For PI_ENGINE multi-provider mode |
GOOGLE_API_KEY | No | For PI_ENGINE multi-provider mode |
PI_ENGINE | No | Set to on to route LLM calls through pi-ai |
Development
cd packages/subagentscccli
bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx
npx vitest --run
bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx agents
bun run --preload ./stubs/globals.ts ./src/entrypoints/cli.tsx --version
Architecture
Built on the Claude Code v2.1.88 source with these modifications:
src/engine/ — Pi-mono integration layer (PiAgentAdapter, MessageMapper, ToolAdapter, ModelResolver, CostMapper, PermissionBridge, SubagentTools)
src/query/deps.ts — LLM call routing (Anthropic SDK default, pi-ai when PI_ENGINE=on)
src/tools/AgentTool/built-in/warpGrepAgent.ts — WarpGrep subagent definition
src/tools/WarpGrepTool/WarpGrepTool.ts — WarpGrep as a Claude Code Tool
src/tools/AgentTool/builtInAgents.ts — Explore/Plan always enabled, warpgrep registered
stubs/ — Runtime stubs for unavailable Anthropic-internal packages
bin/sa.js — Bun launcher entry point
License
Claude Code source is property of Anthropic. This fork is for internal use.