claude-outlook-bridge
AGENTS.md1 starsChanged 6 months agoMITView on GitHub
Instructions for coding agents (Claude Code, Cursor, Aider, etc.) wiring this bridge into a user's project. claude-outlook-bridge is a single Python file (outlook_bridge.py) that an agent invokes via Bash to read and send email through the user's already-open Outlook Desktop App on Windows. No auth setup. All output is JSON on stdout; errors exit non-zero with {"error": "..."}. When a user asks you to set up Outlook access in their project, do all of the following: If this returns folder…
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,266 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository2 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When a user asks you to set up Outlook access in their project, do all of the following:
- Distinctive: line 19
Smoke test: before wiring it in:
- Very specific: line 23
If this returns folder JSON, Outlook is reachable.
- Very specific: line 76
Don't loop
listto scrape the inbox: Use search with a query. Repeated list calls bloat context. - Distinctive: line 78
Don't assume Outlook is open: If a command errors with a COM dispatch failure, surface the error to the user instead of retrying.
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Instructions for coding agents (Claude Code, Cursor, Aider, etc.) wiring this bridge into a user's project.
What this is
claude-outlook-bridge is a single Python file (outlook_bridge.py) that an agent invokes via Bash to read and send email through the user's already-open Outlook Desktop App on Windows. No auth setup. All output is JSON on stdout; errors exit non-zero with {"error": "..."}.
Auto-wire checklist
When a user asks you to set up Outlook access in their project, do all of the following:
- Clone or download to a stable path. Recommend
~/.claude/outlook-bridge/so the script can be shared across projects:git clone https://github.com/ChiefStarKid/claude-outlook-bridge.git ~/.claude/outlook-bridge pip install -r ~/.claude/outlook-bridge/requirements.txt - Smoke test before wiring it in:
If this returns folder JSON, Outlook is reachable. If it errors, Outlook isn't open orpython ~/.claude/outlook-bridge/outlook_bridge.py folders --prettypywin32isn't installed — fix before continuing. - Add the permission to the project's
.claude/settings.json(create the file if missing):{ "permissions": { "allow": ["Bash(python *outlook_bridge.py*:*)"] } } - Add a CLAUDE.md snippet so the assistant knows the bridge exists and the safety rules:
## Outlook email access Outlook is reachable via: `python ~/.claude/outlook-bridge/outlook_bridge.py <command> [flags]` Commands: `folders`, `list`, `search`, `read`, `open`, `send`, `reply`, `forward`, `move`, `delete`, `cal-list`. All output is JSON. Use `--pretty` for human display. **Safety:** `send`, `reply`, `forward` all save to Drafts by default. NEVER pass `--confirm-send` unless the user explicitly asks to send in the current turn. The old `--draft` flag still works but is now a no-op.
Command manifest
| Command | Required args | Side effects | Idempotent | Notes | |
folders | — | none | yes | Returns full folder tree as JSON. | |
list | — | none | yes | `--folder <name | path> --count <n>. Returns array of {EntryID, Subject, From, ReceivedTime, ...}`. |
search | <query> | none | yes | Full-text across subject/body/sender/recipient. Same flags as list. | |
read | <entry_id> | none | yes | Returns full body + attachment metadata. EntryID comes from list/search. | |
open | <entry_id> | opens native Outlook window; --screenshot writes a PNG | yes | GDI screen grab, not a Playwright screenshot — requires an active, unlocked session. Returns screenshot_error on failure. | |
send | --to --subject --body | saved to Drafts unless --confirm-send | no | --attach FILE ... for local file attachments. Confirm with user before adding --confirm-send. | |
reply | <entry_id> --body | saved to Drafts unless --confirm-send | no | Never pass --confirm-send by default. --all for reply-all. --attach FILE ... for local files, --attach-email ID ... for other Outlook items as .msg. | |
forward | <entry_id> --to | saved to Drafts unless --confirm-send | no | Never pass --confirm-send by default. --body adds an optional note. --attach FILE ... for local file attachments. | |
move | <entry_id> --folder | mutates mailbox state | yes (same target) | Folder path supports nesting (Projects/Client). | |
delete | <entry_id> | moves to Deleted Items | yes | Recoverable from Deleted Items. | |
cal-list | --from --to | none | yes | Dates YYYY-MM-DD. --cal <name> for shared calendars (requires config). |
Output contract
- Success: JSON object or array on stdout, exit 0.
- Failure:
{"error": "<message>"}on stdout, exit 1. --prettyreformats stdout but does not change the schema. Do not pass--prettywhen piping to another command — parse the compact JSON directly.
Hard rules for agents
- Never pass
--confirm-sendonsend,reply, orforwardby default — they save to Drafts otherwise. Only add it when the user has explicitly said "send" in the current turn. - Confirm before
--confirm-send. State the recipients, subject, and a one-line body summary, and wait for the user to approve. - Confirm before
deleteof anything that wasn't obviously transient (e.g. a notification the user told you to clean up). - Don't loop
listto scrape the inbox. Usesearchwith a query. Repeatedlistcalls bloat context. - Pass EntryIDs through verbatim. They're opaque tokens — don't truncate, normalise, or quote-escape them.
- Don't assume Outlook is open. If a command errors with a COM dispatch failure, surface the error to the user instead of retrying.
Repo
Canonical source: https://github.com/ChiefStarKid/claude-outlook-bridge
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

