Jeewon Yang
← All projects
Fun

claude-code-slack

Using a personal Slack workspace and a custom bot to (1) interact with a tmux-resident Claude Code agent, and (2) make stateless Claude API calls for ad-hoc tasks.

↗ Visit

Using a personal Slack workspace and a custom Slack bot to (1) control a Claude Code agent running in a server’s tmux session, and (2) make direct Anthropic API calls to the Claude model — independent of the tmux session — for one-off tasks and questions.

A brief overview of entire framework

Detailed Explanation

Two Ways the Bot Talks to Claude

This bot uses a personal Slack workspace and a custom Slack app to interact with Claude through two completely separate paths. Understanding the distinction matters — they behave differently and are useful for different things.

(1) Claude Code in a tmux session — via /tmux-connect

(2) Direct Anthropic API calls — via /claude and ? <question>

Why the distinction matters in practice

Inside a /tmux-connect thread, if you type:

? How far along is the experiment?

the bot strips the ?, sends "How far along is the experiment?" to the Claude API, and that’s all the API sees. No terminal output, no logs, no project context. Claude will reasonably answer something like “I don’t have any information about that experiment.”

If instead you type the same thing without the ?:

How far along is the experiment?

the bot forwards those keystrokes straight into the tmux session. The Claude Code agent running there receives the question with all of its running context (scripts, logs, open files) and can give a real, grounded answer.

One-line summary

The bot lets you (1) interact with a tmux-resident Claude Code agent that retains full session state, and (2) make stateless Claude API calls for ad-hoc tasks and questions — independent of the tmux session.