Skip to content

On Discord

When you leave the computer, cornercase can carry on in a Discord direct message. While you are away, every agent that needs you or finishes its turn sends you a message: its question with buttons to answer it, or what it wrote. You reply to that message, and your reply goes to that agent. From the same chat you can list your agents, look at their screens, stop one or start a new one.

It does what the Telegram bot does, and the two can be set up and away at the same time. To see the whole window instead, use From your phone.

  • A Discord account, with the Discord app on your phone.
  • An app of your own, made in the Discord Developer Portal:
    1. New Application, give it a name (cornercase will do) and create it.
    2. In Installation, under Installation Contexts, keep User Install on. Guild Install can stay as it is: the direct message needs no server. Forum mode asks you to turn it on later.
    3. Still in Installation, set Install Link to None and save. cornercase makes its own link when you pair, and Discord does not let a bot be private while it has an install link.
    4. In Bot, turn Public Bot off and save, so the app is private: nobody but you can add it. cornercase would ignore anyone else anyway, but each of their messages would add a line to server.log.
    5. In General Information, leave Interactions Endpoint URL empty. With an address there, Discord sends button presses and commands to it instead of to cornercase, and they all fail.
    6. In Bot, press Reset Token and copy the token it shows (a long string with two dots).

The app is yours alone: cornercase talks to Discord as its bot, and only to you, its owner. cornercase runs no server for this: your computer connects to Discord and sends the agents’ messages itself, over HTTPS and a WebSocket. Nothing on your computer is reachable from the internet.

  1. In Settings › Remote, under Discord, select bot, press Enter, paste the token and press Enter. cornercase checks it with Discord and shows the bot’s name.
  2. Select phone and press Enter. A dialog shows a QR code and the same link as text.
  3. Scan the code with your phone’s camera. It opens Discord on Add to my apps: authorize it.
  4. Within a few seconds the dialog closes, Discord connected shows, and the bot says hello in a direct message.

There is no code to type: the link adds the app to your own Discord account, and cornercase then messages the app’s owner, which is you. Once paired, the bot listens only to that direct message, and, with forum mode, to your messages in its forum’s posts.

A program that draws cornercase itself gets the same link with cornercase config pair discord.chat, once the token is set with cornercase config secret discord, and cornercase asks Discord for the owner while it runs.

If the app is still public or User Install is off, the bot row and the dialog say what to change (public app: Install Link to None, then Public Bot off, turn on User Install in the Developer Portal). Change it in the Developer Portal and the warning goes on the next check, a few seconds later while the dialog is open; there is no need to paste the token again. It never stops you from pairing.

When you leave, turn on away in any of these ways:

  • click More ▴ at the bottom of the sidebar, then remote… and continue on Discord;
  • press o in the keys menu, which turns it on for every chat app that is set up;
  • run cornercase away, the same;
  • send /away to the bot, if you left without it.

The bot then sends the list of your agents, and More ▴ shows a green ●. It stays on until you turn it off: remote… › stop messaging on Discord, o again, /back in the chat or cornercase away --off.

The messages are the same as on Telegram (see What you get): ! claude needs you · web-shop › dark-mode with the last lines of its screen and a button per option, plus esc and screen; ✓ claude finished with the last thing it wrote, in Discord’s Markdown. A message longer than Discord’s 2,000 characters comes in several, at most four. A keyboard with more buttons than one message holds continues in the next ones, marked …. With notices for subagents off, agents started by another agent send none, as on Telegram. A bot’s answers come titled 🤖 <name>, by default only while you are away (see What you get). A bot that asks for a secret says so, and the value is given in cornercase only.

Reply to one of the bot’s messages (long-press or swipe it, then Reply) and what you write goes to that agent, with Enter. A 👍 on your message says the agent took it; otherwise the bot answers why not. When the bot asks you to write something (the prompt for /new, a branch’s name, a message after write), its message ends with reply to this message, but a plain message works too: the next one you send that is not a command answers it, for ten minutes, unless the bot has written about an agent since. A reply to a bot’s message goes to that bot, and its answer comes back as a reply to yours. Otherwise a message that replies to nothing goes to your only agent, or, with several, the bot asks which one.

With several agents at work, everything lands in the one direct message. Forum mode gives each workspace its own post in a forum channel of a server of yours, with a tag that says how its agents are doing, so you follow each line of work on its own and a message in a post goes to that workspace’s agent. The direct message stays: commands, the welcome and whatever belongs to no workspace go there. Off by default; with it off, nothing changes.

Discord does not let an app make a server, so you make one (a private one, just for you, will do) and add the app to it. To turn it on, select forum mode under phone, in Settings › Remote › Discord, and press Enter. A Discord forum dialog opens with four steps, which tick themselves as cornercase sees each one done, every few seconds while the dialog is open:

  1. Guild Install: in the Developer Portal, Installation, turn on Guild Install and save.
  2. Message Content Intent: in Bot, turn on Message Content Intent and save. In a server, Discord sends a message’s text only to bots with this switch, so without it the bot could not read your replies in the posts. A private app gets it without review.
  3. The app is in your server: the dialog shows a QR code and a link that add the app to a server, with the permissions the forum needs. Open it and pick your server. No server yet? In Discord, + › Create My Own › For me and my friends. Only servers you own count; with several, click the one you want.
  4. The forum channel: cornercase makes a private forum channel, #cornercase, that only you and the bot see, with the tags working, needs you and done.

