Claude Recursive Spawn — Development skill for Claude Code
Bash script for recursive Claude Code execution with depth control, JSON output parsing, and automatic session management.
How to install Claude Recursive Spawn
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open haasonsaas/claude-recursive-spawn and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Claude Recursive Spawn does
Bash script for recursive Claude Code execution with depth control, JSON output parsing, and automatic session management.
Alternatives in Development
- Happy Coder — by GrocerPublishAgent - Spawn and control multiple Claude Codes in parallel from your phone or desktop 15.7k ★
- Ralphy — My Ralph Wiggum setup, an autonomous bash script that runs Claude Code, Codex, OpenCode, Cursor agent, Qwen & 2.8k ★
- Claude Supermemory — Persistent memory across sessions and projects using Supermemory 2.3k ★
README
Claude Recursive Spawn
A flexible bash script for recursive Claude Code execution with depth control, multiple output modes, and extensive configuration options.
Features
- 🔄 Recursive execution with configurable depth limits
- 📊 Multiple output modes: JSON, extracted results, or status messages
- 🎨 Colored output with verbose mode for debugging
- 🔧 Flexible configuration via CLI options or environment variables
- 📁 Automatic output management with timestamped files
- 🚀 Smart Claude detection across different installation methods
Installation
git clone https://github.com/haasonsaas/claude-recursive-spawn.git
cd claude-recursive-spawn
chmod +x claude_spawn
Usage
./claude_spawn [options] [depth] [prompt]
Options
-h, --help- Show help message-m, --max-depth NUM- Set max recursion depth (default: 4)-o, --output-dir DIR- Set output directory (default: /tmp/claude_spawn)-v, --verbose- Enable verbose output-j, --json-only- Only output JSON (no status messages)-c, --claude-path PATH- Set path to Claude executable-e, --extract-result- Extract and display the result field from JSON
Examples
# Basic usage
./claude_spawn 0 "What is 2+2?"
# With custom max depth
./claude_spawn -m 6 0 "Analyze this codebase"
# JSON output only (for piping)
./claude_spawn -j 0 "List files" | jq .result
# Extract result directly
./claude_spawn -e 0 "What is the capital of France?"
# Verbose mode for debugging
./claude_spawn -v 0 "Debug this issue"
# Custom Claude path
./claude_spawn -c /opt/claude/bin/claude 0 "Hello"
Environment Variables
CLAUDE_MAX_DEPTH- Override default max depthCLAUDE_TMP_DIR- Override default output directoryCLAUDE_CMD- Override default Claude commandCC_PROMPT- Default prompt if none provided
Output Structure
Output files are saved as: `depth-{depth}-{timestamp}.json`
Example JSON output:
{
"t
Related Skills
Tmux Spawn Skill For Claude Code
Claude Code skill for spawning observable tmux sessions. Launch background Claude agents in visible terminal p
Terminal Handoff
Persistent Claude Code session handoff and secure remote control from authorised devices, with automatic conti
Wezbridge
Zero-dependency MCP server to orchestrate a swarm of Claude Code / Codex sessions across WezTerm panes — any s
Claude Sprint Agent
A wrapper script that runs an unattended Claude Code "sprint" in headless mode, monitors the output for a DONE
Trade Session
Run one trading cycle - parallel analysts and risk, strategy check, journaled plan, risk verdict, execution or
Trusty Mpm
Rust daemon reimagining of claude-mpm: stable process, tmux session control, native trusty-memory/search integ
Related Agents
Operations Master
Use this agent when managing the complete operations workflow including task intake, parsing, planning, execut
Subprocess Safety Reviewer
Reviews changes that spawn or control external processes (tmux, git, gh, bash, agent CLIs) and changes touchin
House Bash
Command execution specialist. Use proactively for running builds, tests, deployments, or any multi-step comman