On October 31 I drafted the initial design for agent-crew. By November 21 the repository had reached 246 commits. agent-crew is a team of AI assistants that live on Discord, divided by role into a life assistant, a fitness coach, a Japanese teacher, a tutor for Japan's FE (Fundamental Information Technology Engineer) exam, a knowledge keeper, a finance clerk and a reading partner, each in its own channel. My family messages them from their phones, and the assistants also send out reminders on their own schedule.
This post covers three things: what I built the system to solve, the key design choices and the reasoning behind them, and how messages, reminders and workout cards move through the system.
The problem
Before this, I used Claude Code's Remote Control to connect to the agent on my computer from my phone. It worked, but two problems kept getting in the way.
- Every conversation started from scratch. The agent knew nothing about me or my family, so its answers stayed generic.
- After a CLI upgrade or a Mac restart, read and write access to the wiki often broke, forcing me back to the computer to fix it.
So agent-crew was designed around four goals.
- Proactive reminders. Check email and calendar every hour, turn school notices, deliveries and upcoming bills into to-dos, nudge me at the right moment, and look up what is needed to handle each item in advance.
- Long-term memory. Every role shares a single Obsidian knowledge base (the LLM Wiki). Workout logs, missed study questions and reading notes are written back to it, so the next conversation picks up right where the last one left off.
- Able to act, within clear bounds. Roles can create calendar events, draft emails and edit the pages they own. Sending an email or inviting someone to an event requires a human to confirm first.
- Fewer trips back to the computer. When something breaks, I can fix it from my phone, and kick off code changes and deploys from there as well.
Architecture
Here are the main design choices, module by module, and the reasoning behind each one.
Why Discord is the only front end
In short, Discord is the best management platform I could find for a personal or family agent. The reasons, in order of weight:
Channels plus threads map to projects plus sessions. This is the main reason. Tools like Claude organize conversations as sessions inside a project. A Discord channel and thread are the same two levels: a channel works like a folder, created per purpose with no practical limit, and each conversation is a thread, which is one session. In the fitness channel, for example, every workout is a thread. To look up last week's training I open the channel, and I skip the threads I don't need by their titles. Reviewing takes two steps, pick a channel to narrow things down, then pick a thread. A single flat chat window puts every record on one timeline, which makes this hard.
Shared and private spaces can exist side by side. The family has shared channels where several people talk to the same role in one thread, and private channels where one person keeps their own sessions. A family needs both, and Discord handles it with channel permissions, so I did not have to build an account system.
Server and member management already exists. Roles, channel permissions, invitations and bot integration are all there. Adding a family member means giving them a role; limiting a role to certain channels is a permission setting (more under "More than one user" below).
It is free, and the apps on every device are good. The free tier is enough: message history stays on the server, files can be uploaded within a per-file limit, and there are apps for phone, desktop and web. I mostly use my phone and did not want to juggle several apps, so the quality of the mobile app matters to me. Discord also supports voice messages natively. A voice clip is transcribed into text before it reaches a role, which helps when I am walking or training and cannot type.
Building these myself would be a lot of work: how sessions are organized, the boundary between shared and private, member management, and clients for every device. Discord provides them together.
A single bot paired with webhooks lets every role reply under its own name and avatar, so there is no need for a separate account per role.
Each role is a YAML file, and each task runs one claude -p
Roles are not long-running processes.
personas/coach.yaml defines the fitness coach's prompt, model, available tools and the wiki pages it is permitted to edit. When a task arrives, the system spawns a single Claude Code CLI process with that configuration, and the process exits as soon as the task finishes. Session IDs are stored per thread and role, so follow-up messages in the same thread continue the existing conversation.This spares me from building and maintaining an agent loop myself. Tool calling, skills and MCP (Model Context Protocol) support come built in with Claude Code, and the same skills I use in the terminal work for the roles too. Because no state lives inside a running process, anything can restart safely at any time. Starting a new topic opens a fresh thread and a fresh session, with code choosing which background material to carry over; long sessions burn more quota and tend to mix unrelated topics together.
Running in Kubernetes on the Mac (OrbStack)
The aim is a service that recovers on its own when nobody is watching. The desired state lives in the Kubernetes config inside the repository, and any Pod that exits gets restarted automatically. Incoming tasks are written to a SQLite queue first, so after a restart any unfinished tasks go straight back into the queue. The system only gives up on a task after three consecutive failures, and it notifies the person who requested it. Everything runs on a single machine, so the goal here is automatic recovery rather than high availability.
Buttons don't call the model
Answering a quiz question, checking off a workout set, or tapping "Done" and "Remind me tonight" are all handled by plain code. Buttons should behave predictably, and plain code handles them faster, more reliably and without spending any model quota.
Hard limits live in code
Every tool call first passes through a hook (
guard) that enforces a fixed set of checks. No role is allowed to run Bash, and each role can write only to the wiki pages it owns. Sending an email or inviting external people must be confirmed in Discord first; that confirmation is valid only for that single call with the exact same arguments, and expires after 30 minutes. Deleting email is forbidden outright, and there are hard caps on changes per task and per day.A model can ignore a rule written in its prompt, whereas a check in code runs every time. The project follows a standing convention: when the same kind of mistake happens twice, first change the design so it cannot happen, then add a programmatic check, and resort to a rule in prose only as a last step.
Development and operations in #projects, outside the Pod
Changing code, deploying updates and running tasks on the Mac all happen in the
#projects channel. Each message opens a thread that the Engineer running on the Mac picks up. The Engineer runs Claude Code inside the project directory, posts its analysis, plan and time estimate in the thread before starting, reports progress along the way, and posts the outcome once done. Whenever another role runs into something it cannot handle, it forwards the request along with the conversation to this channel as well.A system needs a repair path that does not depend on the system itself staying healthy. Because the Engineer runs outside the Pod, it can still fix things when the service is down, and the roles themselves never receive deploy permissions. The trade-off is that a Discord account effectively becomes a way to operate this Mac, so the code restricts triggering it to just me and one family member.
Claude delegates to other agents so every quota gets used
When the Engineer receives implementation work that is well-scoped and easy to verify, it hands the task to another coding agent working in its own git worktree. Right now that is agy (Google's Antigravity CLI), though Codex or any other command-line agent could be plugged in the same way. Claude breaks down the work, writes the task brief and checks the finished result, while the other agents handle most of the execution.
I have subscriptions with more than one provider, and leaning on only one drains its quota quickly. One day Claude's quota ran out twice, and reviewing what happened showed that the development session had been writing features directly. Now the split tracks Claude's usage: the more quota gets used, the more execution is handed off while Claude sticks to assigning and reviewing, and nothing new starts once it nears the limit. The delegated agents also monitor their own remaining quota and switch to another agent when one runs low.
A few other decisions
- Models by tier. A role's configuration specifies only a tier: light, standard or high. The mapping from tier to model is defined in one place, so changing models never touches individual roles. Anything a person reads directly uses at least the standard tier: the life assistant started on the light tier, and the very first morning reminder my family received got the details wrong. The high tier shares quota with my own coding and burns through it too fast, so it is not the default either.
- Web pages through Cloudflare Tunnel. Interactive cards and pages open straight on a phone with nothing to install. Tailscale is kept in reserve for a future operations channel.
- A 30-minute cap per task. Only two tasks run at once and there is no cancel button yet; a stuck task holds onto its slot, so without a timeout, two stuck tasks would stall the whole system.
- The wiki lives in iCloud. That makes it easy to view and edit across several devices while providing a layer of cloud backup.
More than one user
agent-crew was built for more than one person from the start.
- Identity is resolved in code. The sender is identified by Discord ID and written onto the first line of the prompt, so the model never has to guess who it is talking to.
- Data stays separate per person. Tasks, workout cards, quiz progress, and Gmail and calendar tokens are isolated per person, and each person's session connects only to their own accounts.
- Adding someone takes only a role. A new member joins the server and receives the
Crew memberrole; messages from anyone without that role are ignored.
One caveat: personal pages in the wiki are distinguished only by the
tenant field in their frontmatter. Because roles can read most pages, per-person separation there depends on the model following its instructions rather than real access control. That is why adding someone remains a deliberate decision.All front-end code lives in a single module,
discord_adapter, and the card data structures do not depend on the platform. Moving to Telegram or Slack later would mainly mean rewriting that layer, leaving the roles, task queue and guardrails intact.Interactive cards: a workout example
Beyond text replies, roles can send interactive cards and web pages. Workouts are what we use this for most often; here is the full loop.
- In
#fitness, ask the coach what to train today, by text or voice.
- The coach first outlines today's plan in text, then calls
create_workoutto send a check-in card. Default weights come from the previous session's log along with any pending adjustments in the plan.
- During the workout, check off each set on the card, logging weight, reps and RIR (reps in reserve). Plain code handles this step: every tap updates immediately, with no waiting for the model.
- Once the workout is done, tap "Submit". This is the first point since the card was sent that a model call is queued.
- The coach receives the complete log, compares it against the plan and posts feedback in the thread.
- The log is written back to the workout journal in the wiki, and a web page shows the training trend.
- The coach adjusts the next session's plan from that data. Whenever the numbers conflict with how the body feels, a note about physical discomfort takes precedence over the plan.
The screenshot above shows a card after submission, with weight, reps and RIR logged for every set. Recording sets on a card keeps the data structured, so the coach evaluates what actually happened rather than what someone remembers afterwards. Quiz cards follow the same pattern: checking answers is handled by code, only "Ask the teacher" and "Review" call the model, and each week's new set of questions targets the topics with the lowest accuracy.
One-off sharing
Sometimes I need to share a page or a discussion with someone: a travel itinerary, a page of study notes, or a conversation turned into a document.
In Discord I ask a role to turn the content into an HTML page. The role publishes it under my own domain with
publish_page, reachable through Cloudflare Tunnel, and posts the link back to the thread. These pages are not strictly read-only: on an FE quiz card, for instance, tapping "Ask the teacher" sends the question back to the right role as a new task, and the answer arrives in the Discord thread. Family members sign in through Cloudflare Access. To share a page with someone outside the family, share_page creates a signed link valid for 1, 7 or 30 days; it expires automatically and can be revoked at any time. A family-only control panel lists every published page and active share link, letting us revoke shares or delete pages.How a message travels
A few small touches came straight out of everyday use.
- Consecutive messages become one task. On a phone I tend to send thoughts one sentence at a time, so the system waits 3 seconds and replies once to the whole batch.
- Commands in a reply get their own message. A long press on the phone copies the command cleanly, without trying to select text inside a wall of prose.
- Hand-offs are capped. A task can be handed over at most 3 times, and a role already in the hand-off chain cannot appear again, stopping roles from passing a task back and forth.
- Routing can bypass the model. A new message in
#inboxthat does not mention any role first goes to TypeSafe's Jev for a quick judgement. Only at 0.9 confidence or higher is it moved straight to the matching topic channel; otherwise the life assistant decides where it belongs.
The proactive reminder loop
Building the proactive reminder loop took the largest share of the time.
The division of labour is simple: the model reads and proposes, while code decides.
- Each scan runs as a read-only
claude -pcall. It reads email, calendar events and links inside emails, then returns a JSON list. Code checks every item: whether it qualifies as a to-do, whether it is a duplicate, and whether it would bring back something already finished or marked unimportant.
- Code calculates how urgent a to-do is directly from its deadline; the model does not make that judgement.
- Before anything goes out, the system prepares the practical details: where to handle it, what the steps are, what it costs and where to find the official page. All of that goes onto the card.
- Every proactive message goes out through a single outbox. The same item cannot be sent twice within 24 hours, follow-ups stay in the same thread, nothing is sent between 21:00 and 08:00, and each person has a daily cap.
- Items marked "Not important" or "Don't push this kind again" are stored as counter-examples. Every Sunday the system reads them and rewrites the reminder-preferences page in the wiki; later scans consult that page and skip similar items.
Above is an 8 a.m. update delivered to
#inbox one morning. The top card summarises items spotted in email that need no separate action, noting how each relates to the family along with a suggestion; the bottom card lists the day's to-dos, where the urgent one already has prepared questions attached and a "Done" button beside it. Places and family health details in the screenshot are blurred.What it handles well, and what it doesn't
Good for:
- Everyday household matters. School notices, deliveries, appointments and bills. None of them is hard on its own; what matters is not missing anything and remembering at the right moment.
- Study practice. Quiz cards for the FE exam and Japanese, a missed-question log, reminders when reviews come due, and a new weekly set built around the weakest topics.
- Things that benefit from long-term records. Workout check-ins, reading notes and the household ledger. Entries are written back to the wiki, so later conversations can refer to them directly.
- Small code changes. Describe a change on the phone, and the Engineer in #projects edits the code, runs the tests and deploys the update.
Not so good for:
- Long-running tasks. There is a 30-minute limit per task across two concurrent slots, and no cancel button yet.
- Multi-user setups that need strict isolation. Per-person separation in the wiki depends on the model following rules.
- Serving external users. The design assumes the users are family and a few invited people.
Iterating from family feedback
Over those three weeks, every piece of feedback from my family went into a feedback log in the wiki, which has now reached FB-045. Each entry records the original remark, the actual problem, what changed, and a regression test whose comment carries that feedback number.
Take FB-021 as an example. Early on, an urgent to-do kept repeating every few hours, which quickly became disruptive. Now each item triggers at most three reminders: when it becomes urgent, at the time I said I would deal with it, and two hours before the deadline. Rules like this are hard to think through completely at design time; they mostly emerge from real use.
Not done yet
- An LLM gateway. The original design included a local LLM gateway (magpie) exposing a single interface to the rest of the system while connecting to several model providers underneath, assigning models by route group and switching automatically when one provider's quota runs out. Application code would know only model tiers, never a provider's name, removing the dependency on any single platform. This is paused for now, partly to let my setup with official Claude settle first, and partly because some providers' terms restrict using subscription credentials outside their official clients, which has to be checked provider by provider.
- Handing off long tasks from Discord. That requires sorting out the 30-minute limit, the concurrency slots and a cancel button first.
- Automated acceptance testing. Automating end-to-end checks on real Discord and a real phone as far as possible, while keeping quota usage under control.
Where it stands
All the automated tests pass, though there has been little acceptance testing on a real phone so far. Whether the scans stay accurate and the morning reminders prove useful will take longer everyday use to judge. The bot also runs on a personal subscription quota, which sits in a grey area under the terms of service.
This post was also written straight into the blog database by a terminal agent through Notion MCP. It drew and uploaded the diagrams; I reviewed the draft and published it.