Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Execute Claude Code autonomously in the background for well-defined tasks, enabling parallel execution of up to 5 concurrent sessions while the user continues other work.
.claude/skills/majiayu000-claude-code-x-autonomous-execution-subagent/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 34% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 420% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 316% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 163% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 134% | 0% |
Type: Task Execution Agent Mode: Background Autonomous Version: 1.0.0
Execute Claude Code autonomously in the background for well-defined tasks, enabling parallel execution of up to 5 concurrent sessions while the user continues other work.
✅ Use When:
❌ Don't Use When:
Please use the Claude Code X skill to execute the following task in the background:
"Implement logging for the authentication module in crates/miyabi-auth/src/lib.rs"Use Claude Code X to execute these 5 tasks in parallel:
1. Add logging to crates/miyabi-auth/src/lib.rs
2. Add logging to crates/miyabi-database/src/lib.rs
3. Add logging to crates/miyabi-api/src/lib.rs
4. Add logging to crates/miyabi-cache/src/lib.rs
5. Add logging to crates/miyabi-worker/src/lib.rs
Monitor their progress and report when all are complete.Use Claude Code X with:
- Timeout: 15 minutes
- Tools: Bash, Read, Write, Edit, Grep
- Task: "Refactor error handling in crates/miyabi-core/src/errors.rs"When this skill is invoked, execute the following steps:
Check that the task is:
If unclear, ask user for clarification before proceeding.
Use the claude-code-x.sh shell script:
bash# Execute task ./.claude/commands/claude-code-x.sh exec "Task description here" # Optional: Custom configuration ./.claude/commands/claude-code-x.sh exec "Task description" \ --timeout 900 \ --tools "Bash,Read,Write,Edit,Glob,Grep"
The script will output:
✅ Session started successfully
🔗 Session ID: claude-code-x-20251027-123456-abc123
🔗 PID: 12345Store this session ID for monitoring.
During execution, you can check status:
bash# Check status ./.claude/commands/claude-code-x.sh status claude-code-x-20251027-123456-abc123 # List all sessions ./.claude/commands/claude-code-x.sh sessions
After completion, get full output:
bash./.claude/commands/claude-code-x.sh result claude-code-x-20251027-123456-abc123
Provide summary:
Good Task:
"Add comprehensive logging to crates/miyabi-auth/src/lib.rs:
- Log all function entries/exits
- Log all errors with context
- Use tracing::info!, tracing::error!
- Include test coverage"
Bad Task:
"Fix the auth module" (too vague)
"Implement OAuth" (needs user decisions)Pattern 1: Similar Tasks (Ideal)
Task 1: Add logging to module A
Task 2: Add logging to module B
Task 3: Add logging to module C
Task 4: Add logging to module D
Task 5: Add logging to module E
→ All 5 tasks in parallel (max efficiency)Pattern 2: Phased Execution (Good)
Phase 1 (parallel): Infrastructure setup tasks
- Task 1: Create config struct
- Task 2: Add database schema
- Task 3: Implement Redis cache
Phase 2 (interactive): Critical logic (use regular Claude Code)
Phase 3 (parallel): Provider implementations
- Task 4: Google provider
- Task 5: GitHub provider
- Task 6: Discord providerIf a session fails:
bash./.claude/commands/claude-code-x.sh sessions
bash./.claude/commands/claude-code-x.sh status <session-id>
bash./.claude/commands/claude-code-x.sh result <session-id>
bash./.claude/commands/claude-code-x.sh kill <session-id>
bash./.claude/commands/claude-code-x.sh cleanup
bash# Session directory (default: .ai/sessions/claude-code-x) export CLAUDE_CODE_X_SESSION_DIR=".ai/sessions/claude-code-x" # Log directory (default: $SESSION_DIR/logs) export CLAUDE_CODE_X_LOG_DIR="$SESSION_DIR/logs" # Max concurrent sessions (default: 5) export CLAUDE_CODE_X_MAX_SESSIONS=5 # Default timeout in seconds (default: 600 = 10 minutes) export CLAUDE_CODE_X_TIMEOUT=600
The following tools are enabled by default:
acceptEdits (auto-accept file edits)ask for approval promptsUser Request: "Add logging to the auth module"
Agent Action:
bash./.claude/commands/claude-code-x.sh exec \ "Add comprehensive logging to crates/miyabi-auth/src/lib.rs: - Log all function entries/exits with tracing::info! - Log all errors with tracing::error! - Include request IDs in log context - Add tests for logging behavior"
Agent Response:
✅ Started Claude Code X session: claude-code-x-20251027-100000-abc123
📝 Executing task in background (timeout: 10 minutes)
💡 Monitor with: /claude-code-x status claude-code-x-20251027-100000-abc123
I'll check back in 2 minutes to see progress.User Request: "Add logging to all 5 core modules"
Agent Action:
bash# Launch 5 parallel sessions ./.claude/commands/claude-code-x.sh exec "Add logging to crates/miyabi-auth/src/lib.rs" ./.claude/commands/claude-code-x.sh exec "Add logging to crates/miyabi-database/src/lib.rs" ./.claude/commands/claude-code-x.sh exec "Add logging to crates/miyabi-api/src/lib.rs" ./.claude/commands/claude-code-x.sh exec "Add logging to crates/miyabi-cache/src/lib.rs" ./.claude/commands/claude-code-x.sh exec "Add logging to crates/miyabi-worker/src/lib.rs"
Agent Response:
✅ Started 5 parallel Claude Code X sessions:
1. claude-code-x-20251027-100000-abc123 (auth)
2. claude-code-x-20251027-100015-def456 (database)
3. claude-code-x-20251027-100030-ghi789 (api)
4. claude-code-x-20251027-100045-jkl012 (cache)
5. claude-code-x-20251027-100100-mno345 (worker)
Estimated completion: ~5 minutes
I'll monitor progress and report when all complete.User Request: "Implement OAuth 2.0 authentication"
Agent Action (Pattern 3: Hybrid Orchestration):
Phase 1: Planning (Interactive)
- Breaking down OAuth into discrete tasks...
Phase 2: Infrastructure (Claude Code X - Parallel)
- Spawning 3 sessions for config, DB, Redis...
Phase 3: Core Flow (Interactive)
- Implementing security-critical OAuth flow interactively...
Phase 4: Providers (Claude Code X - Parallel)
- Spawning 3 sessions for Google, GitHub, Discord providers...
Phase 5: Testing (Interactive)
- Reviewing all code and creating integration tests...
Result: 42 minutes (30% faster than all-interactive)Error: Maximum concurrent sessions (5) reached
Solution:
bash# List active sessions ./.claude/commands/claude-code-x.sh sessions # Kill inactive sessions or wait for completion ./.claude/commands/claude-code-x.sh kill <session-id> # Or cleanup old sessions ./.claude/commands/claude-code-x.sh cleanup
Error: Session times out before completion
Solution:
bash# Increase timeout for complex tasks ./.claude/commands/claude-code-x.sh exec "Complex task" --timeout 1200
Check logs:
bash./.claude/commands/claude-code-x.sh result <session-id>
Common issues:
Track these metrics to evaluate Claude Code X effectiveness:
Target Metrics:
Version: 1.0.0 Created: 2025-10-27 Author: Claude Code (Sonnet 4.5) Status: ✅ Production Ready
Other measured skills in the registry, with their headline benchmark lift.