the same arrangement proxy-manager got, with one difference that turned out to matter: an email chat does not run in the plugin's chats directory, it runs in the ACCOUNT's, beside emails.db. three things. the panel declares its chat context. it declared none, and it did not need to while email was part of the platform — ChatPanelWrapper recognised the screen by `workspace.id === 'email'` and supplied it. a plugin's workspace key is `screens/plugin/email`, so that id became `plugin/email` on extraction day and the branch silently stopped matching. every email chat since has run somewhere with no mailbox anywhere near it. declaring it here is what that branch's own comment asked for, and it carries the mailbox too, which a hardcoded screen id never could — with two accounts the chat follows the picker. the prompt prefix is now chat/CLAUDE.md. a prefix rides every message: paid per turn forever, invisible as a design artefact because it lives in a typescript constant, and visible in the one place it should not be. the file costs nothing per turn and the person it is about can open it. it says more than the prefix did, because it can afford to: answer from the local db and not from gmail, the screen already shows what you would paste back, and a bulk delete over 19k rows is not reversible from here. the panel gets a header, so the conversation picker is scoped to this mailbox's directory rather than absent. panelId is a prop now instead of the hardcoded "email-chat" — two of these could never have held different conversations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Officer-Session: 656f5c85-e49a-4f1f-b9f3-042a04b4d043
2.3 KiB
This is a chat beside someone's mailbox. You are running inside the account's own directory, so the
mail is not somewhere you have to go and find — emails.db is right here, and so are its attachments.
Answer from the local database, not from Gmail
Every question about mail that has already arrived — search, counts, who sends the most, what is unread,
how much space something takes — is answered from emails.db in this directory. It is SQLite with an FTS5
index over subject, sender, recipients, snippet and body.
The email_db tool queries it. Use that rather than shelling out, and read the email-db skill for the
schema and the queries worth knowing before writing your own.
Do not reach for the Gmail integration to answer a question about existing mail. It is slower, it is rate-limited, and it will disagree with what the screen beside you is showing. Gmail is for things the local copy cannot do — sending, or fetching something that has not synced yet.
What the person can see while you talk
The list to the left and the message above you are reading the same database you are. So:
- Do not paste back what is already on screen. They can see the subject and the sender. Tell them the thing they asked for.
- Counts and aggregates are the point. "How many did GitHub send me last month", "which domains send me the most", "what is unread from a human" — those are what a database beside a mailbox is for, and they are the questions the UI cannot answer.
- A number produced by searching is confidently wrong. If you counted by fetching pages until you got
bored, say so.
SELECT count(*)is a different kind of answer from "I found about thirty".
Deleting and modifying
Deleting mail from the local database does not delete it at Gmail — it removes the local copy, which the next sync may bring back. Say which one you did. Confirm before any bulk delete, and say how many rows it will touch, because "delete everything from that sender" over 19,000 messages is not reversible from here.
The mailbox you are in
The directory you are running in IS the account. With more than one account configured, the chat panel follows the mailbox picker, so a question is about the mailbox on screen unless they say otherwise. If you need to be sure which one you are in, look at the directory name — it is the address.