← Back to Plugins
Tools

Plugin Claude Code Tmux

davidguttman By davidguttman 👁 147 views ▲ 0 votes

OpenClaw plugin for interacting with Claude Code in tmux sessions

GitHub

Configuration Example

{
     "plugins": {
       "load": {
         "paths": ["~/clawd/plugins/claude-code-tmux"]
       },
       "entries": {
         "claude-code-tmux": {
           "enabled": true
         }
       }
     },
     "tools": {
       "alsoAllow": [
         "claude_code_create",
         "claude_code_send",
         "claude_code_status",
         "claude_code_list",
         "claude_code_capture",
         "claude_code_kill"
       ]
     }
   }

README

# openclaw-plugin-claude-code-tmux

OpenClaw plugin providing native tools for the complete Claude Code tmux workflow.

## Problem

When sending text to Claude Code via tmux, bracketed paste mode causes text to appear as `[Pasted text #...]` without being processed. Claude Code waits for Enter, which often isn't sent, causing sessions to hang indefinitely.

## Solution

This plugin provides tools that handle all tmux mechanics internally, including automatic Enter key handling and verification that Claude Code started processing. No direct CLI/tmux commands needed.

## Tools

| Tool | Description |
|------|-------------|
| `claude_code_create(session, workdir)` | Create tmux session + launch Claude Code |
| `claude_code_send(session, task)` | Send task, handle Enter automatically, verify processing |
| `claude_code_status(session)` | Check status (PROCESSING/STUCK/IDLE), auto-fix stuck |
| `claude_code_list()` | List all Claude Code sessions with status |
| `claude_code_capture(session, lines?)` | Capture recent output |
| `claude_code_kill(session)` | Kill/cleanup session |

## Full Workflow (No CLI Needed)

```
1. claude_code_create("my-feature-t123", "/path/to/project")
   → Creates tmux session, launches Claude Code, waits for ready

2. claude_code_send("my-feature-t123", "Implement feature X...")
   → Sends task, handles Enter, verifies processing started

3. claude_code_status("my-feature-t123")
   → Check if processing/stuck/idle, auto-fixes stuck

4. claude_code_capture("my-feature-t123", 100)
   → Get recent output

5. claude_code_kill("my-feature-t123")
   → Cleanup when done
```

## Installation

1. Clone to your plugins directory:
   ```bash
   git clone https://github.com/davidguttman/openclaw-plugin-claude-code-tmux ~/clawd/plugins/claude-code-tmux
   ```

2. Add to OpenClaw config (`~/.openclaw/openclaw.json`):
   ```json
   {
     "plugins": {
       "load": {
         "paths": ["~/clawd/plugins/claude-code-tmux"]
       },
       "entries": {
         "claude-code-tmux": {
           "enabled": true
         }
       }
     },
     "tools": {
       "alsoAllow": [
         "claude_code_create",
         "claude_code_send",
         "claude_code_status",
         "claude_code_list",
         "claude_code_capture",
         "claude_code_kill"
       ]
     }
   }
   ```

3. Restart OpenClaw gateway

## License

MIT
tools

Comments

Sign in to leave a comment

Loading comments...