dusk bot
guidesclaude code for email

dusk botguides

claude code for email: clean up one slice first

for email cleanup, start by asking a claude code bot to inspect a small slice of mail and propose changes, with no permission to change it yet. in dusk bot you can connect gmail to that bot as read only. review the full threads before allowing a bounded label change. this is a one-time cleanup method, separate from a daily inbox brief or automatic reply routine.12

by the dusk bot team · checked · how we made this

pixel art: a sky blue pixel bot and a cyan pixel bot beside a tile saying Claude Code, a mailbox with a letter and a magnifying glass, on a sandy path in front of a calm sea with one small island, one saying "show me the candidates"

first make the scope small enough to inspect

the phrase "clean up my inbox" leaves too much undecided. choose one sender and a date range. decide whether the aim is finding old reference mail, gathering messages about a finished project or identifying newsletters you no longer read. leave deletion out of the first task.

give the bot those boundaries and require a list of candidate threads with a reason for each. ask it to explain uncertainty instead of guessing whether a message matters. this method is about clearing up a specific backlog. for ongoing sorting and reply drafts, use the separate email triage workflow.

connect gmail to one bot, read only

dusk bot can run claude code as the ai app behind a bot you text. choose the bot, connect gmail in Connected apps, and allow that bot to read only. sign-in happens on google's page. composio holds the connection; dusk bot does not store the gmail provider tokens.1

if you have more than one account, label them and specify the account in the request. dusk supports up to five usable accounts per app. a successful connection does not mean the bot chose the mailbox you intended. check the account before treating a missing search result as evidence that the mail is absent.1

anthropic's terms decide what a claude sign-in may be used for; check them before you automate. its legal page was checked on 12 november 2026.6

inspect threads, not just subject lines

gmail's actions include fetching emails and fetching a message by thread id. ask the bot to inspect the conversation before deciding that an old-looking subject belongs in a cleanup group. a thread can contain a later reply you still need.2

for each candidate, require the sender, why it matches your scope and the reason for the proposed label. look through the messages yourself before proceeding. the gmail integration guide lists the available actions.

allow one visible label change

when the candidate list looks right, choose the exact messages and the label you want. gmail's actions support creating a label and modifying email labels. grant only what the task needs, or restrict the bot to the relevant actions. keep deletion and outgoing mail out of the job.12

in dusk, gmail's Modify email labels counts as a send, so each one waits for your Allow unless you've set a daily amount. Modify thread labels and Batch modify Gmail messages don't ask. limit the bot to Modify email labels and Create label for this step.24

check the change before widening the cleanup

after the label step, ask for a report of the messages changed and anything left unresolved. compare that with gmail. check that messages outside the chosen sender and date range were not included. if the grouping is wrong, stop and correct the criteria before trying another slice.

do not turn a correct label change into authority to bulk delete. sending asks first in dusk bot unless you choose a daily allowance, but that protection does not automatically cover other mailbox changes. one exception: a bot on Full access with no sending rule of its own may send up to 25 a day without asking, so give full-access bots Ask every time under sending. narrow action access, the sending setting and your own inspection are the safeguards.14

where the standard connection stops

gmail filters, the vacation responder, imap or pop, forwarding, send-as and delegates need extra google permissions beyond the standard connection. the bot should tell you about that limit. with your own composio project you can add those permissions; on dusk cloud you ask support.1

a label cleanup won't change your gmail settings. it also cannot know why you kept an old message unless you explain it. if your mail is in microsoft rather than google, start with the outlook integration and its own actions instead of assuming gmail labels translate directly.

only repeat a method after you understand it

finish this as a manual task first. if you later want a recurring review, specify its source, timing, destination and when to leave mail alone. dusk routines on your computer stop while it sleeps or the app is closed; dusk cloud keeps them running.5

if choosing and steering the bot is the unfamiliar part, the non-developer guide starts before account access. the aim is a cleanup you can explain and verify, not a large number of messages changed in one run.

questions

can i use claude code to clean up my gmail inbox?

a claude code bot in dusk bot can use the documented gmail actions when you connect the account and allow the bot access. begin with read-only inspection and a small proposal, then decide which label changes to permit.123

will it ask before changing labels?

single-message label changes ask first, like a send. thread and batch label changes don't, so leave those out of the bot's allowed actions.24

can it set up filters instead?

filters need additional google permissions beyond the standard connection. gmail lists a filter action, but the standard connection can't use it.12

sources

  1. dusk bot docs: files and apps
  2. composio: gmail actions, checked 12 november 2026
  3. dusk bot docs: ai setup
  4. dusk bot docs: approval settings
  5. dusk bot docs: routines
  6. anthropic: legal and compliance, checked 12 november 2026

drafted with ai help from the dusk bot docs and the sources listed on this page, then checked against them. if something here is wrong or out of date, write to [email protected].