Claw Code Agent: Python Reimplementation of Claude Code Architecture for Local Models

Claw Code Agent is a complete Python reimplementation of the Claude Code agent architecture, built from reverse-engineering work shared in a tweet. The project addresses the original Claude Code's npm/TypeScript/Rust implementation, which can be challenging for Python developers to read or extend.
Core Features
The agent implements a full agentic coding loop with tool calling. Key components include:
- 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
Model Compatibility
The agent works with any OpenAI-compatible backend:
- vLLM (documented path)
- Ollama
- LiteLLM Proxy
The recommended model is Qwen3-Coder-30B-A3B-Instruct, which runs fully local and free.
Development Status
The project is actively maintained with the team working on adding features and accepting pull requests. Users are encouraged to open issues for missing features or bugs.
This implementation makes the Claude Code architecture accessible to Python developers who want to understand, modify, and run agentic coding systems with local models.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Developer builds terminal status bar to monitor Claude Code session limits after unexpected cutoff
A developer created a Python terminal statusline that shows Claude Code's session usage live after being cut off mid-refactor without warning. The tool uses existing sessions without requiring an API key.

SwiftUI Agent Skill: Enhancing View Development with AI
SwiftUI Agent Skill is an open-source tool that uses AI to improve SwiftUI view development by embedding best practices and optimizations.

7 slash commands, $0.45/post: This Claude Code pipeline runs a full SEO content operation
A developer open-sourced a 7-command Claude Code pipeline that handles SEO research, writing, optimization, and publishing. Costs $0.45/post (Perplexity API), runs in 15 min/day. Results: 18× monthly impressions in 12 months.

Introducing Xrouter: A Smart Hybrid LLM Router to Optimize Cost and Performance
Discover Xrouter, an open-source creation that dynamically integrates local with cloud inference, designed to slash AI costs while boosting efficiency.