Model or dataset
GPT-AGI/Clawd-Code avatar
GPT-AGI/Clawd-Code

Clawd-Code: a Python rebuild of the Claude Code CLI, and what the port actually ships

Claude-Code-Python: Reconstructing Claude Code in Python

620 stars300 forksPythonMIT

At a glance

What is it?
Clawd-Code (package name clawd-codex) is an MIT-licensed Python reimplementation of the Claude Code terminal agent, ported from the TypeScript architecture. The agent loop, skill runtime and multi-provider config are in place; context building and the permission system are still marked as in progress.
Who is it for?
Adopt Clawd-Code if you want to read and modify a Claude Code style agent in Python, or if you need to point the same REPL at Anthropic, OpenAI and GLM through one config file. Do not adopt it if you need a permission model you can trust before running Bash, or if you expect the context builder to understand a large repository.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 161 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What Clawd-Code is, and who the port is for

Clawd-Code is a Python reimplementation of the Claude Code CLI. The README describes it as a "production-oriented Python rebuild of Claude Code", ported from the original TypeScript architecture and shipped as a working CLI agent rather than a source dump. The distribution name in pyproject.toml is clawd-codex, version 0.1.0, classified as Development Status 3 - Alpha, with requires-python >=3.10.

The audience is narrower than the README's framing suggests. This is not a drop-in replacement for Claude Code in the sense that you install it and forget the original. It is for engineers who want the agent loop, the tool dispatch and the slash-command runtime to be readable Python they can change. The README states that goal directly: "Built to Hack On", with a readable codebase, tests, and markdown-driven skill extensibility. If your interest is a polished terminal assistant, the port adds a layer of unfinished work between you and the model. If your interest is how a tool-calling coding agent is assembled, that same layer is the point.

The repository carries the usual project files: src/, tests/, docs/, a CHANGELOG.md, CONTRIBUTING.md, FEATURE_LIST.md and a CLAUDE_example.md. The README also links translated versions under docs/i18n/ for French, Russian, Hindi, Arabic and Portuguese.

The agent loop, the tool registry and the SKILL.md runtime

The mechanism visible in the README is a streaming, tool-aware agent loop. A reply can stream directly from the provider, and during a tool-driven loop the terminal shows tool activity as it happens. The README's example shows a Read call on tests/test_agent_loop.py with a line range beneath it, followed by /render-last to re-render the last answer as Markdown. Two REPL commands control this: /stream toggles live output, /render-last re-renders.

Tools are grouped in the README's status table into categories rather than listed individually: file operations (Read, Write, Edit, Glob, Grep), system (Bash), web (WebFetch, WebSearch), interaction (AskUserQuestion, SendMessage), task management (TodoWrite, TaskManager, TaskStop), agent tools (Agent, Brief, Team), configuration (Config, PlanMode, Cron), MCP tools and resources, and others including LSP, Worktree, Skill and ToolSearch. The README claims 30+ tools implemented. Treat that number as a claim from the project's own status table, not as something verified here.

Skills are the extension point worth understanding. A skill is a SKILL.md file with YAML-style front matter: description, allowed-tools and arguments. The README's example declares arguments: [path] and allowed-tools limited to Read, Grep and Glob, then interpolates $path into the prompt body. Skills can live at project level or user level, and the allowed-tools list constrains which tools that skill may call. That constraint is the most interesting design decision in the port, because it moves part of the safety story out of a global permission prompt and into per-skill declarations.

Session persistence is local: /save writes a session, and the README lists save/load as complete.

Installing Clawd-Code and running a first skill

The README's quick start is a git clone plus a virtual environment. It recommends uv and Python 3.11. The commands below are copied from the README.

bash
# Create venv (uv recommended)
uv venv --python 3.11
source .venv/bin/activate

# Install
uv pip install -r requirements.txt

After activation and install, the README's configuration path is the interactive login flow. It asks you to choose a provider (anthropic, openai or glm), takes that provider's API key, optionally saves a custom base URL and a default model, and sets the provider as default.

bash
python -m src.cli login

The README states the configuration file is written to ~/.clawd/config.json, with a default_provider key and a providers object keyed by provider name. The README's example shows glm as the default and an anthropic entry with an api key field; the excerpt is truncated mid-object, so check the file after login rather than assuming the full shape.

Start the REPL with the clawd entry point. The README lists clawd for the REPL, clawd login for configuration, clawd config to view settings and clawd --version to check the version.

bash
clawd              # Start REPL
clawd login        # Configure API
clawd --version    # Check version
clawd config       # View settings

Inside the REPL, the README lists /help, a bare / to show all commands and skills, /save, /multiline for multi-paragraph input, and Tab for auto-completion. To try a skill, the README's example is /explain-code qsort.py. What you should see is the assistant streaming a response while tool calls appear as lines in the terminal; if streaming looks unstable, /stream toggles it and /render-last cleans up the final Markdown.

Context building and the permission system are the soft spots

The README's own status table is the most useful document in the repository, because it distinguishes finished work from scaffolding. Two rows are marked with a yellow indicator rather than a check.

