claude-in-tmux

Run Claude Code CLI inside tmux sessions within Docker containers. Use this skill when the user wants to run Claude Code in a tmux session, check running tmux sessions, read logs from tmux sessions, or manage claude.sh wrapper script in OpenClaw agent containers.

506 stars

Best use case

claude-in-tmux is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Run Claude Code CLI inside tmux sessions within Docker containers. Use this skill when the user wants to run Claude Code in a tmux session, check running tmux sessions, read logs from tmux sessions, or manage claude.sh wrapper script in OpenClaw agent containers.

Teams using claude-in-tmux should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/claude-in-tmux/SKILL.md --create-dirs "https://raw.githubusercontent.com/xiaotianfotos/skills/main/claude-in-tmux/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/claude-in-tmux/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How claude-in-tmux Compares

Feature / Agentclaude-in-tmuxStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Run Claude Code CLI inside tmux sessions within Docker containers. Use this skill when the user wants to run Claude Code in a tmux session, check running tmux sessions, read logs from tmux sessions, or manage claude.sh wrapper script in OpenClaw agent containers.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Claude-in-Tmux

在 OpenClaw Agent 容器中使用 tmux 运行 Claude Code CLI,实现后台任务执行和日志追踪。

## 核心功能

- 在 tmux session 中后台运行 Claude Code
- 自动记录日志到 `/tmp/tmux-logs/`
- 支持读取运行中的 session 日志
- 支持指定 session 名称便于管理
- 支持多种国内模型供应商(Kimi、MiniMax、智谱 GLM-5)

## 支持的模型
可以根据需要添加供应商

| 简写 | 供应商 | 说明 |
|------|--------|------|
| `glm5` | 智谱 GLM-5 | https://www.z.ai/ |
| `minimax` | MiniMax M2.5 | https://www.minimaxi.com/ |
| `kimi` | Kimi K2.5 | https://platform.moonshot.cn/ |

## 快速开始

### 1. 初始化配置

首次使用前,请阅读 `README_for_Openclaw.md` 完成初始化:

1. 安装 Claude Code: `curl -fsSL https://claude.ai/install.sh | bash`
2. 安装 tmux
3. 复制 `claude.sh.template` 为 `claude.sh`
4. 配置你的 API Key

### 2. 使用方法

```bash
# 后台运行任务(必需指定 -p 提示词)
./claude.sh -m glm5 -p "检查代码中的bug"

# 指定会话名称
./claude.sh -m minimax -p "优化性能" -s task-001

# 读取日志
./claude.sh -l
./claude.sh -l -s task-001

# 附加到运行中的会话
tmux attach -t claude-task-001
```

## 日志位置

```
/tmp/tmux-logs/<session>-<timestamp>.log
```

例如:`/tmp/tmux-logs/task-001-1710654315.log`

## 常用命令

```bash
# 查看所有会话
tmux list-sessions

# 检查 Claude 运行状态
tmux list-sessions | grep "^claude-"

# 读取最新日志
tail -n 50 /tmp/tmux-logs/claude-*.log

# 结束会话
tmux kill-session -t claude-task-001
```

## 文件说明

| 文件 | 说明 |
|------|------|
| `claude.sh.template` | 配置模板,包含占位符 |
| `claude.sh` | 你的配置文件(从模板复制) |
| `README_for_Openclaw.md` | 详细的初始化指南 |

## 技术细节

- 工作目录: 当前目录(可通过 `CLAUDE_WORKSPACE` 配置)
- 运行用户: 建议使用非 root 用户
- Claude Code: 自动检测(需确保在 PATH 中)
- 必须环境变量: `HOME`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`

## 更多信息

详见 `README_for_Openclaw.md` 获取完整的配置指南和故障排除。

Related Skills

video-understand 技能

506
from xiaotianfotos/skills

## 概述

tutor

506
from xiaotianfotos/skills

一对一辅导老师技能,用于解答数学题,生成HTML讲解文档和带配音的Manim动画视频。 核心工作流:数学分析 → HTML可视化 → 分镜脚本 → TTS音频 → 验证更新 → 脚手架 → Manim代码 → 渲染验证 触发条件:学生粘贴数学题图片、需要教学视频、需要HTML讲解资料

dlna

506
from xiaotianfotos/skills

Control DLNA MediaRenderer devices. Discover devices and play media URLs on DLNA-compatible TVs, speakers, and media players. Supports default device configuration.

ffuf-claude-skill

31392
from sickn33/antigravity-awesome-skills

Web fuzzing with ffuf

claude-win11-speckit-update-skill

31392
from sickn33/antigravity-awesome-skills

Windows 11 system management

claude-scientific-skills

31392
from sickn33/antigravity-awesome-skills

Scientific research and analysis skills

claude-code-guide

31392
from sickn33/antigravity-awesome-skills

To provide a comprehensive reference for configuring and using Claude Code (the agentic coding tool) to its full potential. This skill synthesizes best practices, configuration templates, and advanced usage patterns.

claude-ally-health

31392
from sickn33/antigravity-awesome-skills

A health assistant skill for medical information analysis, symptom tracking, and wellness guidance.

afrexai-claude-code-production

3891
from openclaw/skills

Complete Claude Code productivity system — project setup, prompting patterns, sub-agent orchestration, context management, debugging, refactoring, TDD, and shipping 10X faster. Zero scripts needed.

ask-claude

3891
from openclaw/skills

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Coding & Development

claude-to-im

1768
from op7418/Claude-to-IM-skill

Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the user can chat with Claude from their phone. Use for: setting up, starting, stopping, or diagnosing the claude-to-im bridge daemon; forwarding Claude replies to a messaging app; any phrase like "claude-to-im", "bridge", "消息推送", "消息转发", "桥接", "连上飞书", "手机上看claude", "启动后台服务", "诊断", "查看日志", "配置". Subcommands: setup, start, stop, status, logs, reconfigure, doctor. Do NOT use for: building standalone bots, webhook integrations, or coding with IM platform SDKs — those are regular programming tasks.

DevOps & Infrastructure

tmux

37131
from HKUDS/nanobot

Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.