Skip to main content

Chicane — When Claude Code can't go straight, take the chicane. A Slack bridge for Claude Code.

Project description

Chicane

When Claude Code can't go straight, take the chicane.

A Slack bridge for Claude Code — send coding tasks from Slack, get results back.

Why "Chicane"?

In motorsport, a chicane is a sequence of tight turns that forces drivers off the straight line — an engineered detour that still gets you to the finish. When you can't go straight to your Claude Code session (you're away from your desk, on your phone, or want your team involved), Chicane is the engineered path through Slack. The session continues, the context is preserved, you just took a different route.

How it works

Slack (Socket Mode) → Chicane → Claude Agent SDK
                    ← streaming events ←

Each Slack thread gets its own Claude Code session. The session persists for the life of the thread, so follow-up messages have full context. If the bot restarts, it reconnects to existing threads by scanning thread history or resuming via session IDs.

Prerequisites

  • Python 3.11+
  • Claude Code installed and authenticated (the SDK reads your existing credentials)
  • A Slack workspace where you can create apps

Installation

pip install chicane

Or install from source:

git clone https://github.com/dinnyosz/chicane.git
cd chicane
pip install -e .

Setup

The fastest way to get started is the guided setup wizard:

chicane setup

This walks you through creating a Slack app, getting your tokens, and writing the .env file — all in one step. Run it again any time to update your config.

Alternatively, you can set things up manually:

1. Create a Slack app

Follow the Slack app setup guide to create and install a Slack app. You'll need the Bot Token (xoxb-...) and App-Level Token (xapp-...).

2. Configure environment variables

Chicane reads its .env from the platform config directory:

  • macOS: ~/Library/Application Support/chicane/.env
  • Linux: ~/.config/chicane/.env (or $XDG_CONFIG_HOME/chicane/.env)

You can create it manually:

# macOS
mkdir -p ~/Library/Application\ Support/chicane
cat <<'EOF' > ~/Library/Application\ Support/chicane/.env
SLACK_BOT_TOKEN=xoxb-your-bot-token
SLACK_APP_TOKEN=xapp-your-app-token
EOF

Or just run chicane setup — it writes the file to the correct location for you.

See Configuration reference for all options.

3. Start the bot

chicane run

Usage

  • @mention in a channel@Chicane refactor the auth module starts a new session in a thread
  • DM the bot — send a message directly, no @mention needed
  • Thread follow-ups — reply in the thread to continue the conversation with full context
  • Reconnect after restart — Chicane automatically picks up existing threads when it restarts

Handoff & MCP

Chicane supports handing off sessions between Claude Code on your desktop and Slack, and sending messages to Slack channels directly from Claude Code.

MCP server (recommended)

Chicane ships with an MCP server that exposes chicane_handoff and chicane_send_message as tools Claude Code can call natively — no shell scripts or skills needed.

If you installed from PyPI:

claude mcp add chicane -- chicane-mcp

For development (pip install -e .):

A separate chicane-mcp-dev binary is provided so it can coexist with a PyPI-installed chicane-mcp:

claude mcp add chicane-dev -- chicane-mcp-dev

Once added, Claude Code discovers the tools automatically. You can say "hand this off to Slack" or "send a message to the team" and Claude will use the MCP tools.

Tools:

Tool Description
chicane_handoff Hand off the current session to Slack. Auto-detects session ID and channel from cwd.
chicane_send_message Send a message to a Slack channel. Channel auto-resolved from cwd via CHANNEL_DIRS.
chicane_init Install the Chicane skill and optionally auto-allow tools in settings.local.json.

CLI handoff

You can also hand off sessions via the CLI directly:

chicane handoff --summary "Refactoring the auth module, tests passing"

The session ID is auto-detected from Claude Code's history. The channel is resolved from your current working directory via the CHANNEL_DIRS mapping. When someone replies to the handoff message in Slack, Chicane resumes that exact Claude Code session with all prior context.