Context building is described as "Initial prompt injection for workspace, git, and CLAUDE.md; deeper project understanding still needed". That is a specific limitation: the agent gets an initial injection of workspace state, git state and a CLAUDE.md file, but the README does not claim repository-level comprehension beyond that. On a large codebase you should expect to supply paths and context yourself rather than assume the agent found them. The repository includes CLAUDE_example.md, which suggests the intended pattern is a hand-written project context file.

Permission System is described as "Framework exists, needs integration". Read that carefully before running anything that writes files or executes shell commands. A framework that exists but is not integrated means the enforcement point may not be on the path you expect. The README does not document a rollback mechanism for tool effects, and it does not document what happens when a permission check is absent. If you plan to let this agent run Bash, verify the wiring in src/ first.

The roadmap confirms the same picture: Phase 3 ("Context, permissions, recovery") is in progress, Phase 4 (MCP, plugins, extensibility) and Phase 5 (Python-native differentiators) are not started. The README's badge text claims active development and new features weekly; the last push to the repository was on 2026-04-08, so judge the release cadence from the commit history rather than the badge.

How Clawd-Code differs from the original Claude Code CLI

The obvious alternative is the original Claude Code CLI, and the difference is not mainly features. Claude Code is a TypeScript program distributed by Anthropic; Clawd-Code is a Python program you clone, install from requirements.txt and run through the clawd entry point. The practical consequence is what you can change. With the original you extend through its supported configuration and skill surfaces. With Clawd-Code you can open src/cli.py, read the loop, and rewrite the tool dispatch, which is the stated purpose of the port.

The second difference is provider reach. The README lists Anthropic Claude, OpenAI GPT and Zhipu GLM as supported providers, with a note that the list is easy to extend, and pyproject.toml carries anthropic, openai and zhipuai as dependencies. The original CLI is tied to Anthropic's models. If you want one REPL and one skill format across several providers, that is a real reason to pick the port even in its alpha state.

The third difference is maturity, and it cuts the other way. The project classifies itself as Alpha. Permission integration and deeper context understanding are open work. Choosing Clawd-Code over the original means accepting that the safety and context layers are thinner today in exchange for a codebase you control.

Licence, dependencies and what upgrades cost you

The licence is MIT, stated in both the README badge and pyproject.toml (license = {text = "MIT"}), and the repository contains a LICENSE file. MIT permits commercial use and modification with the copyright notice retained. This is a description of the licence text, not legal advice; if you redistribute a modified version, have your own counsel review the notice requirements.

The dependency surface is small and mainstream: anthropic, openai, zhipuai, python-dotenv, rich, prompt-toolkit and tiktoken>=0.7.0, with build, twine and pytest as optional dev extras. The README's requirements.txt pins floors rather than exact versions (anthropic>=0.18.0, openai>=1.0.0, and so on), so a fresh install will resolve to current releases. Those three provider SDKs change frequently; an unpinned floor is the most likely source of breakage in a future install.

Upgrade cost is dominated by the clone-based install. The README's flow is git clone plus uv pip install -r requirements.txt, and pyproject.toml declares a clawd console script pointing at src.cli:main, so both an editable install and a plain requirements install are plausible from the repository layout. The README does not document a migration path for the ~/.clawd/config.json format between versions, and no releases were retrieved, so there is no changelog-based upgrade guide to follow. If you fork it, you own the merge.

Editorial conclusion

Adopt Clawd-Code if you want to read and modify a Claude Code style agent in Python, or if you need to point the same REPL at Anthropic, OpenAI and GLM through one config file. Do not adopt it if you need a permission model you can trust before running Bash, or if you expect the context builder to understand a large repository. Before installing, open FEATURE_LIST.md and check the Phase 3 entries, then read src/ to confirm the permission framework is wired into the tool path; the README marks that integration as unfinished.

Frequently asked questions

How do I install Clawd-Code?

Clone the repository, create a virtual environment (the README recommends uv venv --python 3.11), activate it, and run uv pip install -r requirements.txt. Then configure a provider with python -m src.cli login and start the REPL with clawd.

Which model providers does Clawd-Code support?

The README lists Anthropic Claude, OpenAI GPT and Zhipu GLM, and notes the list is easy to extend. The interactive login flow asks you to choose anthropic, openai or glm, and pyproject.toml carries the matching SDKs as dependencies.

Where does Clawd-Code store its configuration?

The README states the configuration file is saved in ~/.clawd/config.json, with a default_provider key and a providers object keyed by provider name. The login flow writes it after you supply a provider, an API key, and optionally a base URL and default model.

Is Clawd-Code the same as Claude Code?

No. It is a Python reimplementation of the Claude Code CLI, ported from the TypeScript architecture, and it ships as the clawd-codex package with a clawd console entry point. The README frames it as keeping the original architecture while adapting it to Python.

Official sources

  1. GPT-AGI/Clawd-Code on GitHub
  2. Issues
  3. License: MIT
  4. README
Community notes

Community notes