intern
Delegate tasks to the "intern" agent via ACP. Use when user says "use the intern", "ask the intern", "delegate to the intern", or similar. The intern can read files, write code, run commands, and complete development tasks.
install
source · Clone the upstream repo
git clone https://github.com/smadgerano/Opencode-Intern-Claude-Code-Skill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/smadgerano/Opencode-Intern-Claude-Code-Skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/opencode-intern" ~/.claude/skills/smadgerano-opencode-intern-claude-code-skill-intern && rm -rf "$T"
manifest:
.claude/skills/opencode-intern/skill.mdsource content
Intern
Run the ACP client script to delegate tasks:
<skill-path> is this skills location on disk.
Background Execution (Default)
Tasks run in background by default, returning a task ID immediately:
# Launch task (background is default) python <skill-path>/scripts/acp_client.py "<project_path>" "<prompt>" --json # Returns: {"task_id": "abc123", "status": "launched"} # Check status python <skill-path>/scripts/acp_client.py --status abc123 --json # Get result when complete python <skill-path>/scripts/acp_client.py --result abc123 --json # Wait for completion (blocking) python <skill-path>/scripts/acp_client.py --wait abc123 --json --timeout 600 # List all tasks python <skill-path>/scripts/acp_client.py --list-tasks --json python <skill-path>/scripts/acp_client.py --list-tasks --filter running --json # Cancel a running task python <skill-path>/scripts/acp_client.py --cancel abc123 # Clean up old completed tasks python <skill-path>/scripts/acp_client.py --cleanup
Synchronous Execution
For simple tasks where you want to wait for the result:
python <skill-path>/scripts/acp_client.py "<project_path>" "<prompt>" --sync --json
Parse the JSON result directly. The project_path is usually the current working directory.
Response Format
{ "success": true, "response": "Agent's response text", "tools": [{"name": "bash", "status": "completed"}], "errors": [], "agent_status": "end_turn" }
Agent Status Values
| Status | Meaning |
|---|---|
| Normal successful completion |
| Agent finished and is idle |
| Agent refused to complete the task |
| Session was cancelled |
| Response truncated due to token limit |
| Hit maximum turn limit |
| Agent encountered an error |
| Status not determined |
Task Status Values (Background Mode)
| Status | Meaning |
|---|---|
| Task created, not yet started |
| Task is executing |
| Task finished successfully |
| Task failed with errors |
| Task was cancelled by user |
Parameters
Execution Options
(required for sync): Absolute path to projectproject_path
(required for sync): Task description (max 100KB)prompt
: Agent name (default: intern)--agent
: Overall timeout in seconds (default: 300)--timeout
: Max seconds without activity (default: 120)--activity-timeout
: JSON output (always use this)--json
: Enable debug logging to stderr--debug
: Run task in background (default)--background
: Run task synchronously, wait for completion--sync
Task Management Options
: Check status of a background task--status TASK_ID
: List all background tasks--list-tasks
: Filter tasks by status (pending/running/completed/failed/cancelled)--filter STATUS
: Get the result of a completed task--result TASK_ID
: Cancel a running task--cancel TASK_ID
: Wait for a task to complete--wait TASK_ID
: Remove old completed tasks (>24 hours)--cleanup
Errors
| Error | Fix |
|---|---|
| "OpenCode not found in PATH" | Ensure is installed and in PATH |
| "Overall timeout" | Increase or simplify task |
| "Activity timeout" | Agent may be hung; try simplifying task |
| "Agent process died" | Check opencode installation and logs |
| "Agent error" | Service issue; check opencode auth and API status |
| "Prompt exceeds maximum length" | Prompt is >100KB; break into smaller tasks |
| "Agent refused to complete" | Task may violate agent policies; rephrase |
Features
- Thread-safe request handling: Safe for concurrent operations
- Background task execution: Launch tasks asynchronously, check status later
- Activity timeout detection: Detects hung agents that stop responding
- Process health monitoring: Detects if agent process crashes
- Session cancellation: Properly cancels stuck sessions per ACP protocol
- Error status detection: Detects and reports agent errors
- Debug mode: Enable
for troubleshooting--debug - Partial response capture: Returns partial responses even on failure
- Windows path normalization: Automatically converts
toC:\path
in promptsC:/path
Best Practices
- Always use
for reliable parsing of results--json - Use background mode for tasks >2 minutes to avoid blocking
- Check task status periodically rather than using long timeouts
- Use
when troubleshooting to see protocol messages--debug - Keep prompts focused - delegate one clear task at a time
- Clean up old tasks periodically with
--cleanup