Skip to content

Commit 5e06e58

Browse files
committed
docs: Update README with transparency statement
1 parent 2e18a27 commit 5e06e58

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,40 @@
1-
# Claw Code (C++ Edition) 🚀
1+
# Claw Code (C++ Educational Skeleton) 🛠️🤖
22

33
![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)
44
![C++20](https://img.shields.io/badge/C++-20-blue.svg)
5-
![Build](https://img.shields.io/badge/build-CMake-green.svg)
65

7-
A clean-room, highly-performant C++20 reimplementation of the **Claw Code AI Agent Harness**.
8-
9-
Rather than being a simple chatbot that stops after a single reply, this is an **agentic loop architecture**. It integrates deeply with the Anthropic Messages API, sending explicit tool schemas to the model, and recursively executing local tools (like Bash and File I/O) on behalf of the AI until a task is completed.
6+
> **Transparency Note (Read First):** \
7+
> This is **not** a port of the massive 500k LOC original Claw Code repository. This is a minimal, from-scratch skeleton project built explicitly as an exercise to explore what an agentic tool-loop looks like in C++.
8+
>
9+
> Furthermore, **the C++ architecture in this repository was entirely generated by Antigravity AI** (an agentic coding tool driven by advanced LLMs) under the guidance of Rayed Hasan. It was built to see if an AI could reconstruct a basic Claude-like loop in C++20. Expectations should be matched accordingly: it's a bare-bones architectural experiment, **not** a production-ready daily driver.
1010
1111
---
1212

13-
## ⚡ Features
13+
## What Actually Is This?
14+
15+
It is the absolute **minimum viable architecture** (MVA) required for an AI agent. Most coding agents are built in TypeScript/Python. We wanted to see what it would take to compile a tool-use loop directly to a native C++ binary.
16+
17+
As noted by the community, this isn't magic. Under the hood, this is essentially a trivial HTTP loop that fetches tool requests and blindly shells out to system commands.
18+
19+
### What is included:
20+
- **The Agentic Loop:** A recursive runtime that sends prompts, parses `stop_reason: tool_use`, executes local tools, feeds results back, and repeats.
21+
- **3 Minimal Tools:**
22+
- `BashTool` (Uses `popen` to shell out. Capped at 50KB output to prevent hangs).
23+
- `FileReadTool` / `FileWriteTool`
24+
- **Interactive REPL:** A basic terminal interface.
25+
26+
## Addressing Community Feedback 🗣️
1427

15-
- **True Agentic Tool Loop:** Context-aware routing and recursive API calls.
16-
- **Interactive REPL & One-Shot:** Native slash commands (`/quit`, `/clear`, `/usage`) and one-shot prompt scripts.
17-
- **Built-in Tooling Layer:**
18-
- `BashTool`: Execute local shell scripts with configurable timeouts and output truncation guards.
19-
- `FileReadTool`: Read files up to 512KB to inspect codebases safely.
20-
- `FileWriteTool`: Write strings to files with automatic parent-directory creation.
21-
- **Native Static Binary:** Builds to a fast, statically linked binary. Zero python/npm dependencies.
22-
- **Context Compaction:** Auto-trims history past a certain turn limit to keep token window budgets low.
28+
When initially posting this concept, the hype heavily overstated the code's real capabilities. Based on very valid feedback, here is exactly what this project **lacks** and why you shouldn't use it for sensitive work yet:
29+
30+
### 1. Wait, there is ZERO permission control?
31+
**Correct.** A capable, safe AI coding tool *must* have an `allow`/`ask`/`deny` permission system. Right now, this C++ skeleton just executes whatever bash command the LLM requests, completely unconditionally. Do not run this on sensitive systems without sandboxing. Building proper CLI permission barriers is a critical next step.
32+
33+
### 2. You said it's "highly performant" and "C++20"?
34+
The phrase "highly performant" was just referring to the fact that it's a small static binary rather than spinning up a V8 Node engine. That's all. As for C++20, we just use `std::variant` to parse Anthropic's mixed `[TextBlock, ToolUseBlock]` arrays cleanly, alongside `fmt` and `nlohmann-json`. It's modern C++, but the underlying logic is incredibly basic.
35+
36+
### 3. What's next? (LSP / MCP)
37+
Shelling out to `bash` for everything is messy and error-prone. The real interesting frontier developers should explore with this kind of native C++ skeleton is integrating **LSP (Language Server Protocol)** and **MCP (Model Context Protocol)**. That would allow the agent to actually "understand" codebases rather than blindly parsing `grep` outputs.
2338

2439
## 🏗️ Architecture Design
2540

@@ -55,7 +70,7 @@ claw-cpp-public/
5570
│ ├── client.cpp/hpp # HTTPS logic via cpp-httplib
5671
│ └── types.hpp # Rich API content block modeling (Variant)
5772
├── cli/
58-
│ └── main.cpp # REPL CLI Interface & entrypoint
73+
│ └── main.cpp # REPL CLI Interface
5974
├── runtime/
6075
│ └── session.cpp/hpp # Core agentic recursion loop
6176
└── tools/
@@ -68,13 +83,15 @@ claw-cpp-public/
6883

6984
## 🚀 Getting Started
7085

86+
If you want to poke around the skeleton and experiment with C++ agent loops!
87+
7188
### Prerequisites
7289

7390
You need a C++20 compatible compiler and CMake.
7491
For Windows users, you can use Winget:
7592
```powershell
7693
winget install Kitware.CMake
77-
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --quiet --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
94+
winget install Microsoft.VisualStudio.2022.BuildTools
7895
winget install ShiningLight.OpenSSL # Needed for HTTPS network calls
7996
```
8097

@@ -93,21 +110,4 @@ cmake --build . --config Release
93110

94111
### Usage
95112

96-
Export your API Key to the environment:
97-
```powershell
98-
# Windows
99-
$env:ANTHROPIC_API_KEY="sk-ant-..."
100-
101-
# macOS/Linux
102-
export ANTHROPIC_API_KEY="sk-ant-..."
103-
```
104-
105-
Run the REPL:
106-
```bash
107-
./Release/claw-cpp
108-
```
109-
110-
Run a one-shot query:
111-
```bash
112-
./Release/claw-cpp prompt "List the files in this directory and tell me what they are."
113-
```
113+
Export your Anthropic API Key to the environment (`$env:ANTHROPIC_API_KEY="sk-ant-..."`), and run the built `claw-cpp` executable.

0 commit comments

Comments
 (0)