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

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.txtstate 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 thestderr, 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 anexperience.txtfile. 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.
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
👀 See Also
Atlas: World Labs' Omni World Model for Spatial Intelligence
World Labs introduces Atlas, an omni world model that natively handles text, images, video, and 3D. It enables camera-controlled generation, spatial reconstruction, and space-time simulation.

uimax-mcp: Free MCP Server for Automated Frontend Code Review and Fixes with Claude Code
uimax-mcp is a free MCP server that automates frontend code review and fixes using Claude Code. With one command, it captures screenshots, runs Lighthouse and accessibility audits, scans for anti-patterns, and generates automated fixes.
Multi-Agent Memory: Open Source Shared Memory System for AI Agents
Multi-Agent Memory is an open source project that provides a shared memory system for AI agents across different machines, tools, and frameworks. It supports four distinct memory types with specific behaviors and includes features like credential scrubbing, agent isolation, and LLM consolidation.

BaseLayer: Open-Source Behavioral Compression Pipeline for AI Memory Systems
BaseLayer is an open-source pipeline that extracts beliefs, behaviors, tensions, and contradictions from conversations, journals, and published text, compressing them into an identity brief for AI models. It has been tested on datasets ranging from 8 personal journal entries to large corpora like Warren Buffett's shareholder letters (350k words) and Howard Marks' investment memos (600k words).