Recently, an AI developer proposed and validated an innovative automated software development workflow. This method cleverly combines the AI agent framework OpenClaw with the large language model Claude Code. Through a clear division of labor, it successfully resolves the common stability and interactivity problems that AI agents face when independently executing complex programming tasks.
The Challenge of Automated Development: Stability and Interaction Hurdles for AI Agents
In the exploration of AI-driven software development, autonomous agents like OpenClaw hold great promise. However, in practical applications, especially in end-to-end software development scenarios, these agents reveal several core shortcomings. The developer pointed out that directly having an agent code often leads to unexpected process termination, ineffective error reporting, and prolonged blocking while waiting for user input. These problems make the development process unreliable, wasting significant computational resources and time, and making it difficult to achieve stable productivity.
These challenges reflect the current limitations of AI agents in long-task execution, environmental awareness, and autonomous error correction. Even if they can write code, they lack the robustness required of a reliable ‘engineer’.
The “Project Manager + Engineer” Model: Decoupling Task Management from Code Generation
To address the issues above, the developer proposed a collaborative “Project Manager + Engineer” architecture. In this model, the responsibilities of the two AI tools are clearly defined:
Project Manager (OpenClaw): Leverages its 24/7 availability, persistent memory, multi-task management, and ability to collaborate with humans through platforms like Lark to handle high-level project management. Its duties include: understanding product requirements expressed in natural language, writing Product Requirement Documents (PRDs) and technical specifications, breaking down large tasks into specific development sub-tasks, monitoring development progress, and performing initial troubleshooting or reporting to humans when issues arise.
Development Engineer (Claude Code): Relies on its top-tier programming skills, understanding of the entire codebase, and autonomous debugging capabilities to focus on the concrete coding work. It receives clear instructions from the “Project Manager” OpenClaw to perform code writing, modification, and debugging.
This architecture decouples macroscopic task planning from microscopic code implementation. The entire workflow is highly automated: after a human user submits a requirement, OpenClaw takes over everything, autonomously directing Claude Code to complete project initialization, feature development, API key requests (if necessary), and finally conducting automated testing using tools like Playwright, delivering a test report with screenshots.
Key Technology: Using PTY Mode to Resolve Process Communication and Blocking
The technical core for achieving this collaborative architecture lies in solving how OpenClaw can stably and efficiently invoke and manage the Claude Code process. The developer found that directly calling command-line tools often caused them to hang due to standard input/output (I/O) issues. The solution is to use a pseudo-terminal (PTY) mode for invocation.
By adding the pty:true parameter to the bash command, a simulated terminal environment is created for the child process, thereby solving three critical problems:
- Process Management: Combined with the
background:true parameter, Claude Code’s development task runs in the background. The main OpenClaw process is not blocked and can continue to handle other tasks or monitor the current one.
- Interactive Blocking: By setting the
--permission-mode acceptEdits parameter, Claude Code is authorized to modify files without needing to stop and ask for permission each time, greatly enhancing the level of automation.
- Session Persistence: Using the
--session-id parameter allows the previous session context to be restored with the --resume command if a task is interrupted, ensuring the continuity of long-running tasks.
Furthermore, the entire workflow is encapsulated in a SKILL.md file, which details the five stages from requirement analysis to testing and delivery, serving as a “Standard Operating Procedure” (SOP) for OpenClaw to execute development tasks.
Practical Validation: Building a TikTok Video Analysis System from Scratch
To verify the effectiveness of this model, the developer simply described the requirements in a short natural language text and successfully had this AI system develop a fully functional website for analyzing viral TikTok videos from scratch. The website includes the following core features:
- Marketing Strategy Analysis: Analyzes uploaded TikTok videos to extract underlying marketing strategies.
- Frame-by-Frame Breakdown: Decomposes the video into multiple shot segments for detailed analysis.
- Sora Prompt Reverse-Engineering: Reverse-engineers prompts suitable for text-to-video models like Sora based on the video’s content and style.
- Structured Script Conversion: Converts the audio content of the video into a structured text script.
The entire process, from requirement input to a usable product, only required the developer to confirm the technical plan at the beginning and accept the final result at the end. No coding or handling of intermediate technical issues was needed, fully demonstrating the autonomous development capability of this “AI team”.