[D] We reimplemented Claude Code entirely in Python — open source, works with local models

Reddit r/MachineLearning / 4/2/2026

📰 NewsDeveloper Stack & InfrastructureSignals & Early TrendsTools & Practical Usage

Key Points

  • The project “Claw Code Agent” was released as a complete, open-source Python reimplementation of the Claude Code agent architecture, aiming to make it readable and extensible for Python developers.
  • It provides an agentic coding loop with tool calling, including core file operations (read/write/edit), glob/grep utilities, shell execution, slash commands (e.g., /help, /context, /tools, /memory, /status, /model), and a CLAUDE.md-driven context discovery engine.
  • The agent supports session persistence (save/resume) and tiered permissions to control capabilities from read-only up through unsafe shell access.
  • It can run with local or self-hosted models via any OpenAI-compatible backend, with documented support for vLLM as well as common options like Ollama and LiteLLM Proxy.
  • The maintainers recommend a specific local model (Qwen3-Coder-30B-A3B-Instruct) and invite community issues/PRs to add missing features or fix breakages.

Hey everyone,

We just released Claw Code Agent — a full Python reimplementation of the Claude Code agent architecture, based on the reverse-engineering work shared in this tweet:

https://x.com/Fried_rice/status/2038894956459290963

Why?

The original Claude Code is npm/TypeScript/Rust. If you're a Python developer, good luck reading or extending it. We rebuilt the whole thing in pure Python so anyone can understand it, modify it, and

run it with local open-source models.

What it does:

  • Full agentic coding loop with tool calling
  • Core tools: file read/write/edit, glob, grep, shell
  • Slash commands: /help, /context, /tools, /memory, /status, /model
  • Context engine with CLAUDE.md discovery
  • Session persistence — save and resume agent runs
  • Tiered permissions: read-only → write → shell → unsafe

Works with any OpenAI-compatible backend:

  • vLLM (documented path)
  • Ollama
  • LiteLLM Proxy

Recommended model: Qwen3-Coder-30B-A3B-Instruct — runs fully local, fully free.

Repo: https://github.com/HarnessLab/claw-code-agent

We're actively working on this and happy to add features or take PRs. If something is missing or broken, open an issue — we want to make this useful for the community.

Would love to hear your feedback.

submitted by /u/Practical_Pomelo_636
[link] [comments]