Use this skill when you need to invoke another Claude Code session via the cli-agent-runner.sh script to perform specialized, potentially long-running tasks in a simplified way. This wrapper handles session management, result extraction, and can be run in background with polling support.
Delegates tasks to background Claude Code sessions using session names instead of IDs. Use this for long-running operations, specialized agent workflows, or when you need to resume work later without managing session IDs.
/plugin marketplace add rawe/claude-dev-skills/plugin install cli-agent-runner@claude-dev-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
cli-agent-runner.shexample/agents/browser-tester/agent.jsonexample/agents/browser-tester/agent.mcp.jsonexample/agents/browser-tester/agent.system-prompt.mdreferences/CLI-AGENT-RUNNER.mdreferences/EXAMPLE-AGENTS.mdThis skill provides guidance on using the cli-agent-runner.sh script to delegate work to Claude Code sessions.
Use this when you need to:
Key Benefits:
.cli-agent-runner/agent-sessions/ directoryarchitect, reviewer)system-architect, security-reviewer)The following variables are used in the commands and instructions:
<session-name>: A unique identifier for the session (alphanumeric, dash, underscore only; max 30 chars)<agent-name>: Optional agent definition to use for the session<initial-prompt>: The prompt or task description for a new session<resume-prompt>: The prompt or task description to continue an existing session's work<POLL_INTERVAL>: The interval in seconds to wait between polling attempts. Default is 60 seconds.IMPORTANT: The cli-agent-runner.sh script is located in the same directory as this SKILL.md file.
So it is in the root folder of the skill plugin.
Before using the script for the first time in a conversation, you MUST locate it:
<path-to-skill-root-folder>/cli-agent-runner.sh
Example:
# Use that exact path in all commands:
<absolute-path-to-cli-agent-runner.sh> new <session-name> -p "<prompt>"
Note: In all examples below, cli-agent-runner.sh represents the absolute path <absolute-path-to-cli-agent-runner.sh> you discovered. Replace it with the actual path when executing commands.
The cli-agent-runner.sh supports five commands:
Use this when you want to wait for the session to complete and get the result immediately.
Creating a new session:
./cli-agent-runner.sh new <session-name> -p "<initial-prompt>"
Creating a new session with an agent:
./cli-agent-runner.sh new <session-name> --agent <agent-name> -p "<initial-prompt>"
Creating a new session with prompt from file/stdin:
This should be considered when the prompt is large or complex or already a prompt file exists potentially created by another session.
cat prompt.md | ./cli-agent-runner.sh new <session-name>
Resuming an existing session:
./cli-agent-runner.sh resume <session-name> -p "<resume-prompt>"
Example:
# Create new session with agent
./cli-agent-runner.sh new architect --agent system-architect -p "Create a high-level architecture document for a user authentication system"
# The script blocks until completion and outputs the result
# Output: <result from session>
# Resume the session later (agent association is remembered)
./cli-agent-runner.sh resume architect -p "Add API endpoint specifications to the architecture"
Use this when you want to start the session in the background and poll for completion.
Instructions:
1. Start the session in the background:
run_in_background: truenew or resume commandExample for new session:
./cli-agent-runner.sh new <session-name> -p "<initial-prompt>"
Example for new session with agent:
./cli-agent-runner.sh new <session-name> --agent <agent-name> -p "<initial-prompt>"
Example for resuming session:
./cli-agent-runner.sh resume <session-name> -p "<resume-prompt>"
2. Initial Polling Wait:
sleep <POLL_INTERVAL>3. Check if background process is still running:
4. Polling Wait Loop:
sleep <POLL_INTERVAL>5. Process Completed - Get Results:
Full Background Example:
# Step 1: Start in background
./cli-agent-runner.sh new architect --agent system-architect -p "Design authentication system"
# Returns bash_id: abc123
# Step 2: Initial wait
sleep 60
# Step 3: Check status
# Use BashOutput with bash_id: abc123
# If status: running, continue to step 4
# If status: completed, read the output - it contains the result
# Step 4: If still running, wait and check again
sleep 60
# Return to step 3
Use this to see all existing sessions and their status.
./cli-agent-runner.sh list
Output format:
session-name (session: session-id)
architect (session: 3db5dca9-6829-4cb7-a645-c64dbd98244d)
reviewer (session: initializing)
Use this to discover what agent definitions are available before creating a session.
./cli-agent-runner.sh list-agents
Output format:
agent-name:
description
---
next-agent-name:
description
---
another-agent-name:
description
Example output:
code-reviewer:
Reviews code for best practices, bugs, and potential improvements
---
documentation-writer:
Creates comprehensive technical documentation and guides
---
system-architect:
Expert in designing scalable system architectures
Use Case:
Important Notes:
--- for clear parsing--agent flag when creating sessionsUse this to remove all sessions and start fresh.
./cli-agent-runner.sh clean
Behavior:
.cli-agent-runner/agent-sessions/ directoryOutput:
All sessions removed
or
No sessions to remove
The script supports flexible prompt input:
-p flag only: ./cli-agent-runner.sh new architect -p "Your prompt here"echo "Your prompt" | ./cli-agent-runner.sh new architectcat file.md | ./cli-agent-runner.sh new architect -p "Context:"Concatenation: If both -p and stdin are provided, they are concatenated with -p content first, then a newline, then stdin content. This is useful for adding context before piping in a file.
IMPORTANT STDIN should be used if it is neccessarry to provide a a large complex promt to the agent or the result of another command output. e.g. tree for listing a directory structure.
Example:
cat requirements.md | ./cli-agent-runner.sh new architect -p "Create an architecture document based on these requirements:"
Results in prompt:
Create an architecture document based on these requirements:
<contents of requirements.md>
All errors are output to stderr and the script exits with code 1:
Session name validation errors:
Session lifecycle errors:
resume insteadnew insteadAgent errors:
Prompt errors:
-p nor stdin)Execution errors:
.cli-agent-runner/agent-sessions/<session-name>.jsonl.cli-agent-runner/agent-sessions/<session-name>.meta.json (tracks agent association).cli-agent-runner/agents/<agent-name>.json (configuration).cli-agent-runner/agents/<agent-name>.prompt.md (system prompt)architect, reviewer, dev-agent, po-agentlist-agents to discover available agents before creating sessions# 1. Discover available agents
./cli-agent-runner.sh list-agents
# Output shows:
# system-architect:
# Expert in designing scalable system architectures
# ---
# code-reviewer:
# Reviews code for best practices, bugs, and potential improvements
# ---
# documentation-writer:
# Creates comprehensive technical documentation and guides
# 2. Create new architect session with agent in background
# Use Bash tool with run_in_background: true
./cli-agent-runner.sh new architect --agent system-architect -p "Create architecture for microservices-based e-commerce system"
# Note bash_id: xyz789
# 3. Wait 60 seconds
sleep 60
# 4. Check if completed using BashOutput with bash_id xyz789
# Status: running
# 5. Wait another 60 seconds
sleep 60
# 6. Check again with BashOutput
# Status: completed
# Output contains the architecture document result
# 7. Later, resume the session for additional work (agent association remembered)
./cli-agent-runner.sh resume architect -p "Add security considerations to the architecture"
# 8. List all sessions to see status
./cli-agent-runner.sh list
# Output: architect (session: 3db5dca9-6829-4cb7-a645-c64dbd98244d)
The cli-agent-runner.sh script must be run from your project root where the .cli-agent-runner/ directory exists or will be created.
If you change directories during your workflow, the script will look for .cli-agent-runner/ relative to your current location and may fail silently.
Example - What NOT to do:
cd .cli-agent-runner/agent-sessions # Changed directory
cli-agent-runner.sh clean # ❌ Returns "No sessions to remove"
# Script looks for: .cli-agent-runner/agent-sessions/.cli-agent-runner/agent-sessions/
Example - Correct approach:
cd /path/to/your/project # ✅ Back to project root
cli-agent-runner.sh clean # ✅ Works correctly
# Script looks for: /path/to/your/project/.cli-agent-runner/agent-sessions/
Best Practice
Always use absolute paths when running the script from non-root directories:
# Safe - works from any directory
cd /path/to/your/project && /path/to/cli-agent-runner.sh clean
# Or explicitly change to project root first
cd "$(git rev-parse --show-toplevel)" && cli-agent-runner.sh clean
Shell Persistence Note
In background shells or long-running terminal sessions, cd commands persist across multiple commands. Always verify your working directory with pwd before running cli-agent-runner.sh
commands.
## Additional Documentation
**Creating Custom Agents**: See `references/EXAMPLE-AGENTS.md` for a complete agent definition example showing how to create agents with JSON configuration, system prompts, and MCP server integration.
**Architecture & Design Details**: See `references/CLI-AGENT-RUNNER.md` for comprehensive documentation on the CLI Agent Runner's architecture, design philosophy, directory structure, and advanced usage patterns.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.