claw-code
AGENTS.md195k starsChanged 7 months agoMITView on GitHub
Generated: 2026-08-16 Commit: b71afdd Branch: main (Refs = rg count across rust/crates; rust-analyzer references timed out during mapping.)
- Reads credentials
- Installs packages
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 63
NEVER cargo install claw-code — crates.io stub is deprecated and installs claw-code-deprecated.exe.
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PROJECT KNOWLEDGE BASE
Generated: 2026-08-16 Commit: b71afdd Branch: main
OVERVIEW
Claw Code: public Rust implementation of the claw CLI agent harness (Claude-Code-style). Canonical code lives in rust/; the repo is an agent-managed exhibit (harnesses plan/execute/verify per README), not a hand-operated product. src/ is a companion Python porting/parity workspace, not production code.
STRUCTURE
claw-code/
├── rust/ # canonical Cargo workspace: 11 crates, `claw` binary
├── src/ # Python porting workspace + reference_data/ parity snapshots
├── tests/ # Python unittest validation of src/ + scripts/ (stdlib unittest)
├── docs/ # g0XX gate verification maps + topic docs
├── scripts/ # fmt.sh, dogfood-build.sh, roadmap/board helpers
├── assets/ # README images only
└── install.sh, Containerfile, docker-compose.ymlWHERE TO LOOK
| Task | Location | Notes |
| CLI subcommands | rust/crates/rusty-claude-cli/src/main.rs | hand-rolled parser; CliAction enum ~L1162; dispatch in run() L995-1158 |
| Sessions/permissions/MCP | rust/crates/runtime/src/ | 47 flat modules |
| Provider clients | rust/crates/api/src/providers/ | anthropic.rs + openai_compat.rs |
| Tool definitions | rust/crates/tools/src/lib.rs | 55-tool spec table L484-1348 |
| Slash commands | rust/crates/commands/src/lib.rs | 120+ spec table L60-1047 |
| Plugins/hooks | rust/crates/plugins/src/ | manifest = .claude-plugin/plugin.json |
| Lean agent harness | rust/crates/claw-analog/src/lib.rs | lib+bin; tool loop over api+runtime |
| RAG HTTP service | rust/crates/claw-rag-service/src/ | axum; SQLite + optional Qdrant |
| Test mock server | rust/crates/mock-anthropic-service/ | SCENARIO_PREFIX scripted responses |
| Python porting CLI | src/main.py | argparse: manifest, parity-audit, graphs |
| Parity reference DB | src/reference_data/subsystems/ | 29 JSON snapshots of TS archive |
CODE MAP
| Symbol | Type | Location | Refs | Role |
| Session | struct | runtime/src/session.rs:117 | 229 | session persistence/lifecycle |
| ConfigLoader | struct | runtime/src/config.rs:409 | 83 | config schema/load |
| PluginManager | struct | plugins/src/lib.rs | 48 | plugin install/registry |
| PermissionEnforcer | struct | runtime/src/permission_enforcer.rs:27 | 35 | pre-dispatch permission gate |
| ConversationRuntime | struct | runtime/src/conversation.rs:130 | 32 | conversation loop driver |
| McpServerManager | struct | runtime/src/mcp_stdio.rs:488 | 30 | MCP JSON-RPC processes |
| HookRunner | struct | runtime/src/hooks.rs:155 | 25 | shell hook execution |
| CliAction | enum | rusty-claude-cli/src/main.rs:1162 | — | 25 subcommand variants |
| mvp_tool_specs | fn | tools/src/lib.rs:484 | — | static 55-tool table |
| SLASH_COMMAND_SPECS | const | commands/src/lib.rs:60 | — | 120+ slash commands |
(Refs = rg count across rust/crates; rust-analyzer references timed out during mapping.)
CONVENTIONS
unsafe_code = "forbid"workspace-wide; every crate opts in via[lints] workspace = true; clippy all=warn, pedantic=allow- Edition 2021, resolver 2, publish=false; no rust-toolchain pin (CI floats stable); no rustfmt.toml/clippy.toml — stock defaults
- Giant flat files by design (main.rs 19.8k, tools/lib.rs 10.9k, commands/lib.rs 7.2k): organization is positional — types → spec table → dispatch → handlers → tests at EOF
- Dual output paths everywhere:
render_x+render_x_json; JSON errors to stdout, text errors to stderr - Tests: inline
#[cfg(test)] mod testsprimary; integration tests spawnCARGO_BIN_EXE_clawsubprocess against mock-anthropic-service; tempfile everywhere; env-mutating tests serialize via env_lock/test_env_lock - Comments carry issue numbers (#824, #146); gate tests named by roadmap gate (g004_conformance.rs)
- Python side: stdlib only,
python -m unittest; src/ mixes camelCase (QueryEngine.py) and snake_case filenames
ANTI-PATTERNS (THIS PROJECT)
- NEVER
cargo install claw-code— crates.io stub is deprecated and installsclaw-code-deprecated.exe; build from source - Forbidden doc strings (CI-enforced by .github/scripts/check_doc_source_of_truth.py): old org links
github.com/Yeachan-Heo/claw-code,github.com/code-yeongyu/claw-code,discord.gg/6ztZB9jvWq,assets/clawd-hero.jpeg - Deprecated config keys:
permissionMode→permissions.defaultMode;enabledPlugins→plugins.enabled; envRUSTY_CLAUDE_PERMISSION_MODEis dead - Direct push to main is policy-blocked (
main_push_forbiddenapproval scope) - Automation lanes must not merge/close remote PRs/issues (docs/anti-slop-triage.md)
claw initmust not scaffolddontAskpermission mode (regression-pinned in output_format_contract.rs)- File-level
#![allow(dead_code)]blocks (main.rs, session_control.rs) are tolerated legacy — do not extend the pattern
UNIQUE STYLES
- Dogfood build: scripts/dogfood-build.sh injects GIT_SHA;
claw versionprovenance must equal HEAD - Mock parity: rust/mock_parity_scenarios.json drives CLI subprocess vs MockAnthropicService
- Dogfooding uses
CLAW_CONFIG_HOME=$(mktemp -d)for config isolation - Env contracts: GIT_SHA (build), CLAW_CONFIG_HOME (config dir), OLLAMA_HOST (provider override),
*_API_KEY/*_BASE_URLper provider
COMMANDS
scripts/fmt.sh --check # fmt check (apply: scripts/fmt.sh)
cd rust && cargo clippy --workspace --all-targets -- -D warnings
cd rust && cargo test --workspace
cd rust && cargo build -p rusty-claude-cli # binary: rust/target/debug/claw
python -m unittest discover -s tests # Python suite
python .github/scripts/check_doc_source_of_truth.py && scripts/roadmap-check-ids.sh # docs/roadmap CINOTES
clawbinary comes from craterusty-claude-cli(package/bin name mismatch)- rust-ci.yml triggers only on rust/, docs/, listed meta file changes (path filters)
- CI clippy job runs without
-D warnings— weaker than the documented gate; known pre-existing failures recorded in docs/g002/g003 maps claw acpis a status stub, not a real ACP server- rust/ has committed harness dotdirs (.clawd-agents/, .omc/, .sandbox-home/) — intentional
Trending
Quiet since July.about the whole repository
Who's talking about instructkr/claw-code
- @carnage4life.bsky.social“The Python fork of the leaked Claude Code source code is now one of the fastest growing projects in …”Bluesky · Apr 1, 2026 · 49 likes
- A Hacker News story“Someone just converted Claude Leark from TypeScript to 100% Python”Hacker News · Mar 31, 2026 · 27 points
- @jonkuperman.com“lol the person who took the Claude Code source code and put it on GitHub now has a logo and a sponsor me …”Bluesky · Mar 31, 2026 · 13 likes
- @parmijohn.bsky.social“It's in a repo github.com/instructkr/c...”Bluesky · Apr 1, 2026 · 7 likes
- @camilleroux.com“Anthropic a leaké accidentellement le source de Claude Code, les repos sont retirés en DMCA — mais ce …”Bluesky · Apr 1, 2026 · 6 likes
The biggest 5 of 57 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 57
Talked about on Bluesky, GitHub, the web and Hacker News (57 times).
On Bluesky · 23
- Apr 1, 2026The Python fork of the leaked Claude Code source code is now one of the fastest growing projects in GitHub's history. 111K stars and 98K… — @carnage4life.bsky.social49 likes and reposts · 8 replies
- Mar 31, 2026lol the person who took the Claude Code source code and put it on GitHub now has a logo and a sponsor me badge on the repo… — @jonkuperman.com13 likes and reposts · 3 replies
- Apr 1, 2026It's in a repo github.com/instructkr/c... — @parmijohn.bsky.social7 likes and reposts · 1 reply
- Apr 1, 2026Anthropic a leaké accidentellement le source de Claude Code, les repos sont retirés en DMCA — mais ce portage Python du code évite à priori… — @camilleroux.com6 likes and reposts · 1 reply
- Apr 1, 2026"Fastest repo to reach 50k stars on GH" github.com/instructkr/c... — @eddelbuettel.com5 likes and reposts
18 more on Bluesky
- Apr 1, 2026Omg... From "ABI Bouhmaida/@forgoodcode": Anthropic accidentally pushed all their source code for Claude A Korean developer named Sigrid… — @parmijohn.bsky.social4 likes and reposts
- Apr 1, 2026Claude Code's code accidentally leaked? And people were worried that copyright law could be used to take down copies?? So they used another… — @peterkwells.com4 likes and reposts · 1 reply
- Apr 1, 2026LMAO Anthropic slipped up and leaked the source code for Claude this morning and someone ported it to Python? Is this real?… — @justinskolnick.com4 likes and reposts · 2 replies
- Apr 1, 2026github.com/instructkr/c... Rien compris de l'explication, y'a eu un leak de Claude, mais le dev semble dire qu'il a réécrit le code python,… — @lea-linux.org3 likes and reposts · 1 reply
- Mar 31, 2026Anthropic accidentally leaked ~512,000 lines of proprietary TypeScript source code for its Claude Code CLI tool. The leaked code is now… — @yuriquintana.com3 likes and reposts · 1 reply
- Apr 1, 2026Lmfao it's at 100k stars Everyone has their own Claude now Do the Bsky devs know??? lmfao github.com/instructkr/c... — @parmijohn.bsky.social2 likes and reposts
- Apr 1, 2026Best part: Sigrid Jin, who the WSJ says burned through 25 billion Claude Code tokens last year, rewrote the core architecture from scratch… — @tommytang.bsky.social2 likes and reposts · 1 reply
- Apr 1, 2026Claw Codeとは何か?という話。内部的な仕組みがかなりおもしろい。 note.com/yasu863/n/n3... 経緯は以下: - 3/31にClaude Codeのソースコードが流出 - それを分析してPythonで再実装したものがClaw Code -… — @desesseintes.bsky.social2 likes and reposts · 1 reply
- Mar 31, 2026#🔖テクノロジー GitHub - instructkr/claw-code: Better Harness Tools, not merely storing the archive of leaked Claude Code but also make real… — @hatena-bookmark.bsky.social2 likes and reposts
- Mar 31, 2026github.com/instructkr/c... 56K forks as of this moment and 49.6 k stars. One of if not the fastest github ascension? — @asskickerleague.bsky.social2 likes and reposts
- Mar 31, 2026> Anthropic leaked Claude Code source code > someone forked it > 32.6k stars, 44.3k forks > got scared of getting sued > convert the whole… — @biswajitg.bsky.social2 likes and reposts
- Apr 1, 2026Update: My assumptions were wrong. The leaked Typescript code was running on the backend and was very much the secret sauce behind Claude.… — @mvindahl.com1 likes and repost · 1 reply
- Apr 1, 2026Ed, Anthropic actually decided to double down on their leaking yesterday; github.com/instructkr/c... — @shortstack122.bsky.social1 likes and repost · 1 reply
- Apr 1, 2026In case you haven’t seen this yet github.com/instructkr/c... — @jacobcaulfield.bsky.social1 likes and repost
- Apr 1, 2026GitHub - instructkr/claw-code: The fastest repo in history to surpass 50K stars ⭐, reaching the milestone in just 2 hours after… — @tech-trending.bsky.social1 likes and repost
- Apr 1, 2026Claw-code - Claude leaked it's own source code. Rewritten in Python and now being rewritten in Rust. github.com/instructkr/c... — @dj-ir0ngruve.bsky.social1 likes and repost · 1 reply
- Mar 31, 2026github.com/instructkr/c... — @mrpunyapal.dev1 likes and repost
- Mar 31, 2026We must expropriate the expropriators (Clone the leaked Claude code repo) github.com/instructkr/c... — @yusufimaadkhan.com1 likes and repost
On GitHub · 18
- Apr 3, 2026[Feature]: Claw-code Style Architecture - Shell Hooks + Summarization Compaction — openclaw/openclaw1 reaction · 1 comment
- Apr 1, 2026Incorporate good idea/code from https://github.com/instructkr/claw-code — QwenLM/qwen-code1 reaction · 4 comments
- Jul 29, 2026[Analysis] claw-code (Claude Code Python Rewrite) 아키텍처 분석 및 soma-work 적용 가능 피처 도출 — 2lab-ai/soma-work0 reactions
- Apr 1, 2026claude code leak分析 — wsxk/wsxk.github.io0 reactions
- Apr 1, 2026[FEATURE]: ToolSearch for lazy/deferred tool discovery to reduce per-turn context size — anomalyco/opencode0 reactions · 2 comments
13 more on GitHub
- Apr 1, 2026[FEATURE]: REPL tool for isolated language-specific code execution separate from bash — anomalyco/opencode0 reactions · 1 comment
- Apr 1, 2026[FEATURE]: NotebookEdit tool for Jupyter notebook cell-level editing — anomalyco/opencode0 reactions · 2 comments
- Apr 1, 2026[FEATURE]: Sleep tool for agents to wait without holding a shell process — anomalyco/opencode0 reactions · 1 comment
- Apr 1, 2026[FEATURE]: StructuredOutput tool for reliable typed data extraction from sub-agents — anomalyco/opencode0 reactions · 1 comment
- Apr 1, 2026[FEATURE]: TodoWrite parallel workflow support + verificationNudgeNeeded signal — anomalyco/opencode0 reactions · 1 comment
- Apr 1, 2026[FEATURE]: Sub-agent tool-set isolation by role (Explore / Plan / Verification scopes) — anomalyco/opencode0 reactions · 3 comments
- Apr 1, 2026[FEATURE]: SendUserMessage / Brief tool for proactive async notifications from sub-agents — anomalyco/opencode0 reactions · 2 comments
- Apr 1, 2026[FEATURE]: AI-callable Config tool for runtime self-configuration by agents — anomalyco/opencode0 reactions · 1 comment
- Apr 1, 2026claw-code的区别 — sanbuphy/learn-coding-agent0 reactions · 3 comments
- Apr 1, 2026Solving Bottlenecks — code259/genesis0 reactions
- Mar 31, 2026Add Claw Code report and update related tools — aegisfleet/tool-survey-report0 reactions · 5 comments
- Mar 31, 2026feat(dev): capability manifest + route-debug CLI (research notes: instructkr/claw-code) — 8gi-foundation/8gent-code0 reactions · 4 comments
- Mar 27, 2026apr may 2026 — kimtth/azure-openai-llm-notes0 reactions
On the web · 13
- Apr 20, 2026How to Use Claw Code ?. Claw Code installation guide for… — medium.com
- Apr 11, 2026Claw Code 是不是 AI 模型?它到底该怎么装和用? - CSDN文库 — wenku.csdn.net
- Apr 6, 2026What Is Claw Code? Open-Source Claude Code Alternative — andrew.ooo — andrew.ooo
- Apr 5, 2026Claw Code Review: Open-Source Claude Code Alternative — andrew.ooo — andrew.ooo
- Apr 2, 2026Claude Code Architecture Explained: Agent Loop, Tool System, and Permission Model (Rust Rewrite Analysis) — dev.to
8 more on the web
- Apr 2, 2026我把 ClaudeCode 源码全部理了一遍,整理成了这篇文章。昨天 Claude Code 源码泄露的事大家应该都已经 - 掘金 — juejin.cn
- Apr 2, 2026Breaking Down Claw Code: The Fastest Repo to 50K Stars — and What Its Architecture Reveals About AI Agent Harnesses | by Khánh Phạm Đức — medium.com
- Apr 2, 2026claw-code vs Claude Code: What's Actually Different? | WaveSpeed Blog — wavespeed.ai
- Apr 2, 2026Claw Code 설치 및 사용법 완벽 가이드 (2026) | 바이브코딩 스쿨 (VIBE CODING School) — vibecodingschools.com
- Apr 1, 2026claw-code:Rust 高效 harness 工具-CSDN博客 — blog.csdn.net
- Apr 1, 2026Claw Code: Open-Source Claude Code Clone With 105K Stars in 24 Hours — dev.to
- Apr 1, 2026ClaudeCode 源码泄露,事情没那么简单Claude Code 源码被间接扒出并开源,迅速在技术圈引发热议。随着仓 - 掘金 — juejin.cn
- Apr 1, 2026The Claude Code Source Leak and GitHub Repository Mirror | by Plaban Nayak | The AI Forum — medium.com
On Hacker News · 3
- Mar 31, 2026Someone just converted Claude Leark from TypeScript to 100% Pythonsays it tested it27 points · 7 comments
- Apr 1, 2026Rewriting Project Claw Code4 points
- Apr 1, 2026Claw-Code Rust Implementation4 points
Other versions3 projects use a version of this.
Word for word · 3
- ultraworkers/claw-code★ 195k100% same
- instructkr/claude-code★ 195k100% same
- instructkr/clawd-code★ 195k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository4 other files it gives its agents.
- rust/AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rust/CLAUDE.mdCLAUDE.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