Then the dialog closes and Discord forum ready in <server> › #cornercase shows. done closes the dialog with the mode on, and the forum mode row’s note names the step still left; turn off turns the mode off. If something is missing, the dialog says what: a permission the bot lacks shows the link again to grant it. Once the forum is ready, Enter on forum mode turns it off.

The steps are also checked with the dialog closed, every 30 seconds while the mode is on, a phone is paired and the forum is not ready yet. So a script can turn the mode on with cornercase config, follow the step left in cornercase status --app, and the forum is made by itself once the steps are done, as long as the app is in only one of your servers. With several, that step waits for your pick: in the dialog, or with cornercase config forum-server ID and the list in status --app (pick the forum’s server). Pasting the token of another bot forgets the forum, so its steps start again.

What changes:

  • A post per workspace, titled <project> › <workspace>, made by the first message about one of its agents. Notices and screens of that workspace’s agents go there; each message names its agent, as in the direct message.
  • A tag per post: needs you while one of its agents waits for you or failed, working while one works, done otherwise. Tags change whether or not you are away; messages still come only while you are away.
  • Write in the post and it goes to that workspace’s agent: to the agent of the message you reply to, to the agent whose write you pressed, to the only one, or, with several, the bot asks which with a button for each. With none, the bot says /new in the direct message starts one.
  • A post per bot, titled 🤖 <name>, made by its first answer sent there; a routine’s answers go in it too, titled with the routine. Write in it and it goes to that bot. Its tag is needs you while it asks you for a secret, working while it answers, done otherwise. Removing the bot closes its post like a closed workspace’s. The post is remembered across restarts.
  • Commands stay in the direct message: a /… typed in a post answers Commands work in the direct message with the bot. /status and /new there cover every workspace; once /new starts an agent, its Started … in … goes to that workspace’s post, and the direct message gets a link to the post.
  • Closing a workspace sets its post to done and archives and locks it, or deletes it: the closed workspaces row, shown under forum mode while it is on, picks archive (the default) or delete. close agents in a workspace’s menu archives its post without locking it, and reopening them unarchives it, so the next message goes to the same post. A workspace closed while forum mode is off has its post cleaned up when you turn the mode back on, unless the cornercase server restarted in between.
  • Deleting a post yourself is fine: the message that finds it gone makes a new post for its workspace and goes there, so nothing is lost; if the new post cannot be made either, the message goes to the direct message.

If Message Content Intent is turned off later, the bot keeps working in the direct message and keeps making and tagging posts, but cannot read them: the forum mode row says so until you turn the switch on again. Turning the mode off keeps the posts and the forum; turned on again, the same posts are used.

Type / in the chat with the bot and they show in Discord’s command menu, under the app’s name; pick one and send it. They only show in that chat, not in servers or other conversations.

Command What it does
/status Every agent, in the order of the agents section, with what it is doing, its model and context, and buttons to write to it, see its screen or stop its turn.
/new Starts an agent: the bot asks for the project, the workspace or a new worktree, the agent if needed, and the prompt.
/away Turns away on from the phone.
/back Turns it off: the bot stops messaging you.
/bots Every bot, with what it is doing, its unread answers and its next routine, and a ✎ button to write to it.
/bot Writes to a bot: Discord asks for its name (its id or its name) and the text. A name no bot has lists them.

A button from before the server restarted is refused, since the ids it carries may name other panes now: send /status for fresh ones.

  • Forget the phone: select phone and press Backspace. The bot stops listening to you.
  • Remove the bot: select bot and press Backspace. The token is deleted and cornercase stops talking to Discord. Setting another bot forgets the paired chat.
  • Only the app’s owner is heard: in the direct message and, with forum mode, in the posts the bot made in its forum. Messages from anyone else, from other channels and from other servers are ignored.
  • cornercase joins a server only for forum mode, and only the one you add the app to. Its forum channel is private: hidden from the server’s other members.
  • The token lives in secrets.json, and the bot’s name, the paired chat and the forum’s server and channel in discord.json, both next to config.json and readable only by you (see Files).
  • server.log says when a message or a tap came in and what kind it was, never its text, nor the token.
  • What agents write goes through Discord. Direct messages with bots and forum posts are not end-to-end encrypted, so Discord’s servers store them: questions, answers, the screens you ask for, file paths and code. Don’t use it for work you can’t send there.
  • The computer must be awake and the cornercase server running. Keep awake keeps it awake while an agent works.
  • Away is not saved: after a server restart it is off until you turn it on again.
  • Give each computer its own app: two computers on one app would both read your replies.
  • Pictures from the agents are not sent: one direct message holds every agent, and replies say which one.
  • Forum mode does not make workspaces: a new post you write yourself in the forum is ignored. Start agents with /new in the direct message.
  • A post keeps its first title: renaming the workspace does not rename it.