Better Harness Tools, now working with any model from OpenRouter instead of Anthropic models only.
This is a fork of the project https://github.com/instructkr/claw-code/.
Project OpenRouter Claw Code aims to create a highly capable CLI agent harness. We have successfully updated this project to work with any model from OpenRouter, rather than being restricted to Anthropic models.
Currently, the repository contains two parallel tracks:
- The Functional Agent (Rust): A fully working, high-performance CLI application that executes tools, maintains context, and talks to OpenRouter.
- The Porting Workspace (Python): A clean-room Python rewrite currently in progress that captures the architectural patterns of the agent harness.
To actually run the AI agent, interact with your codebase, and use OpenRouter models, you will use the Rust implementation. You will need Rust installed on your system.
The agent authenticates using your OpenRouter API key. Export it in your terminal:
export OPENROUTER_API_KEY="sk-or-v1-..."
# Optional: If you are using a custom proxy endpoint
# export OPENROUTER_BASE_URL="https://your-custom-proxy.com/api"Navigate to the rust directory and run the application:
cd rust/
cargo run --releaseThis will drop you into the interactive claw REPL where you can type prompts or use slash commands (like /help or /status).
By default, the agent tries to use an Opus alias, but you can pass any OpenRouter model string or use built-in aliases (like gpt4o, deepseek, sonnet, haiku):
# Using a built-in alias:
cargo run --release -- --model google/gemini-3-flash-preview
# Using an exact OpenRouter model ID:
cargo run --release -- --model meta-llama/llama-3-70b-instructTo run a single command and exit without entering the REPL:
cargo run --release -- prompt "Analyze the files in this directory and summarize them"The main source tree (src/) contains the active Python porting workspace. The current Python workspace is not yet a complete one-to-one replacement for the Rust system, but it is the primary implementation surface for the rewrite.
.
├── rust/ # Functional, high-performance Rust CLI agent
├── src/ # Python porting workspace (WIP)
│ ├── __init__.py
│ ├── commands.py
│ ├── main.py
│ ├── models.py
│ ├── port_manifest.py
│ ├── query_engine.py
│ ├── task.py
│ └── tools.py
├── tests/ # Python verification
└── README.md
The new Python src/ tree currently provides:
port_manifest.py— summarizes the current Python workspace structuremodels.py— dataclasses for subsystems, modules, and backlog statecommands.py— Python-side command port metadatatools.py— Python-side tool port metadataquery_engine.py— renders a Python porting summary from the active workspacemain.py— a CLI entrypoint for manifest and summary output
If you want to explore the Python rewrite codebase, you can run the following commands from the root of the repository (requires Python 3):
# Render the Python porting summary:
python3 -m src.main summary
# Print the current Python workspace manifest:
python3 -m src.main manifest
# List the current Python modules:
python3 -m src.main subsystems --limit 16
# Inspect mirrored command/tool inventories:
python3 -m src.main commands --limit 10
python3 -m src.main tools --limit 10
# Run verification tests:
python3 -m unittest discover -s tests -v