Macula Mesh Use Build Macula for… Docs Contact

Macula · Martha · docs from Martha v0.4.1

claw-code: what it is, where it comes from, what Martha can learn

This report exists so that Martha borrows only ideas it is free to use, and knows which of claw-code's choices to leave alone.

It answers issue #4. The method was read-only. We cloned the repository and read it as untrusted text. Nothing from it was built, installed or run, and no code from it is in Martha.

Short answer. claw-code began as a port of an exposed copy of a vendor's proprietary source code, and its own history says so. Copying any of its code, prompt text or tool descriptions into Martha or lazymesh is not safe. The answer to the provenance question is ideas only, and only general ideas that we re-implement from our own design. Three of those ideas are worth having. They are ranked at the end.

What we read

Repository instructkr/claw-code, which GitHub now redirects to ultraworkers/claw-code
Commit read 51cfca114cf506a5d7a53ab1bffa8e1bbd3c780d (2 November 2026)
Size 1,861 commits since 31 March 2026, 428 tracked files, 12 Rust crates holding about 225,000 lines
Licence MIT, "Copyright (c) 2026 UltraWorkers and Claw Code contributors" (LICENSE:1-3)

Every path:line below refers to that commit.

1. What it is and how it works

A terminal coding agent, written in Rust. The claw binary is the product (README.md:101-102). A Python tree under src/ is described as a reference and audit workspace, not the runtime (README.md:116). The project calls itself "closer to a museum exhibit than a product pitch" and sends people who want to do real work to two other harnesses (README.md:59-65).

Runtime. The runtime crate (about 92,000 lines) holds the conversation loop, sessions, context compaction, the system prompt, config loading, permissions, the sandbox, hooks, an MCP client and an LSP client. api talks to Anthropic, OpenAI-compatible and local model providers. tools defines the built-in tools, and rusty-claude-cli is the command-line front end (about 48,000 lines in one main.rs).

Tools. The tools are the usual set: shell, file read, write and edit, grep, web fetch and search, todo lists, skills, sub-agents, tool search, teams and cron jobs (PARITY.md:42-52). The task, team and cron registries are in memory only (rust/crates/runtime/src/task_registry.rs:2, rust/crates/runtime/src/team_cron_registry.rs:2-5). They do not survive a restart.

Plugins. A plugin is a manifest with a name, version, declared permissions (read, write, execute), hooks, lifecycle commands, tools and commands (rust/crates/plugins/src/lib.rs:117-132). Hooks and lifecycle commands run as shell commands (rust/crates/plugins/src/hooks.rs:296-297, rust/crates/plugins/src/lib.rs:2160-2185).

Coordination loop. The coordination loop is mostly outside this repository. The project's philosophy says the code is a by-product, and that the thing worth studying is the system that produced it (PHILOSOPHY.md:5-7). That system has three parts: a workflow layer that turns short directives into plans, a notification router that keeps monitoring out of the agents' context, and a multi-agent coordinator where an architect, an executor and a reviewer settle their disagreements (PHILOSOPHY.md:27-57). A Discord channel is the human interface (PHILOSOPHY.md:17-25).

Inside this repository, the coordination loop shows up as data shapes:

Parity harness. A mock model service that behaves like Anthropic's (rust/crates/mock-anthropic-service/src/lib.rs:36) replays 12 scripted scenarios against the real CLI. The scenarios cover streaming, file round-trips, a multi-tool turn, bash, permission prompts that are approved or denied, a plugin tool, compaction and cost reporting (PARITY.md:11-27, rust/mock_parity_scenarios.json). No live model and no API key are needed. "Parity" here means behaving the same as the proprietary tool it was ported from (section 2).

2. Provenance

The repository's own history settles this.

What the repository says about this. It "does not claim ownership of the original Claude Code source material" and "is not affiliated with, endorsed by, or maintained by Anthropic" (README.md:301-304). It does not say that the code was written without access to the exposed source. The record above shows that the code was written with that access.

Conclusion for Martha and lazymesh. The MIT licence covers what its contributors could license. It cannot clear material derived from someone else's proprietary source. We cannot establish which parts of claw-code are clean, so we treat all of it as unsafe to copy. That covers code, prompt text, tool names and descriptions, command lists and the scenario files. Ideas only. We take only ideas that also exist independently of this source, and we write them from our own design, not by reading claw-code while we write.

3. Security read

What it can reach. By default a session asks before each shell command. Once the shell is allowed, it can do whatever the user can do, and a cloned repository can allow it without asking.

Credentials.

What it does well.

4. What to borrow, what to avoid

Borrow as ideas, ranked

  1. A declared "green level" on every hand-off. A builder states which verification level the work reached (targeted tests, package, whole repository, merge ready), and the hand-off is refused below the level the package requires. Martha already records every hand-off and verdict. Adding the required level to the package, and the reached level to the hand-off, turns "CI is green" into a checked fact. Known flaky tests stay listed separately, not silently ignored.
  2. A scripted fake model for testing the crew loop. Martha's adapters can be tested against a deterministic fake that replays scripted turns: a builder hands off, a reviewer fails it, and the builder fixes and hands off again. CI can then prove the loop with no live model, no API key and no cost. This is a standard testing technique. We write our own scenarios from Martha's own events.
  3. Readiness and misdelivery as explicit states. Treat "the session is ready for a prompt", "the session is waiting on a question" and "the message reached the wrong place" as recorded states of a crew member. Today they are inferred from silence. A conductor that knows a member never received its brief can resend it, instead of waiting.

Avoid

Martha's docs, from release v0.4.1: Getting started: a crew of two on your own project · @macula-io/martha · Martha · The agent control loop · claw-code: what it is, where it comes from, what Martha can learn · The host contract and the ledger · How a release is made · Nothing private gets in · The port map, in summary · The publish gate · The crew's declaration