The open-source, model-agnostic CLI coding agent.
Autonomous file editing, shell execution, and code analysisโpowered by any local or cloud LLM.
PolyClaw is a vendor-independent fork of Claude Code. While the original tool locks terminal agentics into a single proprietary ecosystem, PolyClaw provides a modular, model-agnostic layer that routes autonomous execution across local open-weights, proprietary cloud APIs, and custom enterprise inference endpoints.
| Feature | Claude Code | ๐ฆ PolyClaw |
|---|---|---|
| Primary Provider | Anthropic Claude | Any Provider (Ollama, DeepSeek, OpenAI, Gemini, Claude) |
| Offline / Local Mode | โ No | โ Yes (via Ollama / LM Studio) |
| Multi-Model Routing | โ Locked | โ Dynamic (per command, file, or project context) |
| License | Proprietary | โ MIT (100% Open Source) |
# Install via npm globally
npm install -g polyclaw-cli
# Or install via pnpm
pnpm add -g polyclaw-cli
# Clone the repository
git clone https://github.com/FolatheDuckofDuckingburg/PolyClaw.git
cd PolyClaw
# Install dependencies and build the TypeScript distribution
pnpm install
pnpm build
# Link the binary locally for development testing
npm link
PolyClaw looks for credentials and routing preferences via environment variables or a static system profile.
export PolyClaw_PROVIDER=ollama
export PolyClaw_MODEL=deepseek-r1:8b
export OLLAMA_HOST=http://localhost:11434
export PolyClaw_PROVIDER=deepseek
export PolyClaw_MODEL=deepseek-coder
export DEEPSEEK_API_KEY=your_key_here
# OpenAI
export PolyClaw_PROVIDER=openai
export PolyClaw_MODEL=gpt-4o
export OPENAI_API_KEY=your_key_here
# Google Gemini
export PolyClaw_PROVIDER=gemini
export PolyClaw_MODEL=gemini-1.5-pro
export GEMINI_API_KEY=your_key_here
# Anthropic Claude
export PolyClaw_PROVIDER=anthropic
export PolyClaw_MODEL=claude-3-5-sonnet-20241022
export ANTHROPIC_API_KEY=your_key_here
Avoid managing temporary terminal variables by persisting your settings directly:
{
"defaultProvider": "ollama",
"providers": {
"ollama": {
"baseUrl": "http://localhost:11434",
"defaultModel": "deepseek-r1:8b"
},
"deepseek": {
"apiKey": "env:DEEPSEEK_API_KEY",
"defaultModel": "deepseek-coder"
},
"openai": {
"apiKey": "env:OPENAI_API_KEY",
"defaultModel": "gpt-4o"
}
},
"settings": {
"autoApproveCommands": false,
"theme": "dark"
}
}
# Initialize an interactive REPL terminal session
PolyClaw
# Run a single autonomous execution pass (One-shot execution)
PolyClaw "Refactor src/utils.ts to handle async retries with exponential backoff"
# Dynamically override the configuration router on the fly
PolyClaw --provider deepseek --model deepseek-coder "Fix failing unit tests in tests/auth.test.ts"
Contributions are highly appreciated! If you want to add new LLM provider integrations, enhance the file-editing parsing logic, or optimize terminal streaming latency:
- Fork the repository.
- Create a clean feature branch (
git checkout -b feature/AmazingFeature). - Commit your refactored code changes (
git commit -m 'Add support for custom provider context window adjustments'). - Push to the remote branch (
git push origin feature/AmazingFeature). - Open a formal Pull Request against the
mainbranch.
PolyClaw is distributed under the MIT License. See the LICENSE file for full compliance details.