ClawPy: Minimal Single-File Python Implementation of OpenClaw with Experience Memory

✍️ OpenClawRadar📅 Published: March 12, 2026🔗 Source
ClawPy: Minimal Single-File Python Implementation of OpenClaw with Experience Memory
Ad

What This Is

ClawPy is a minimal, single-file Python implementation of OpenClaw's autonomous task execution architecture. It runs directly in the terminal without heavy abstractions, focusing on raw prompt engineering, state machine logic, and subprocess execution.

Key Implementation Details

The script mirrors OpenClaw's core mechanics:

  • Recursive Task Tree: Maintains a tasks.txt state file that tracks incomplete tasks. The system reads this file, decides whether to execute tasks directly or decompose them (up to 4 levels deep), and automatically bubbles up "Completed" status.
  • Code Interpreter & Self-Healing: Uses custom XML tags (<python>) to write and run scripts locally. When execution hits a traceback, it catches the stderr, forces an <error> reflection tag to analyze the bug, and rewrites the code until it achieves Return Code 0.
  • Experience Memory System: Every time the agent successfully executes a script (explained via <msg> tags) or reflects on a crash (<error>), it appends that insight to an experience.txt file. When booted up again, the system injects truncated history of past mistakes and successes into the system prompt, preventing repetition of syntax or logical errors.
Ad

Practical Use Cases

The developer built this for two main audiences:

  • People who want to learn exactly how the autonomous loop works under the hood without diving into a massive codebase
  • Data analysts and quants who want a lightweight agent to write and fix Pandas/financial scripts in their local environment

Important Security Note: The tool runs generated Python code directly on your machine, so the developer recommends running it in a safe environment or virtual machine.

The project is available on GitHub at https://github.com/EricChanBank/clawPy.git.

📖 Read the full source: r/openclaw

Ad

👀 See Also

Skill Seekers v3.2.0 adds YouTube tutorial extraction for Claude skills
Tools

Skill Seekers v3.2.0 adds YouTube tutorial extraction for Claude skills

Skill Seekers v3.2.0 now extracts content from YouTube tutorials to create structured SKILL.md files for Claude. The tool uses a two-pass AI enhancement workflow to clean OCR output and generate usable documentation from video content.

OpenClawRadar
OpenClaw Outlook Add-in Connects Local Agent to Email Sidebar
Tools

OpenClaw Outlook Add-in Connects Local Agent to Email Sidebar

A developer built an Outlook add-in that connects to a local OpenClaw Gateway via WebSocket, providing full agent access with tools and automations directly in the email sidebar. The tool reads selected emails as context, maintains per-email chat sessions, and works with Outlook Desktop and Web.

OpenClawRadar
The Bottleneck in Parallel AI Agents: Human Approval Queue Bottleself
Tools

The Bottleneck in Parallel AI Agents: Human Approval Queue Bottleself

A developer running parallel Claude Code agents describes the 'bottleself' — the point where parallelism stops adding output and starts creating a backlog of human approvals. Their solution: a planner that decomposes goals into subtasks, spawns agents, and only pings on unresolved decisions.

OpenClawRadar
Android CLI and Skills for AI Agent Development Workflows
Tools

Android CLI and Skills for AI Agent Development Workflows

Google released Android CLI with commands like android create and android sdk install, plus Android Skills GitHub repository with modular instruction sets. Internal benchmarks show 70% reduction in LLM token usage and 3x faster task completion.

OpenClawRadar