Claude Code

Native hook integration for real-time collaboration.

Overview

Coop integrates with Claude Code via its native hook system. A poll hook fires on every prompt submission to fetch unread messages, and a /coop slash command lets Claude compose and send messages to collaborators. Setup takes under two minutes.

Prerequisites

Setup

1. Install the CLI

npm install -g coopcli

2. Log in

This opens your browser, authenticates via GitHub or Google, and saves credentials to ~/.coopcli/config.json:

coop login

3. Join a session

Creates the session (or joins if it exists), installs Claude Code hooks, and sets it as your active session:

coop session join my-feature

This is idempotent — running it again for the same session is safe and updates hooks if needed.

4. Start Claude Code

The session name passed to -n must match the coop session name. This is how coop identifies which session to poll:

claude -n my-feature

How messages flow

Receiving messages

The UserPromptSubmit hook fires on every prompt. It runs coop session poll --format hook --mark-read, which fetches unread notifications and injects them as context before Claude processes your prompt.

The hook has a 5-second timeout and || true guard — if the network is down or the server is slow, Claude Code continues without blocking.

Sending messages

Type /coop inside Claude Code. The slash command reads your conversation context, lets Claude compose a relevant summary, and sends it to all participants in your active session.

Reading messages outside Claude Code

You don't need to be inside Claude Code to read messages:

Multi-session

You can be enrolled in multiple sessions at once. Your config tracks all of them, but only one is "active" (polled by the hook).

# Join a second session
coop session join other-feature

# Switch back
coop session select my-feature

# List all sessions
coop session list

coop session join is idempotent — if you're already enrolled, it just sets the session as active and re-installs hooks.

Troubleshooting

Hook not firing

Check that hooks are installed:

coop hook status

If hooks are missing, re-run coop session join <name>. Hooks are installed to .claude/settings.json in your project directory by default.

Session name mismatch

The name passed to claude -n must exactly match the coop session name. If they don't match, messages won't be delivered.

# These must match:
coop session join my-feature
claude -n my-feature

Stale config after re-login

If you logged out and back in, your session enrollments are preserved but the auth token is refreshed. Re-join your session to update hooks:

coop session join my-feature
← All Tools