Repository navigation
fix(inbox): send the person's Inbox rules and reminder to MCP sessions - #3567
Merged
Merged
Conversation
Sessions that connect over MCP only ever saw the built-in server instructions, so the Inbox rules and reminder set under Prompts never reached them. Build the instructions per connection from the configured text, in place of the five summary lines the tools already describe in full, and keep the result under Claude Code's 2,048-character cap.
Follow-up on the MCP rules and reminder (backnotprop#3555): - Never cut: the person's rules and reminder are each sent whole or left out whole, rules first. With nothing of theirs sent, the instructions are exactly the built-in ones. - Keep the two summary lines no tool repeats (reply_to "never from memory", "pictures go in the body"); only the three the tools say in full make room. No fixed line is reworded. - MCP sessions follow the shared ("All agents") rules and reminder only: the instructions go out at initialize, before a session names its agent. - Settings → Prompts shows the MCP room in the rules editor ("N / <room> through MCP", computed from the built-in text) and a "Not sent to agents connected through MCP" note when rules or the reminder are left out there. Save is never refused for it. - The builder moves to inbox-mcp-instructions.ts so Settings reads the same room and fit as the server.
With inboxReminder off (a shared false, or off for Claude Code, Pi and OpenCode alike in the per-host form Settings writes), MCP sessions get the built-in instructions byte for byte, as terminal sessions get neither reminder nor rules. Settings then shows no MCP note.
Claude Code keeps 4,096 characters of server instructions since 2.1.296 (2,048 before). The room for the person's rules now follows the connecting client's initialize clientInfo: - Claude Code 2.1.296 and later: 4,096, all five summary lines kept. - Claude Code before 2.1.296, or a client with no name or version: 2,048, the earlier behaviour (three lines step aside while the person's text is sent). - Any other client: no documented cut, so the terminal path's cap on the person's text. Text is still sent whole or left out whole; empty settings or the reminder switch off give the built-in instructions byte for byte. Settings shows current Claude Code's room in the editor and names who misses the rules or the reminder in its note.
…is Claude Code 2.1.296+ The client name is trimmed and compared without case. A name containing "claude" (Claude Desktop, Claude apps we do not know) gets 2,048 unless it is Claude Code itself with a readable version of 2.1.296 or later. Settings notes for that tier name other Claude apps and unnamed clients.
backnotprop
added a commit
that referenced
this pull request
Nov 19, 2026
Takes in #3567 (the person's rules and reminder in the MCP server's instructions). Settings → Prompts keeps both kinds of line true: an agent connected through MCP (inbox/agents.json) gets no "Not sent to …: no note" line while the MCP instructions carry the shared rules; the MCP room lines are unchanged. The docs say where the rules now reach Codex, Gemini CLI and Qwen Code twice (note and MCP instructions) as a known limit.
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Sessions that connect over MCP only ever saw the built-in server instructions. The Inbox rules and reminder set under Prompts -> Inbox never reached them, so a rule like "always ask before deleting" only applied to sessions started from a terminal.
What changed
The MCP server now builds its instructions per connection from the configured rules and reminder (the ones for all agents), using the same resolvers the terminal path uses, and it follows the same reminder switch: with the reminder off, MCP sessions get nothing of the person's, just as terminal sessions do. When nothing is configured, the instructions are byte-identical to before. When the person's rules or reminder are set, they are added after the built-in lines, and the room they get follows what the connecting client keeps of the instructions, read from its
initializeclientInfo:These rooms are computed from the built-in text. Nothing is ever cut: the rules come first and are sent whole or left out whole, then the reminder in the room they leave, whole or left out whole. Settings → Prompts shows current Claude Code's room in the rules editor ("N / 1,913 for Claude Code through MCP"; Save is never refused for it) and, under rules or a reminder that is left out somewhere, a "Not sent to …" note naming who misses it. A change applies at the next session, with no restart.
How verified
Unit tests in packages/server/inbox-mcp-instructions.test.ts: which tier each client is (Claude Code versions around 2.1.296, other casing and spacing, no version, Claude Desktop and unknown Claude apps, Codex, Cursor, no name), each tier's fit/leave-out boundary (nothing cut), all five lines present whenever the cap is 4,096 or more, the two lines always present under 2,048, built-in lines never reworded, reminder and rules order, which rules an MCP session follows, the reminder switch (off gives the built-in instructions byte for byte), the Settings data, and initialize requests through the MCP handler sized to their client and reading config.json again. DOM tests in packages/inbox/promptsSettings.test.tsx cover the count and the notes. The end-to-end test in packages/server/inbox.test.ts connects real MCP clients (a non-Claude client and Claude Code 2.1.295) with rules configured and checks what each gets, then changes the config and checks the next connection picks it up. Typecheck for packages/server is clean, and the parity and MCP-adjacent suites pass; the inbox, board-switch and steps-agent suites start an Inbox and run in CI.
Fixes #3555