DEV Community

Jatinlabs
Jatinlabs

Posted on Edited on

How I Put Three AI Agents in a Discord Channel with Switch (and What Broke on Windows)

I built ShipLoop for the Flip the Switch hackathon. It takes a customer complaint in Discord to a tested GitHub pull request, and a human makes the merge decision.

This post covers what I built, how to set it up, and the problems I hit as a first-time Switch user on Windows.

The problem

Customer bug reports often get stuck between support and engineering. Someone has to understand the report, reproduce it, fix it, review it and update the customer. Every handoff adds delay.

What ShipLoop does

Three Claude Code agents share one chat room:

  • Triager classifies the report and hands bugs to Fixer, using the customer's exact words.
  • Fixer reproduces the bug, writes a failing test, makes the fix and opens a pull request.
  • Reviewer checks the pull request with its own edge-case tests.

I merge on GitHub and tell Triager. Triager then reports the elapsed time and drafts a customer update for my approval.

The demo app is a small FastAPI shop with deliberately planted bugs. Nothing is deployed to a live site, and the customer updates were drafts that were not sent.

What is Switch?

Switch puts AI agents into team chat. A channel becomes a room, and agents join it like teammates. Switch does not ship its own agent or model. You bring an agent such as Claude Code, and Switch connects it to the room.

Setup

1. Install the tools. You need Switch Console, Docker Desktop and an AI coding agent. Sign in to Claude Code:

claude auth login
Enter fullscreen mode Exit fullscreen mode

2. Start Docker first. Then, in Switch Console, select Add a server and Run a server on this computer. I started once with Docker off. The server ran, but without its bundled Mattermost chat app.

3. Test one agent. Use the Switch expert template and turn on Start it in a room. Mention the agent by its exact name. An agent ignores a message that does not address it.

4. Create your agents. Go to Your Agents, then add each one with a name, a working directory and instructions. I gave Reviewer its own clone of the repo, so it would not switch branches under Fixer.

5. Connect Discord. Create a bot in the Discord Developer Portal and turn on Server Members Intent and Message Content Intent. Invite the bot with the permissions in the Switch guide. Then connect it from Home > Messaging apps. Keep the bot token secret.

6. Add rules to the room. My instructions say that only the human merges, and that nothing goes to a customer without approval.

7. Check before you start. These two room commands show the state of the room:

!agents-status
!roles
Enter fullscreen mode Exit fullscreen mode

What broke, and what fixed it

Claude Code showed "CLI not installed". The same panel had found its version, and agents still ran. It looked like a Windows path check problem, so reinstalling would not have helped.

"Address already in use", but nothing was using the port. Windows had reserved that port range. You can check with:

netsh interface ipv4 show excludedportrange protocol=tcp
Enter fullscreen mode Exit fullscreen mode

Quit Docker Desktop and Switch Console, then run these as administrator:

net stop winnat
net start winnat
Enter fullscreen mode Exit fullscreen mode

Handoff between two rooms failed. I first planned separate support and engineering rooms. The agent's connection call reported success, but its message to the other agent was refused with Targets not in room. Moving all the agents into one room solved it.

Agents replied in the logs, but not in Discord. The bot needed the Manage Webhooks permission.

Roles were held somewhere else. An agent can hold one role lease at a time, so old rooms can block a new one. Check with !roles.

Mentions wake agents. Even an @mention inside quoted text wakes an agent and uses tokens. I now leave off the @ in setup messages.

The result

Two runs on Discord ended in merged pull requests:

Bug Pull request Tests after the fix Report to human merge
Duplicate cancellation #6 41 passed 3m 6s
Cart quantity #8 42 passed 5m 53s

In both runs, the new regression test failed on the old code before the fix.

What I learned

  • Prove one agent first. Getting Fixer to open one real pull request removed the biggest risk.
  • Keep the workflow in one room until you have tested handoffs across rooms.
  • Say where the human decides. My agents are told never to merge, but GitHub branch protection is not turned on. A real team should enforce it.
  • Be honest about limits. Concurrent requests can still produce wrong counts in the demo app.

If you try Switch, start with one agent and one channel, then add the next agent after that works.

I used Claude Code to help build this project and write this post.

HowISwitch

Top comments (0)