We reimplemented Claude Code entirely in Python — open source, works with local models
Open-source Python clone of Claude's coding agent runs fully local with models like Qwen3-Coder-30B.
HarnessLab has open-sourced Claw Code Agent, a complete Python-based reimplementation of Anthropic's proprietary Claude Code agent. The project was built by reverse-engineering the original architecture, which was written in npm/TypeScript/Rust and difficult for Python developers to extend. The new implementation provides the same core functionality—a full agentic coding loop with tool calling for file operations, glob, grep, and shell access—but in a transparent, modifiable Python codebase.
Claw Code Agent includes practical features like slash commands (/help, /context, /tools), session persistence for saving and resuming agent runs, and a tiered permission system from read-only to unsafe shell access. Crucially, it's designed to work with any OpenAI-compatible API, with documented paths for local backends like vLLM and Ollama. The developers specifically recommend the Qwen3-Coder-30B-A3B-Instruct model for fully local, cost-free operation.
The release addresses a significant gap in the AI coding assistant landscape: while proprietary agents like Claude Code are powerful, they're opaque and locked to specific providers. By providing an open-source alternative in Python—the dominant language in AI development—HarnessLab enables developers to understand, customize, and deploy sophisticated coding agents without relying on closed APIs. The project is actively maintained, with the team soliciting feature requests and pull requests to build a community-driven tool.
- Pure Python reimplementation of Claude Code's agent architecture, reverse-engineered from the original npm/TypeScript/Rust codebase
- Works with any OpenAI-compatible backend, enabling fully local operation with models like Qwen3-Coder-30B via vLLM or Ollama
- Includes full agentic loop with file editing, shell access, slash commands, session persistence, and a tiered permission system
Why It Matters
Democratizes advanced AI coding assistance by providing an open-source, inspectable alternative to proprietary agents, enabling customization and local deployment.