Claude Code Task
/install claude-code-tmux
Coding Agent Task (tmux + worktree)
Run coding tasks by spawning a coding agent in a tmux session + git worktree. Every task gets its own isolated branch and persistent conversation.
Step 0: Determine which agent to use
Check memory first:
memory_search("preferred coding agent tool")
-
If found → use that tool, no need to ask
-
If not found → ask the user:
"Which coding agent should I use? (default: claude) Options: claude, codex, opencode, codebuddy, or any CLI tool name"
Then save the answer to memory:
memory: preferred_coding_agent = \x3Ctool>Write to
MEMORY.mdunder a "Preferences" section.
Default if user doesn't answer: claude
Step 1: Setup worktree
# Always use a worktree — one per task
git -C \x3Cproject> worktree add -b \x3Cbranch> \x3Cworktree-path> main
# Symlink env files
ln -sf \x3Cproject>/.env \x3Cworktree-path>/.env
ln -sf \x3Cproject>/.env.local \x3Cworktree-path>/.env.local # if exists
Step 2: Start tmux session with the chosen agent
tmux new-session -d -s \x3Ctask-name> -c \x3Cworktree-path>
Then launch based on tool:
| Tool | Command |
|---|---|
claude |
claude --dangerously-skip-permissions |
codex |
codex |
opencode |
opencode |
codebuddy |
codebuddy (or check its CLI name) |
| other | use the tool's interactive CLI command |
tmux send-keys -t \x3Ctask-name> "nvm use 20 && \x3Ctool-command>" Enter
Step 3: Send task with plan-first instruction
tmux send-keys -t \x3Ctask-name> -l -- "Your task here.
Before making any changes, show me a plan of what you intend to do and wait for my approval."
sleep 0.1
tmux send-keys -t \x3Ctask-name> Enter
Step 4: Relay plan to user
# Poll for plan output
tmux capture-pane -t \x3Ctask-name> -p | tail -30
When agent outputs a plan → relay it to the user, wait for their confirmation before proceeding.
Relay flow:
- Agent outputs plan → relay to user
- User says "ok" / requests changes → forward to agent
- Agent proceeds → monitor and relay further questions
# Send user's response
tmux send-keys -t \x3Ctask-name> -l -- "\x3Cuser response>"
sleep 0.1
tmux send-keys -t \x3Ctask-name> Enter
# Check if waiting for input
tmux capture-pane -t \x3Ctask-name> -p | tail -10 | grep -E "❯|Yes.*No|proceed|permission|plan|approve"
Step 5: Parallel tasks
Same pattern, multiple sessions:
tmux new-session -d -s task-a -c /tmp/task-a
tmux new-session -d -s task-b -c /tmp/task-b
Check all at once:
for s in task-a task-b; do
echo "=== $s ==="
tmux capture-pane -t $s -p 2>/dev/null | tail -5
done
Step 6: Cleanup
git -C \x3Cproject> worktree remove \x3Cworktree-path> # branch preserved
tmux kill-session -t \x3Ctask-name>
# User can then test in main workspace:
# git switch \x3Cbranch>
Rules
- Check memory first — never ask for tool preference if already saved
- Always use worktrees — one per task, no exceptions
- Always use tmux — persistent session, multi-turn conversation
- Always show plan first, wait for user approval before agent touches files
- Always symlink
.envfiles — don't copy - One status message when starting, one when done or stuck
- See
references/troubleshooting.mdfor common issues
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install claude-code-tmux - After installation, invoke the skill by name or use
/claude-code-tmux - Provide required inputs per the skill's parameter spec and get structured output
What is Claude Code Task?
Run coding tasks using a persistent tmux session with git worktree isolation. Supports multiple coding agents (Claude Code, Codex, CodeBuddy, OpenCode, etc.)... It is an AI Agent Skill for Claude Code / OpenClaw, with 139 downloads so far.
How do I install Claude Code Task?
Run "/install claude-code-tmux" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Claude Code Task free?
Yes, Claude Code Task is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Claude Code Task support?
Claude Code Task is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Claude Code Task?
It is built and maintained by yuanshenstarto (@yuanshenstarto); the current version is v1.2.0.