mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 15:44:49 +08:00
Compare commits
20 Commits
merge-pari
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3df5dece39 | ||
|
|
cd1ee43f33 | ||
|
|
1fb3759e7c | ||
|
|
6b73f7f410 | ||
|
|
f30251a9e1 | ||
|
|
b0b655d417 | ||
|
|
8e72aaee2e | ||
|
|
1ceb077e40 | ||
|
|
58903cef75 | ||
|
|
cad1ac32a0 | ||
|
|
1f52ce25fb | ||
|
|
9350e70bc5 | ||
|
|
25a19792aa | ||
|
|
89a869e261 | ||
|
|
460284e7df | ||
|
|
feddbdd598 | ||
|
|
c99ee2f65d | ||
|
|
78fd0216f4 | ||
|
|
aca03fc3f9 | ||
|
|
9a7aab5259 |
114
PHILOSOPHY.md
Normal file
114
PHILOSOPHY.md
Normal file
@@ -0,0 +1,114 @@
|
||||
# Claw Code Philosophy
|
||||
|
||||
## Stop Staring at the Files
|
||||
|
||||
If you only look at the generated files in this repository, you are looking at the wrong layer.
|
||||
|
||||
The Python rewrite was a byproduct. The Rust rewrite was also a byproduct. The real thing worth studying is the **system that produced them**: a clawhip-based coordination loop where humans give direction and autonomous claws execute the work.
|
||||
|
||||
Claw Code is not just a codebase. It is a public demonstration of what happens when:
|
||||
|
||||
- a human provides clear direction,
|
||||
- multiple coding agents coordinate in parallel,
|
||||
- notification routing is pushed out of the agent context window,
|
||||
- planning, execution, review, and retry loops are automated,
|
||||
- and the human does **not** sit in a terminal micromanaging every step.
|
||||
|
||||
## The Human Interface Is Discord
|
||||
|
||||
The important interface here is not tmux, Vim, SSH, or a terminal multiplexer.
|
||||
|
||||
The real human interface is a Discord channel.
|
||||
|
||||
A person can type a sentence from a phone, walk away, sleep, or do something else. The claws read the directive, break it into tasks, assign roles, write code, run tests, argue over failures, recover, and push when the work passes.
|
||||
|
||||
That is the philosophy: **humans set direction; claws perform the labor.**
|
||||
|
||||
## The Three-Part System
|
||||
|
||||
### 1. OmX (`oh-my-codex`)
|
||||
[oh-my-codex](https://github.com/Yeachan-Heo/oh-my-codex) provides the workflow layer.
|
||||
|
||||
It turns short directives into structured execution:
|
||||
- planning keywords
|
||||
- execution modes
|
||||
- persistent verification loops
|
||||
- parallel multi-agent workflows
|
||||
|
||||
This is the layer that converts a sentence into a repeatable work protocol.
|
||||
|
||||
### 2. clawhip
|
||||
[clawhip](https://github.com/Yeachan-Heo/clawhip) is the event and notification router.
|
||||
|
||||
It watches:
|
||||
- git commits
|
||||
- tmux sessions
|
||||
- GitHub issues and PRs
|
||||
- agent lifecycle events
|
||||
- channel delivery
|
||||
|
||||
Its job is to keep monitoring and delivery **outside** the coding agent's context window so the agents can stay focused on implementation instead of status formatting and notification routing.
|
||||
|
||||
### 3. OmO (`oh-my-openagent`)
|
||||
[oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent) handles multi-agent coordination.
|
||||
|
||||
This is where planning, handoffs, disagreement resolution, and verification loops happen across agents.
|
||||
|
||||
When Architect, Executor, and Reviewer disagree, OmO provides the structure for that loop to converge instead of collapse.
|
||||
|
||||
## The Real Bottleneck Changed
|
||||
|
||||
The bottleneck is no longer typing speed.
|
||||
|
||||
When agent systems can rebuild a codebase in hours, the scarce resource becomes:
|
||||
- architectural clarity
|
||||
- task decomposition
|
||||
- judgment
|
||||
- taste
|
||||
- conviction about what is worth building
|
||||
- knowing which parts can be parallelized and which parts must stay constrained
|
||||
|
||||
A fast agent team does not remove the need for thinking. It makes clear thinking even more valuable.
|
||||
|
||||
## What Claw Code Demonstrates
|
||||
|
||||
Claw Code demonstrates that a repository can be:
|
||||
|
||||
- **autonomously built in public**
|
||||
- coordinated by claws/lobsters rather than human pair-programming alone
|
||||
- operated through a chat interface
|
||||
- continuously improved by structured planning/execution/review loops
|
||||
- maintained as a showcase of the coordination layer, not just the output files
|
||||
|
||||
The code is evidence.
|
||||
The coordination system is the product lesson.
|
||||
|
||||
## What Still Matters
|
||||
|
||||
As coding intelligence gets cheaper and more available, the durable differentiators are not raw coding output.
|
||||
|
||||
What still matters:
|
||||
- product taste
|
||||
- direction
|
||||
- system design
|
||||
- human trust
|
||||
- operational stability
|
||||
- judgment about what to build next
|
||||
|
||||
In that world, the job of the human is not to out-type the machine.
|
||||
The job of the human is to decide what deserves to exist.
|
||||
|
||||
## Short Version
|
||||
|
||||
**Claw Code is a demo of autonomous software development.**
|
||||
|
||||
Humans provide direction.
|
||||
Claws coordinate, build, test, recover, and push.
|
||||
The repository is the artifact.
|
||||
The philosophy is the system behind it.
|
||||
|
||||
## Related explanation
|
||||
|
||||
For the longer public explanation behind this philosophy, see:
|
||||
|
||||
- https://x.com/realsigridjin/status/2039472968624185713
|
||||
54
README.md
54
README.md
@@ -5,11 +5,11 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://star-history.com/#instructkr/claw-code&Date">
|
||||
<a href="https://star-history.com/#ultraworkers/claw-code&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=instructkr/claw-code&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=instructkr/claw-code&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=instructkr/claw-code&type=Date" width="600" />
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=ultraworkers/claw-code&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=ultraworkers/claw-code&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=ultraworkers/claw-code&type=Date" width="600" />
|
||||
</picture>
|
||||
</a>
|
||||
</p>
|
||||
@@ -19,48 +19,42 @@
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<strong>Better Harness Tools, not merely storing the archive of leaked Claude Code</strong>
|
||||
<strong>Autonomously maintained by lobsters/claws — not by human hands</strong>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/sponsors/instructkr"><img src="https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink?logo=github&style=for-the-badge" alt="Sponsor on GitHub" /></a>
|
||||
<a href="https://github.com/Yeachan-Heo/clawhip">clawhip</a> ·
|
||||
<a href="https://github.com/code-yeongyu/oh-my-openagent">oh-my-openagent</a> ·
|
||||
<a href="https://github.com/Yeachan-Heo/oh-my-claudecode">oh-my-claudecode</a> ·
|
||||
<a href="https://github.com/Yeachan-Heo/oh-my-codex">oh-my-codex</a> ·
|
||||
<a href="https://discord.gg/6ztZB9jvWq">UltraWorkers Discord</a>
|
||||
</p>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> The active Rust workspace now lives in [`rust/`](./rust). Start with [`USAGE.md`](./USAGE.md) for build, auth, CLI, session, and parity-harness workflows, then use [`rust/README.md`](./rust/README.md) for crate-level details.
|
||||
|
||||
> If you find this work useful, consider [sponsoring @instructkr on GitHub](https://github.com/sponsors/instructkr) to support continued open-source harness engineering research.
|
||||
> Want the bigger idea behind this repo? Read [`PHILOSOPHY.md`](./PHILOSOPHY.md) and Sigrid Jin's public explanation: https://x.com/realsigridjin/status/2039472968624185713
|
||||
|
||||
> Shout-out to the UltraWorkers ecosystem powering this repo: [clawhip](https://github.com/Yeachan-Heo/clawhip), [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent), [oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode), [oh-my-codex](https://github.com/Yeachan-Heo/oh-my-codex), and the [UltraWorkers Discord](https://discord.gg/6ztZB9jvWq).
|
||||
|
||||
---
|
||||
|
||||
## Backstory
|
||||
|
||||
At 4 AM on March 31, 2026, I woke up to my phone blowing up with notifications. The Claude Code source had been exposed, and the entire dev community was in a frenzy. My girlfriend in Korea was genuinely worried I might face legal action from Anthropic just for having the code on my machine — so I did what any engineer would do under pressure: I sat down, ported the core features to Python from scratch, and pushed it before the sun came up.
|
||||
This repo is maintained by **lobsters/claws**, not by a conventional human-only dev team.
|
||||
|
||||
The whole thing was orchestrated end-to-end using [oh-my-codex (OmX)](https://github.com/Yeachan-Heo/oh-my-codex) by [@bellman_ych](https://x.com/bellman_ych) — a workflow layer built on top of OpenAI's Codex ([@OpenAIDevs](https://x.com/OpenAIDevs)). I used `$team` mode for parallel code review and `$ralph` mode for persistent execution loops with architect-level verification. The entire porting session — from reading the original harness structure to producing a working Python tree with tests — was driven through OmX orchestration.
|
||||
The people behind the system are [Bellman / Yeachan Heo](https://github.com/Yeachan-Heo) and friends like [Yeongyu](https://github.com/code-yeongyu), but the repo itself is being pushed forward by autonomous claw workflows: parallel coding sessions, event-driven orchestration, recovery loops, and machine-readable lane state.
|
||||
|
||||
The result is a clean-room Python rewrite that captures the architectural patterns of Claude Code's agent harness without copying any proprietary source. I'm now actively collaborating with [@bellman_ych](https://x.com/bellman_ych) — the creator of OmX himself — to push this further. The basic Python foundation is already in place and functional, but we're just getting started. **Stay tuned — a much more capable version is on the way.**
|
||||
In practice, that means this project is not just *about* coding agents — it is being **actively built by them**. Features, tests, telemetry, docs, and workflow hardening are landed through claw-driven loops using [clawhip](https://github.com/Yeachan-Heo/clawhip), [oh-my-openagent](https://github.com/code-yeongyu/oh-my-openagent), [oh-my-claudecode](https://github.com/Yeachan-Heo/oh-my-claudecode), and [oh-my-codex](https://github.com/Yeachan-Heo/oh-my-codex).
|
||||
|
||||
https://github.com/instructkr/claw-code
|
||||
This repository exists to prove that an open coding harness can be built **autonomously, in public, and at high velocity** — with humans setting direction and claws doing the grinding.
|
||||
|
||||
See the public build story here:
|
||||
|
||||
https://x.com/realsigridjin/status/2039472968624185713
|
||||
|
||||

|
||||
|
||||
## The Creators Featured in Wall Street Journal For Avid Claude Code Fans
|
||||
|
||||
I've been deeply interested in **harness engineering** — studying how agent systems wire tools, orchestrate tasks, and manage runtime context. This isn't a sudden thing. The Wall Street Journal featured my work earlier this month, documenting how I've been one of the most active power users exploring these systems:
|
||||
|
||||
> AI startup worker Sigrid Jin, who attended the Seoul dinner, single-handedly used 25 billion of Claude Code tokens last year. At the time, usage limits were looser, allowing early enthusiasts to reach tens of billions of tokens at a very low cost.
|
||||
>
|
||||
> Despite his countless hours with Claude Code, Jin isn't faithful to any one AI lab. The tools available have different strengths and weaknesses, he said. Codex is better at reasoning, while Claude Code generates cleaner, more shareable code.
|
||||
>
|
||||
> Jin flew to San Francisco in February for Claude Code's first birthday party, where attendees waited in line to compare notes with Cherny. The crowd included a practicing cardiologist from Belgium who had built an app to help patients navigate care, and a California lawyer who made a tool for automating building permit approvals using Claude Code.
|
||||
>
|
||||
> "It was basically like a sharing party," Jin said. "There were lawyers, there were doctors, there were dentists. They did not have software engineering backgrounds."
|
||||
>
|
||||
> — *The Wall Street Journal*, March 21, 2026, [*"The Trillion Dollar Race to Automate Our Entire Lives"*](https://lnkd.in/gs9td3qd)
|
||||
|
||||

|
||||
|
||||
---
|
||||
|
||||
## Porting Status
|
||||
@@ -174,12 +168,12 @@ The restructuring and documentation work on this repository was AI-assisted and
|
||||
## Community
|
||||
|
||||
<p align="center">
|
||||
<a href="https://instruct.kr/"><img src="assets/instructkr.png" alt="instructkr" width="400" /></a>
|
||||
<a href="https://discord.gg/6ztZB9jvWq"><img src="https://img.shields.io/badge/UltraWorkers-Discord-5865F2?logo=discord&style=for-the-badge" alt="UltraWorkers Discord" /></a>
|
||||
</p>
|
||||
|
||||
Join the [**instructkr Discord**](https://instruct.kr/) — the best Korean language model community. Come chat about LLMs, harness engineering, agent workflows, and everything in between.
|
||||
Join the [**UltraWorkers Discord**](https://discord.gg/6ztZB9jvWq) — the community around clawhip, oh-my-openagent, oh-my-claudecode, oh-my-codex, and claw-code. Come chat about LLMs, harness engineering, agent workflows, and autonomous software development.
|
||||
|
||||
[](https://instruct.kr/)
|
||||
[](https://discord.gg/6ztZB9jvWq)
|
||||
|
||||
## Star History
|
||||
|
||||
|
||||
13
ROADMAP.md
13
ROADMAP.md
@@ -272,6 +272,18 @@ Priority order: P0 = blocks CI/green state, P1 = blocks integration wiring, P2 =
|
||||
|
||||
**P0 — Fix first (CI reliability)**
|
||||
1. Isolate `render_diff_report` tests into tmpdir — flaky under `cargo test --workspace`; reads real working-tree state; breaks CI during active worktree ops
|
||||
2. Expand GitHub CI from single-crate coverage to workspace-grade verification — current `rust-ci.yml` runs `cargo fmt` and `cargo test -p rusty-claude-cli`, but misses broader `cargo test --workspace` coverage that already passes locally
|
||||
3. Add release-grade binary workflow — repo has a Rust CLI and release intent, but no GitHub Actions path that builds tagged artifacts / checks release packaging before a publish step
|
||||
4. Add container-first test/run docs — runtime detects Docker/Podman/container state, but docs do not show a canonical container workflow for `cargo test --workspace`, binary execution, or bind-mounted repo usage
|
||||
5. Surface `doctor` / preflight diagnostics in onboarding docs and help — the CLI already has setup-diagnosis commands and branch preflight machinery, but they are not prominent enough in README/USAGE, so new users still ask manual setup questions instead of running a built-in health check first
|
||||
6. Add branding/source-of-truth residue checks for docs — after repo migration, old org names can survive in badges, star-history URLs, and copied snippets; docs need a consistency pass or CI lint to catch stale branding automatically
|
||||
7. Reconcile README product narrative with current repo reality — top-level docs now say the active workspace is Rust, but later sections still describe the repo as Python-first; users should not have to infer which implementation is canonical
|
||||
8. Eliminate warning spam from first-run help/build path — `cargo run -p rusty-claude-cli -- --help` currently prints a wall of compile warnings before the actual help text, which pollutes the first-touch UX and hides the product surface behind unrelated noise
|
||||
9. Promote `doctor` from slash-only to top-level CLI entrypoint — users naturally try `claw doctor`, but today it errors and tells them to enter a REPL or resume path first; healthcheck flows should be callable directly from the shell
|
||||
10. Make machine-readable status commands actually machine-readable — `status` and `sandbox` accept the global `--output-format json` flag path, but currently still render prose tables, which breaks shell automation and agent-friendly health polling
|
||||
11. Unify legacy config/skill namespaces in user-facing output — `skills` currently surfaces mixed project roots like `.codex` and `.claude`, which leaks historical layers into the current product and makes it unclear which config namespace is canonical
|
||||
12. Honor JSON output on inventory commands like `skills` and `mcp` — these are exactly the commands agents and shell scripts want to inspect programmatically, but `--output-format json` still yields prose, forcing text scraping where structured inventory should exist
|
||||
13. Audit `--output-format` contract across the whole CLI surface — current behavior is inconsistent by subcommand, so agents cannot trust the global flag without command-by-command probing; the format contract itself needs to become deterministic
|
||||
|
||||
**P1 — Next (integration wiring, unblocks verification)**
|
||||
2. Add cross-module integration tests — **done**: 12 integration tests covering worker→recovery→policy, stale_branch→policy, green_contract→policy, reconciliation flows
|
||||
@@ -293,6 +305,7 @@ Priority order: P0 = blocks CI/green state, P1 = blocks integration wiring, P2 =
|
||||
|
||||
**P3 — Swarm efficiency**
|
||||
13. Swarm branch-lock protocol — detect same-module/same-branch collision before parallel workers drift into duplicate implementation
|
||||
14. Commit provenance / worktree-aware push events — emit branch, worktree, superseded-by, and canonical commit lineage so parallel sessions stop producing duplicate-looking push summaries
|
||||
|
||||
## Suggested Session Split
|
||||
|
||||
|
||||
@@ -7,8 +7,10 @@ use crate::types::{MessageRequest, MessageResponse};
|
||||
pub mod anthropic;
|
||||
pub mod openai_compat;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub type ProviderFuture<'a, T> = Pin<Box<dyn Future<Output = Result<T, ApiError>> + Send + 'a>>;
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub trait Provider {
|
||||
type Stream;
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ fn is_binary_file(path: &Path) -> io::Result<bool> {
|
||||
/// Validate that a resolved path stays within the given workspace root.
|
||||
/// Returns the canonical path on success, or an error if the path escapes
|
||||
/// the workspace boundary (e.g. via `../` traversal or symlink).
|
||||
#[allow(dead_code)]
|
||||
fn validate_workspace_boundary(resolved: &Path, workspace_root: &Path) -> io::Result<()> {
|
||||
if !resolved.starts_with(workspace_root) {
|
||||
return Err(io::Error::new(
|
||||
@@ -557,6 +558,7 @@ fn normalize_path_allow_missing(path: &str) -> io::Result<PathBuf> {
|
||||
}
|
||||
|
||||
/// Read a file with workspace boundary enforcement.
|
||||
#[allow(dead_code)]
|
||||
pub fn read_file_in_workspace(
|
||||
path: &str,
|
||||
offset: Option<usize>,
|
||||
@@ -572,6 +574,7 @@ pub fn read_file_in_workspace(
|
||||
}
|
||||
|
||||
/// Write a file with workspace boundary enforcement.
|
||||
#[allow(dead_code)]
|
||||
pub fn write_file_in_workspace(
|
||||
path: &str,
|
||||
content: &str,
|
||||
@@ -586,6 +589,7 @@ pub fn write_file_in_workspace(
|
||||
}
|
||||
|
||||
/// Edit a file with workspace boundary enforcement.
|
||||
#[allow(dead_code)]
|
||||
pub fn edit_file_in_workspace(
|
||||
path: &str,
|
||||
old_string: &str,
|
||||
@@ -602,6 +606,7 @@ pub fn edit_file_in_workspace(
|
||||
}
|
||||
|
||||
/// Check whether a path is a symlink that resolves outside the workspace.
|
||||
#[allow(dead_code)]
|
||||
pub fn is_symlink_escape(path: &Path, workspace_root: &Path) -> io::Result<bool> {
|
||||
let metadata = fs::symlink_metadata(path)?;
|
||||
if !metadata.is_symlink() {
|
||||
|
||||
@@ -4,10 +4,8 @@ use std::fs;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::UNIX_EPOCH;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::session::{Session, SessionError};
|
||||
use crate::worker_boot::{Worker, WorkerReadySnapshot, WorkerRegistry, WorkerStatus};
|
||||
|
||||
pub const PRIMARY_SESSION_EXTENSION: &str = "jsonl";
|
||||
pub const LEGACY_SESSION_EXTENSION: &str = "json";
|
||||
|
||||
@@ -19,6 +19,7 @@ use crate::AgentOutput;
|
||||
///
|
||||
/// Returns `Some(LaneContext)` with `completed = true` if all conditions met,
|
||||
/// `None` if lane should remain active.
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn detect_lane_completion(
|
||||
output: &AgentOutput,
|
||||
test_green: bool,
|
||||
@@ -65,6 +66,7 @@ pub(crate) fn detect_lane_completion(
|
||||
}
|
||||
|
||||
/// Evaluates policy actions for a completed lane.
|
||||
#[allow(dead_code)]
|
||||
pub(crate) fn evaluate_completed_lane(
|
||||
context: &LaneContext,
|
||||
) -> Vec<PolicyAction> {
|
||||
|
||||
Reference in New Issue
Block a user