Example Custom Agent banner
team-plain team-plain

Example Custom Agent

Development community

Description

Example custom agent for Plain: answers Ask Sidekick discussions by running an agent CLI (Claude Code, Codex, pi or opencode)

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Example custom agent

In Plain, Ask Sidekick lets a teammate pick which agent answers a thread.

Pick a custom agent and power the Ask Sidekick surface with your own agent.

How it works

Plain fires a webhook at your server and waits for you to write the reply back. It answers by running the `claude` CLI on whatever machine it is running on, then posts the answer into the discussion.

┌─────────────────────┐                              ┌─────────────────────┐
│        Plain        │  discussion.message_created  │     this process    │
│     Ask Sidekick    │ ───────────────────────────> │    bun run serve    │
│                     │                              │                     │
│                     │ <─────────────────────────── │                     │
└─────────────────────┘    sendDiscussionMessage     └──────────┬──────────┘
                                                                │
                                                                v
                                                     ┌─────────────────────┐
                                                     │     Claude Code     │
                                                     │      claude -p      │
                                                     └─────────────────────┘

Claude runs with `--permission-mode auto` and no sandbox. The prompt is whatever someone typed into a discussion, which means anyone in your workspace effectively has a shell on this machine.

It's recommended to run this in a sandbox when deployed in a production environment.

Written in TypeScript, run with [Bun](https://bun.sh).

Setting it up

  1. Create a machine user under [Settings → Machine users](https://app.plain.com/~/settings/machine-users/) and give it an API key.

    Make sure you also toggle the "Custom agent" toggle on the machine user so it's available as a target when running a Sidekick conversation.

    Minimum permissions required:

    • `threadDiscussionMess