Patches Claude Code to enable nested sub-agent calls - allowing sub-agents to invoke other sub-agents via the Task tool, creating deeper automation chains.
Note: Automatically tested and released for latest Claude Code versions.
This tool removes the depth limitation that prevents sub-agents from using the Task tool, enabling recursive agent chains. Sub-agents can now invoke other sub-agents, creating deeper automation workflows.
# Install the complete patched package directly from GitHub releases
npm install -g https://github.com/yourusername/free-claude/releases/latest/download/free-claude-code-*.tgz
# Verify installation
claude --versionAlternative download method:
# Download and install manually
wget $(curl -s https://api.github.com/repos/yourusername/free-claude/releases/latest | grep "browser_download_url.*free-claude-code.*\.tgz" | cut -d '"' -f 4)
npm install -g free-claude-code-*.tgz# Apply patches to Claude Code
make patch
# Or specify Claude binary path
make patch CLAUDE=/path/to/claude
# Run the patched version
free_claude
# Restore original Claude Code from backup
make restoreThe auto-release system:
- Downloads the complete
@anthropic-ai/claude-codenpm package - Extracts all files (binary, vendor files, SDK, etc.)
- Applies patches to the
cli.jsfile for sub-agent recursion - Repackages as
free-claude-codewith modifiedpackage.json - Releases complete npm package ready for installation
The manual patcher:
- Locates your Claude Code installation (supports wrapper scripts)
- Finds the actual JavaScript bundle (
cli.js) - Creates a timestamped backup before patching
- Applies the patch to enable recursive sub-agents
- Creates a
free_claudecommand in~/.local/bin
# From complete package installation
npm uninstall -g free-claude-code
npm install -g @anthropic-ai/claude-code@latest
# From manual patching
make restoreThis repository automatically creates new releases whenever Claude Code is updated, with intelligent auto-repair capabilities:
- 🤖 Dependabot monitors for new Claude Code versions daily
- 🧪 Auto-testing verifies patches work with the new version
- 🔧 Auto-fix uses Claude AI to repair broken patches automatically
- 📦 Auto-release creates complete npm package if tests pass
⚠️ Alerts notify if manual intervention is needed
For the auto-fix functionality to work, the following secrets must be configured in the repository:
| Secret | Description | Required | Default |
|---|---|---|---|
ANTHROPIC_API_KEY |
Your Anthropic API key for Claude | ✅ Yes | - |
ANTHROPIC_BASE_URL |
Custom Anthropic API base URL | ❌ Optional | https://api.anthropic.com |
ANTHROPIC_AUTH_TOKEN |
Alternative auth token (instead of API key) | ❌ Optional | - |
To add secrets:
- Go to your repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Add the required secrets:
ANTHROPIC_API_KEY- Your Anthropic API key (required)ANTHROPIC_BASE_URL- Only if using custom endpoint (optional)ANTHROPIC_AUTH_TOKEN- Only if using auth token instead of API key (optional)
Notes:
GITHUB_TOKENis automatically provided by GitHub Actions - no setup needed- For most users, only
ANTHROPIC_API_KEYis required - Enterprise or regional setups may need
ANTHROPIC_BASE_URL ANTHROPIC_AUTH_TOKENis an alternative toANTHROPIC_API_KEY(use one or the other)
Each release includes:
- Complete npm package (77MB) - Drop-in replacement for
@anthropic-ai/claude-code - All vendor files - ripgrep binaries, JetBrains plugin, SDK, etc.
- Sub-agent recursion enabled - The critical patch for nested Task tool usage
- Easy installation - Single npm command installation
- Simple rollback - Uninstall and reinstall original package
- Watch this repository for release notifications
- Check Releases for the latest patched version
- Install the complete package that matches your Claude Code version:
npm install -g https://github.com/yourusername/free-claude/releases/download/vX.Y.Z/free-claude-code-X.Y.Z.tgz
- Package name:
free-claude-code(instead of@anthropic-ai/claude-code) - Size: ~35MB compressed, ~77MB unpacked
- Files: 53 files including all platform binaries
- Installation: Standard npm global install
- Compatibility: 100% compatible with original Claude Code
graph LR
A[Dependabot detects<br/>Claude update] --> B[Auto-test patches]
B --> C{Tests pass?}
C -->|✅ Yes| D[Create release<br/>with patched binary]
C -->|❌ No| E[Auto-fix patches<br/>using Claude AI]
E --> F{Auto-fix<br/>successful?}
F -->|✅ Yes| G[Merge PR] --> D
F -->|❌ No| H[Label PR<br/>'claude-failed']
D --> I[Close/Merged PR]
H --> J[Manual intervention<br/>required]
You can also manually trigger the auto-fix workflow:
- Go to Actions → Auto Fix Patches → Run workflow
- Enter Claude version (e.g.,
1.0.87) - Optionally specify PR number to update existing PR, or leave empty to create new PR
- Let Claude fix the patches automatically
When Claude Code updates break the patches, the auto-fix system:
- 🔍 Detects failure - Test patches workflow fails on Dependabot PR
- 🤖 Calls Claude - Uses Claude Code Action with the
claude-patch-updateragent - 🔧 Analyzes patterns - Claude examines the new version and identifies changed variable names/patterns
- ✏️ Updates patterns - Automatically updates regex patterns in
scripts/patch.py - 🧪 Tests fixes - Validates patches work with Docker build
- 🔀 Merges automatically - If successful, merges the PR and triggers release
⚠️ Escalates if needed - Labels PR for manual review if auto-fix fails
Benefits:
- ⚡ Faster recovery - Minutes instead of manual hours
- 🧠 Intelligent analysis - Claude understands code patterns and variable changes
- 🛡️ Safe validation - Always tests before applying
- 📝 Full transparency - All changes logged and auditable
- Watch this repository for release notifications
- Check Releases for the latest patched version
- Install the complete package that matches your Claude Code version:
npm install -g https://github.com/yourusername/free-claude/releases/download/vX.Y.Z/free-claude-code-X.Y.Z.tgz
- Package name:
free-claude-code(instead of@anthropic-ai/claude-code) - Size: ~35MB compressed, ~77MB unpacked
- Files: 53 files including all platform binaries
- Installation: Standard npm global install
- Compatibility: 100% compatible with original Claude Code