CLI reference

chicane <command> [options]
Command Description
setup Guided setup wizard (creates/updates .env)
run Start the Slack bot
handoff Post a handoff message to Slack
help Show help message

chicane setup

Interactive setup wizard. Walks through creating a Slack app, collecting tokens, and writing .env. If a .env already exists, current values are shown as defaults — just press Enter to keep them.

chicane run

Starts the Slack bot. Connects via Socket Mode and listens for messages.

chicane handoff

Flag Required Description
--summary Yes Summary text for the handoff message
--session-id No Claude session ID (auto-detected from ~/.claude/history.jsonl if omitted)
--channel No Slack channel name (auto-resolved from cwd via CHANNEL_DIRS if omitted)
--cwd No Working directory to resolve channel from (defaults to $PWD)
--questions No Open questions to post as a thread reply

Configuration reference

All configuration is via environment variables, loaded from the .env file in the platform config directory.

Variable Required Default Description
SLACK_BOT_TOKEN Yes Slack Bot User OAuth Token (xoxb-...)
SLACK_APP_TOKEN Yes Slack App-Level Token (xapp-...) with connections:write scope
BASE_DIRECTORY No Default working directory for Claude sessions
ALLOWED_USERS No (all users) Comma-separated Slack user IDs that can use the bot
CHANNEL_DIRS No Map channels to directories. Simple: magaldi,frontend (name = dir under BASE_DIRECTORY). Custom: web=frontend,infra=/opt/infrastructure
CLAUDE_MODEL No SDK default Claude model override (e.g. sonnet, opus)
CLAUDE_PERMISSION_MODE No acceptEdits Permission mode (acceptEdits, dontAsk, bypassPermissions)
CLAUDE_ALLOWED_TOOLS No Comma-separated tool rules (e.g. Bash(npm run *),Read)
CLAUDE_DISALLOWED_TOOLS No Comma-separated tools to disallow
CLAUDE_SETTING_SOURCES No user,project,local Which settings to load (user, project, local)
CLAUDE_MAX_TURNS No Maximum agentic turns per request
CLAUDE_MAX_BUDGET_USD No Maximum spend per request in USD
RATE_LIMIT No 10 Max messages per user per minute
VERBOSITY No verbose Notification level (minimal, normal, verbose)
LOG_DIR No Directory for log files (required for --detach mode)
LOG_LEVEL No INFO Log level (DEBUG, INFO, WARNING, ERROR)
CHICANE_CONFIG_DIR No Platform default Override the config directory path

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chicane-0.1.1.tar.gz (365.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chicane-0.1.1-py3-none-any.whl (61.9 kB view details)

Uploaded Python 3

File details

Details for the file chicane-0.1.1.tar.gz.

File metadata

  • Download URL: chicane-0.1.1.tar.gz
  • Upload date:
  • Size: 365.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chicane-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ac0a7fa36eb37279aad0142b84fd948bbbe0c0381b12f50b31e0faed65c991f
MD5 14108eef18a2c88869371d6af75f734b
BLAKE2b-256 ddc8812a5494d5bb14d342de2261fd68e097f7922510fff5c87b02b21bd6b782

See more details on using hashes here.

Provenance

The following attestation bundles were made for chicane-0.1.1.tar.gz:

Publisher: publish.yml on dinnyosz/chicane

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chicane-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chicane-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 61.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for chicane-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90b107eb779c25c22721a3eb4217bad11f006d6dda69c5eb49040b2acafcbaa2
MD5 77e82f042e2710cccb52b46596c0d755
BLAKE2b-256 5ed636c0d3be7bd2af27c772c7b491bf86ae36956c1967cac290302475d187b6

See more details on using hashes here.

Provenance

The following attestation bundles were made for chicane-0.1.1-py3-none-any.whl:

Publisher: publish.yml on dinnyosz/chicane

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page