Claw Code

Claw Code is an open-source terminal coding agent developed under the HarnessLab organization on GitHub. The project provides a Python-based implementation and benchmarking harness designed to replicate and experiment with core agentic execution loops, prompt engineering frameworks, and CLI-driven interaction patterns. Operationally, Claw Code standardizes system prompt construction, tool execution boundaries, and response rendering. It structures interactions using detailed system prompts, XML tag conventions, scratchpad scratch memory, and cached system prompt sections. The codebase manages API payload limits across multimodal inputs (such as image and PDF handling), result-size bounds on tool execution, and granular UI state updates like turn completions and status indicators. Claw Code differentiates itself by providing an inspectable, cleanly modularized Python architecture ported from TypeScript agent internals. Rather than functioning purely as an opaque proprietary binary, it exposes the underlying prompt constant definitions, cyber risk safety instructions, output styles, and benchmark evaluation suites, making it useful for researchers and engineers studying agentic behavior. Claw Code is published as an open-source repository on GitHub under active community development. As a Python-centric agent and harness, it can be run locally using custom API endpoints and configured LLM providers.

Tags: ai agent, cli, code assistant, coding agent, developer tools, OpenSource

Visit Claw Code

Key features

  • Modular Prompt Architecture — Implements structured prompt constants, system prefixes, and volatile or memoized prompt section caching. - Tool and Payload Constraint Handling — Enforces deterministic limits on tool output size and multimodal API payloads including images and documents. - XML-Based Output Structuring — Utilizes standardized XML tag sets for scratchpads, tool calls, and model reasoning extraction. - Configurable Output Styles — Supports multiple output styling presets to adapt terminal feedback during autonomous sessions. - Integrated Safety & Risk Instructions — Embeds specialized cyber risk guardrails and system instructions directly into agent turn prompts. - Terminal UI State Tracking — Features dynamic spinner verbs, turn completion status tracking, and Unicode terminal UI symbols.

Use cases

Use Case: Agentic System Prompt and Architecture Research Developers and AI researchers can inspect, modify, and benchmark the Python port of agentic prompt constants, XML schemas, and context caching strategies without relying on closed-source CLI binaries.

Use Case: Automated Terminal Task Execution Engineers can run local coding agent loops to execute file operations, inspect codebases, and iterate on refactoring tasks within standard terminal environments.

Use Case: Benchmarking Agent Performance Teams evaluating autonomous agent reliability can run the included benchmark test suites across various LLM backends to measure tool-use precision and prompt adherence.

Who it is for

Claw Code is built for AI engineers, systems developers, and researchers looking for an inspectable, open-source Python framework to study and run terminal-based coding agents. It is less suited for non-technical users seeking a turnkey graphical IDE extension with zero configuration.

Install guide

Installation Clone the repository and set up a Python virtual environment: bash git clone https://github.com/HarnessLab/claw-code-agent.git cd claw-code-agent python3 -m venv .venv source .venv/bin/activate pip install -e .

First Run Configure your environment variables for your target LLM provider: bash export ANTHROPIC_API_KEY="your-api-key-here" # Or configure alternative provider keys as required

Example Session Launch the agent inside your target workspace: bash claw-code Within the interactive session, submit a task prompt: text > Inspect src/prompt_constants.py and write a pytest suite to verify XML tag formatting.

Part of CLI Coding Agents

Categories: AI Coding Agents, Code Assistants, Developer Tools

Related CLI agents

  • Plandex — Plandex is an open-source terminal-based AI coding agent designed to handle complex, multi-file engineering tasks in large codebases. Created by…
  • OpenCode — OpenCode is an open-source AI coding agent developed by Anomaly that operates across terminal environments, desktop applications, and IDE extensions.…
  • OpenHands — OpenHands (formerly OpenDevin) is an open-source autonomous AI software development agent and orchestration platform. It provides an extensible runtime environment…
  • Subtask — Subtask is an open-source CLI agent harness and orchestration tool developed by zippoxer in Go. It is built to coordinate…
  • EchoCoding — EchoCoding is an open-source agent harness and audio-augmented developer tooling layer created by launsion-boop. Designed to run alongside AI coding…
  • pi-reflect — pi-reflect is an open-source agent harness and self-improvement extension for pi coding agents, developed by jo-inc. It inspects agent session…
  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories