Channels
Claude Max For Openclaw
๐ 100-line OpenClaw plugin: use your Claude Max/Pro subscription with OpenClaw by bridging chat โ tmux. Anthropic won't sell an OpenClaw API add-on โ here's a free workaround. (For serious use โ Enderfga/openclaw-claude-code)
Configuration Example
{
"plugins": {
"entries": {
"tmux-passthrough": { "enabled": true }
},
"allow": [
"tmux-passthrough"
]
}
}
README
# ๐ claude-max-for-openclaw
> **The Claude Max / Pro subscription doesn't work with OpenClaw.** Anthropic's subscription is bound to the terminal Claude Code CLI โ it won't route through OpenClaw's API layer. So heavy OpenClaw users end up paying Anthropic twice (subscription for Claude Code + API credits for OpenClaw), or downgrading OpenClaw to free Gemini / Copilot tier.
>
> **This is a 100-line workaround.** Instead of fighting the subscription model, lean into it: run Claude Code normally in tmux under your Max subscription, install this plugin, and OpenClaw can now poke at it over a `โ๏ธ` prefix from any chat channel. Two processes, one thin bridge. Your subscription is fully used, your OpenClaw stays on whatever cheap model you want for routing, and you control both from your phone.
>
> Think of it as: **Anthropic won't sell you an OpenClaw-compatible API add-on โ so here's one for free.**
---
## โ ๏ธ Looking for the serious version? โ [`openclaw-claude-code`](https://github.com/Enderfga/openclaw-claude-code)
**This repo is the weekend hack.** ~100 lines, one evening, zero maintenance. It works, but it's deliberately minimal.
**If you actually want to use Claude Code through OpenClaw for day-to-day development**, go to my main project:
> ### ๐ [**Enderfga/openclaw-claude-code**](https://github.com/Enderfga/openclaw-claude-code)
>
> A proper programmable bridge that turns Claude Code (and other coding CLIs) into a headless, agentic engine โ persistent sessions, multi-engine orchestration, multi-agent council, dynamic runtime control. That's where the real work lives.
The repo you're looking at right now is for people who:
- Just want their phone to be able to say "hey Claude, check on my training run"
- Don't need agent teams, orchestration, or production features
- Want to read 100 lines and understand everything
If that's you, read on. Otherwise, โฌ๏ธ click the link above.
---
An [OpenClaw](https://openclaw.ai) plugin that intercepts messages prefixed with `โ๏ธ` and routes them directly into tmux via `tmux send-keys`. Pair it with a long-running [Claude Code](https://claude.com/claude-code) session (or aider, or your own REPL), and you can poke it from your phone while you're out for coffee.
---
## ๐ธ The setup (why this exists)
```
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ OpenClaw โ โ tmux session "dev" โ
โ (routing + channels) โ โ Claude Code (--dangerously- โ
โ โ โ๏ธ โ skip-permissions) โ
โ Runs on cheap/free โโโโโโโโถ โ โ
โ models โ just needs โ โ Runs on your Max/Pro โ
โ to route, not think โ โ subscription โ does the โ
โ โโโโpushโโ actual work โ
โโโโโโโโโโโโฒโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โ๏ธdev:fix the failing test โ replies via
โ โ openclaw message send
โ โผ
โโโโโโโโโโโโโ your phone โโโโโโโโโโโโ
(WeChat / Telegram / โฆ)
```
**What you get:**
- **OpenClaw** handles chat channels, mailbox polling, cron reminders, email triage โ cheap-model territory, model doesn't need to be smart, just has to route.
- **Claude Code** in tmux does the real dev work โ your subscription is **fully utilized**, nothing wasted.
- **This plugin** (`โ๏ธ` prefix, ~100 lines) bridges them. Inbound: `โ๏ธdev:<task>` โ keystrokes into Claude Code's stdin. Outbound: Claude Code pushes replies through OpenClaw's outbound API.
---
## How it works
```
phone/desktop chat app
โ user sends: โ๏ธmybox:what's the training loss?
โผ
OpenClaw gateway โโ[before_dispatch hook]โโโถ claude-max-for-openclaw plugin
โ
โโ strips โ๏ธ prefix
โโ parses session + body
โโ tmux send-keys -t mybox -l -- "[weixin] what's the training loss?"
โ
โผ
tmux session "mybox"
(Claude Code / agent / human reads stdin)
โ
โผ
agent replies via chat channel's outbound API
โ
โผ
user's phone chat
```
Key properties:
- **Zero-token routing.** The `before_dispatch` hook short-circuits the normal LLM dispatch and replies directly.
- **Channel tag preserved.** When dispatching to tmux, the message is prefixed with `[<channel>]` (e.g. `[weixin]`, `[telegram]`) so the receiver can tell where the question came from.
- **Reply is out-of-band.** The plugin only handles **inbound**. The receiver (your agent) uses the channel's own outbound API to reply โ otherwise stdout never makes it back to your phone.
## Install
1. **Clone** into your OpenClaw extensions directory (the plugin's internal `id` is `tmux-passthrough`):
```bash
cd ~/.openclaw/extensions/
git clone https://github.com/Enderfga/claude-max-for-openclaw.git tmux-passthrough
```
2. **Register** in `~/.openclaw/openclaw.json`:
```jsonc
{
"plugins": {
"entries": {
"tmux-passthrough": { "enabled": true }
},
"allow": [
"tmux-passthrough"
]
}
}
```
3. **Restart** the OpenClaw gateway:
```bash
# macOS (launchd)
launchctl kickstart -k gui/$(id -u)/ai.openclaw.gateway
# or whatever your platform uses
```
4. **Verify** the plugin loaded โ the gateway log should show it in the ready line:
```
[gateway] ready (N plugins: ..., tmux-passthrough, ...)
```
5. **Start your Claude Code session in a named tmux window** with bypass permissions:
```bash
tmux new -s dev
claude --dangerously-skip-permissions
```
## Usage
Send these from any chat channel OpenClaw is connected to:
| Message | Effect |
|---------|--------|
| `โ๏ธls` | List tmux sessions. Reply goes back to the same chat channel. |
| `โ๏ธls -a` / `โ๏ธinfo` | Full `tmux info` output. |
| `โ๏ธhelp` / `โ๏ธ?` | Show help. |
| `โ๏ธ<session>:<message>` | Inject `[<channel>] <message>` into session. Colon separator. |
| `โ๏ธ<session> <message>` | Same, space separator. |
Examples:
```
โ๏ธls
โ โ๏ธ tmux sessions:
dev: 1 win, attached, last=...
worker-1: 1 win, detached, last=...
โ๏ธdev:what's the training loss right now?
โ โ๏ธ Delivered to session "dev". Reply will come through weixin's outbound channel.
โ (a moment later, your Claude Code in "dev" reads "[weixin] what's the training loss right now?"
from stdin, checks the logs, and pushes a reply back via openclaw message send)
```
## ๐ The reply pattern
**The plugin only handles one direction.** If the thing inside your tmux session wants to answer you, it needs to call your chat channel's outbound API itself.
**Why it's designed this way:** stdout inside tmux does not route to your chat channel. Even if the agent types `"the loss is 0.21"`, that just lands in its own terminal โ your phone will never see it. The agent must explicitly push.
### Example: teaching an agent to reply
Tell your agent (via its system prompt, CLAUDE.md, skill, etc.) something like:
> When you receive a message starting with `[<channel>]` (e.g. `[weixin] ...`, `[telegram] ...`), the user is messaging you remotely from that channel. They cannot see tmux stdout. You must reply using that channel's outbound API.
>
> For channel `weixin` (OpenClaw):
> ```bash
> openclaw message send \
> --channel openclaw-weixin \
> --account <YOUR_ACCOUNT_ID> \
> -t "<YOUR_RECIPIENT_ID>" \
> -m "the loss is 0.21, still converging"
> ```
>
> For channel `telegram`:
> ```bash
> openclaw message send --channel telegram -t "<chat_id>" -m "..."
> ```
>
> Keep replies short โ the user is reading on their phone.
See [`examples/claude-code-skill.md`](./examples/claude-code-skill.md) for a drop-in Claude Code skill template.
### Channel label
The plugin extracts a short label from the gateway's channel name:
| Gateway channel | Label used in prefix |
|-----------------|---------------------|
| `openclaw-weixin` | `weixin` |
| `openclaw-whatsapp` | `whatsapp` |
| `telegram-bot:1234` | `telegram` |
| `discord` | `discord` |
| (unknown / empty) | `inbound` |
## Security considerations
โ ๏ธ **This plugin is a remote-code-execution vector by design.** Anyone who can send a message to a channel OpenClaw is listening on can inject keystrokes into your tmux sessions.
Before enabling:
- Treat every chat channel like a shell prompt on your laptop.
- Lock down your OpenClaw channels to trusted accounts only (per-channel ACLs are a gateway concern, not this plugin's).
- Don't paste secrets into `โ๏ธsession:msg` โ they go verbatim into the session.
- **If you run Claude Code with `--dangerously-skip-permissions`, remember that `โ๏ธ` now gives your phone the same bypass.** Worth it for convenience, but know what you signed up for.
## Requirements
- **OpenClaw** gateway (any version with the `before_dispatch` hook โ 2026.3+).
- **tmux** installed and on `PATH`.
- One or more chat channels wired into OpenClaw (WeChat, WhatsApp, Telegram, Discord, Slack, โฆ).
No other runtime deps โ pure Node.js `node:child_process`.
## Status
**This is a one-shot release. I'm not maintaining it.**
It's ~100 lines, MIT-licensed, and simple
... (truncated)
channels
Comments
Sign in to leave a comment