Claude Recursive Spawn
Description
Bash script for recursive Claude Code execution with depth control, JSON output parsing, and automatic session management
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
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
Auto Update
Pull the latest ECC repo changes and reinstall the current managed targets.
Development Ecc Guide
Navigate ECC's current agents, skills, commands, hooks, install profiles, and docs from the live repository su
Development Epic Claim
Claim an epic issue, stamp coordination state, and sync local ownership.
Development Epic Publish
Publish a validated epic update back to the issue and local cache.
Development Epic Review
Mark epic review requested, approved, or changes requested.
Development Epic Unblock
Sweep blocked epic issues and reopen anything whose dependencies are closed.
Development Related Agents
Django Build Resolver
Django/Python build, migration, and dependency error resolution specialist. Fixes pip/Poetry errors, migration
Openai Codex CLI
(55.8k ⭐) - Lightweight coding agent that runs in your terminal.
src/agents/ — 11 Agent Definitions
**Generated:** 2026-04-11