tmux-agents

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Tmux Agents

Tmux Agents

Run coding agents in persistent tmux sessions. They work in the background while you do other things.
在持久化的tmux会话中运行编码Agent。它们会在后台工作,不影响你处理其他事务。

Available Agents

可用的Agent

☁️ Cloud Agents (API credits)

☁️ 云端Agent(需API credits)

AgentCommandBest For
claudeClaude CodeComplex coding, refactoring, full projects
codexOpenAI CodexQuick edits, auto-approve mode
geminiGoogle GeminiResearch, analysis, documentation
Agent命令适用场景
claudeClaude Code复杂编码、代码重构、完整项目开发
codexOpenAI Codex快速编辑、自动批准模式
geminiGoogle Gemini调研、分析、文档撰写

🦙 Local Agents (FREE via Ollama)

🦙 本地Agent(通过Ollama免费使用)

AgentCommandBest For
ollama-claudeClaude Code + OllamaLong experiments, heavy refactoring
ollama-codexCodex + OllamaExtended coding sessions
Local agents use your Mac's GPU — no API costs, great for experimentation!
Agent命令适用场景
ollama-claudeClaude Code + Ollama长期实验、大规模代码重构
ollama-codexCodex + Ollama长时间编码会话
本地Agent使用你的Mac GPU——无需API费用,非常适合实验!

Quick Commands

快速命令

Spawn a new agent session

启动新的Agent会话

bash
./skills/tmux-agents/scripts/spawn.sh <name> <task> [agent]
bash
./skills/tmux-agents/scripts/spawn.sh <name> <task> [agent]

Cloud (uses API credits)

云端(需API credits)

./skills/tmux-agents/scripts/spawn.sh fix-bug "Fix login validation" claude ./skills/tmux-agents/scripts/spawn.sh refactor "Refactor the auth module" codex ./skills/tmux-agents/scripts/spawn.sh research "Research caching strategies" gemini
./skills/tmux-agents/scripts/spawn.sh fix-bug "Fix login validation" claude ./skills/tmux-agents/scripts/spawn.sh refactor "Refactor the auth module" codex ./skills/tmux-agents/scripts/spawn.sh research "Research caching strategies" gemini

Local (FREE - uses Ollama)

本地(免费 - 使用Ollama)

./skills/tmux-agents/scripts/spawn.sh experiment "Rewrite entire test suite" ollama-claude ./skills/tmux-agents/scripts/spawn.sh big-refactor "Refactor all services" ollama-codex
undefined
./skills/tmux-agents/scripts/spawn.sh experiment "Rewrite entire test suite" ollama-claude ./skills/tmux-agents/scripts/spawn.sh big-refactor "Refactor all services" ollama-codex
undefined

List running sessions

列出运行中的会话

bash
tmux list-sessions
bash
tmux list-sessions

or

./skills/tmux-agents/scripts/status.sh
undefined
./skills/tmux-agents/scripts/status.sh
undefined

Check on a session

查看会话状态

bash
./skills/tmux-agents/scripts/check.sh session-name
bash
./skills/tmux-agents/scripts/check.sh session-name

Attach to watch live

附加到会话实时查看

bash
tmux attach -t session-name
bash
tmux attach -t session-name

Detach with: Ctrl+B, then D

断开会话:Ctrl+B,然后按D

undefined
undefined

Send additional instructions

发送额外指令

bash
tmux send-keys -t session-name "additional instruction here" Enter
bash
tmux send-keys -t session-name "additional instruction here" Enter

Kill a session when done

完成后终止会话

bash
tmux kill-session -t session-name
bash
tmux kill-session -t session-name

When to Use Local vs Cloud

本地Agent vs 云端Agent使用场景

ScenarioRecommendation
Quick fix, time-sensitive☁️ Cloud (faster)
Expensive task, budget matters🦙 Local
Long experiment, might fail🦙 Local
Production code review☁️ Cloud (smarter)
Learning/exploring🦙 Local
Heavy refactoring🦙 Local
场景推荐方案
快速修复、时间敏感任务☁️ 云端(速度更快)
高成本任务、预算有限🦙 本地
长期实验、可能失败的任务🦙 本地
生产代码评审☁️ 云端(更智能)
学习/探索🦙 本地
大规模代码重构🦙 本地

Parallel Agents

并行运行Agent

Run multiple agents simultaneously:
bash
undefined
可同时运行多个Agent:
bash
undefined

Mix and match cloud + local

混合使用云端和本地Agent

./scripts/spawn.sh backend "Implement user API" claude # Cloud ./scripts/spawn.sh frontend "Build login form" ollama-codex # Local ./scripts/spawn.sh docs "Write API documentation" gemini # Cloud ./scripts/spawn.sh tests "Write all unit tests" ollama-claude # Local

Check all at once:
```bash
./skills/tmux-agents/scripts/status.sh
./scripts/spawn.sh backend "Implement user API" claude # 云端 ./scripts/spawn.sh frontend "Build login form" ollama-codex # 本地 ./scripts/spawn.sh docs "Write API documentation" gemini # 云端 ./scripts/spawn.sh tests "Write all unit tests" ollama-claude # 本地

一次性查看所有会话状态:
```bash
./skills/tmux-agents/scripts/status.sh

Ollama Setup

Ollama 设置

Local agents require Ollama with a coding model:
bash
undefined
本地Agent需要安装Ollama并配置编码模型:
bash
undefined

Pull recommended model

拉取推荐模型

ollama pull glm-4.7-flash
ollama pull glm-4.7-flash

Configure tools (one-time)

配置工具(仅需一次)

ollama launch claude --model glm-4.7-flash --config ollama launch codex --model glm-4.7-flash --config
undefined
ollama launch claude --model glm-4.7-flash --config ollama launch codex --model glm-4.7-flash --config
undefined

Tips

小贴士

  • Sessions persist even if Clawdbot restarts
  • Use local agents for risky/experimental work
  • Use cloud for production-critical tasks
  • Check
    tmux ls
    to see all active work
  • Kill sessions when done to free resources
  • 即使Clawdbot重启,会话仍会保持
  • 风险/实验性工作使用本地Agent
  • 生产关键任务使用云端Agent
  • 运行
    tmux ls
    查看所有活跃任务
  • 完成后终止会话以释放资源