claude-tmux-bridge
Manages persistent tmux sessions for Claude Code, allowing real-time observation and automatic session creation per project.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-tmux-bridgeRefactor the utility functions in /Users/me/my-project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Code MCP — tmux Bridge
An MCP server that connects Claude Desktop to an interactive Claude Code session running in a tmux terminal. Instead of spawning a one-shot process per prompt, it communicates with a persistent, visible session — so you can watch Claude work in real time while Desktop orchestrates the tasks.
How It Works
Claude Desktop → claude_code MCP tool → tmux session → Claude Code (interactive)
(this repo)Claude Desktop holds your project context, design decisions, and task history. It generates prompts and knows what needs to be done next.
Claude Code runs interactively in a tmux terminal you can watch. It has access to all your configured MCP tools and retains full conversation history between calls.
This server is the pipe between them — it delivers Desktop's prompts to Code's session and brings the response back.
Related MCP server: codex-cli-mcp-tool
Requirements
macOS
Node.js v20 or later
tmux —
brew install tmuxClaude Code CLI —
npm install -g @anthropic-ai/claude-code
Setup
1. Install this server
git clone https://github.com/DaRealDaHoodie/claude-tmux-bridge.git
cd claude-tmux-bridge
npm install
npm run build2. Configure Claude Desktop
Add this server to your Claude Desktop MCP config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"claude-tmux-bridge": {
"command": "node",
"args": ["/path/to/claude-tmux-bridge/dist/server.js"]
}
}
}Restart Claude Desktop after saving.
Using the Tool
Once configured, Claude Desktop has access to the claude_code tool. When sending a prompt tell Desktop:
What to do — the task or question for Claude Code
Which project — pass
workFolderas the absolute path to your project directory
Example instruction to Desktop:
Use the claude_code tool with workFolder
/Users/you/my-projectand ask Claude Code to implement the feature we just designed.
Everything else is automatic — the tmux session and Claude Code instance are created on first use.
Session Naming
The tmux session name is derived from your project folder's basename:
workFolder | Session name |
|
|
|
|
(not provided) |
|
Watching Claude Work
Sessions run in the background automatically. Attach any time to watch:
tmux attach -t claude-my-project
# Detach with Ctrl+B DTool Parameters
Parameter | Type | Required | Description |
| string | yes | The prompt to send to Claude Code |
| string | no | Absolute path to project — determines the session |
| number | no | Max seconds to wait for a response (default: 300) |
Behaviour
Session not found — auto-creates the tmux session rooted at
workFolderClaude Code not running — auto-launches
claudein the session and waits up to 30s for it to be readySession busy — rejects with a "still busy" message; does not queue
Timeout — auto-recovers on next call by checking if Claude has since finished
Conversation history — fully preserved between calls (same interactive session)
Environment Variables
Variable | Default | Description |
|
| Set to |
|
| Wait after sending prompt before polling starts |
|
| How often to poll the pane for output changes |
|
| Fallback: ms of no change before declaring done |
|
| Max ms to wait for Claude Code to start up |
Multiple Projects
Each project gets its own named tmux session. You can have multiple sessions open simultaneously — just pass the correct workFolder and Desktop will target the right one.
License
MIT
Available Tools
1 toolclaude_codeA
Send a prompt to an interactive Claude Code session running in a tmux terminal.
Sessions and Claude Code are started automatically if not already running. The user can attach to the session at any time to watch Claude work: tmux attach -t {session-name}
SESSION NAMING: workFolder /Users/you/my-roblox-game → session: claude-my-roblox-game No workFolder → session: claude-code
BEHAVIOUR: • If the tmux session doesn't exist it is created automatically. • If Claude Code isn't running in the session it is started automatically. • Only one prompt at a time per session — concurrent calls return a busy error. • Conversation history is fully preserved between calls. • Claude Code has access to all configured MCP tools (Roblox Studio, Godot, Blender, etc.).
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | The prompt to send to the Claude Code session. | |
| compact | No | Send /compact to the Claude Code session before delivering the prompt. Summarises conversation history via the Claude API, keeping key context while freeing up space. Use when context is growing but continuity still matters. Slower than clearContext (30–60s). If both are set, compact takes precedence. | |
| timeout | No | Max seconds to wait for a response (default: 300). | |
| workFolder | No | Absolute path to the project folder. Determines the tmux session name and sets the working directory when creating a new session. E.g. /Users/foo/my-project → session "claude-my-project". | |
| clearContext | No | Send /clear to the Claude Code session before delivering the prompt. Wipes conversation history entirely — use when starting a new major feature, a new work session, or when Claude Code warns about large context. Fast (< 1s). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It excels: auto-start behavior, busy error on concurrent calls, full conversation history preservation, MCP tool access, and session naming rules are all clearly disclosed. This gives the agent a robust understanding of side effects and constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with clear sections (SESSION NAMING, BEHAVIOUR) and bullet points. Each sentence carries useful information without redundancy. It is appropriately sized for the tool's complexity, front-loading the core purpose, and every line earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers a wide range of context: session naming, auto-start, concurrency, history, and MCP access. However, it does not specify the return value shape (e.g., whether it returns the full Claude response or just a status), which would be valuable given the absence of an output schema. This is a minor gap in an otherwise thorough description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema itself already documents all parameters in detail, including use cases for compact and clearContext. The main description adds only session naming context, which is also present in the workFolder parameter description. The description provides no significant semantic value beyond what the schema offers, matching the baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb+resource statement: 'Send a prompt to an interactive Claude Code session running in a tmux terminal.' It clearly identifies the tool's function and scope. Even without siblings to distinguish from, the purpose is unambiguous and detailed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context on when the tool should be used, including automatic session creation and the concurrency limitation. It doesn't explicitly name alternatives (no sibling tools exist), but parameter descriptions for compact and clearContext offer strong usage guidance for choosing between them, effectively covering the when/when-not aspect.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Only one tool exists, so there is no possibility of confusion between tools. The single tool's purpose is crystal clear.
With only one tool, naming consistency is trivially maintained. The name 'claude_code' accurately reflects its function.
One tool feels thin for a bridge server, but it does encapsulate the core operation. A more complete set might include session management tools.
The tool covers the primary use case of sending prompts and implicitly handles session startup. Minor gaps like explicit session listing or termination exist.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that bridges Claude Desktop and Claude Code by letting Desktop read and interact with Claude Code Remote Control sessions, enabling cross-agent coordination.63MIT
- AlicenseNot gradedqualityFmaintenanceAn MCP server that allows Claude Code to interact with the OpenAI Codex CLI.2921MIT
- AlicenseAqualityCmaintenanceAn MCP server that gives orchestrator agents fine-grained control over interactive Claude Code sessions running inside tmux, enabling mid-session steering, interruption, and token-efficient result extraction.15MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows Claude Desktop to remotely control Claude Code instances for executing commands and managing files.30GPL 3.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PiMPStudios/claude-tmux-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server