Agent Worktrees Belong in Chat Threads

repoaiagentstelegramcliworktreespiagent-loopsinfrastructure

takopi's Telegram topics plus Git worktree model maps cleanly onto joelclaw's gateway/Pi routing and the build-your-own OpenClaw workshop shape.

takopi is a small Telegram bridge for running agent CLIs like OpenAI Codex, Claude Code, OpenCode, and Pi. It lets you point a bot at projects, branches, and worktrees, then stream progress back into chat.

The clever bit is the mapping: chat thread equals working context. A Telegram topic can bind to a repo or branch, and a branch can run in a dedicated Git worktree. That makes parallel agent work feel less like terminal juggling and more like labeled conversations you can resume from anywhere.

The other useful move is stateless resume. takopi can continue in chat or give you a resume line to paste back into a terminal. That is exactly the kind of seam joelclaw cares about: mobile control when you’re away, terminal control when you’re deep in it, and enough visible progress that the agent isn’t a black box.

Joel called it “a small thing that compliments Pi” and flagged “build your own OpenClaw” as a workshop idea. That feels right: takopi is not trying to be the whole operating system. It is a tight, teachable slice of one: bot, projects, worktrees, progress stream, resume. Small enough to explain. Useful enough to steal from.

Key Ideas

  • takopi turns Telegram into a remote control surface for agent CLIs including OpenAI Codex, Claude Code, OpenCode, and Pi.
  • Project and branch isolation uses Git worktrees, which makes parallel agent sessions safer than stacking everything in one checkout.
  • Telegram forum topics can act as durable repo or branch contexts, which is a nice mental model for routing agent work.
  • Stateless resume lines create a clean handoff between chat and terminal without requiring the chat client to be the source of truth forever.
  • Progress streaming covers commands, tools, file changes, and elapsed time, which gives operators receipts instead of mystery agent vibes.
  • The plugin model exposes engines, transports, and commands through entry points, so the bridge can grow without turning the core into a pile of adapters.
  • File transfer over chat makes the bot useful for quick repo inputs and outputs, not just command dispatch.
  • The “assistant,” “workspace,” and “handoff” workflows are a strong workshop scaffold for teaching how agent control planes differ.