[BUG] Gmail connector rewrites URLs and bare domains in message bodies into google.com/url redirect links
Summary
When creating or updating a draft via the claude.ai Gmail connector (create_draft / update_draft), every URL and bare domain name in the body is saved as a Google redirect link, e.g.
https://www.example.com/page/ → https://www.google.com/url?q=https://www.example.com/page/&source=gmail&ust=1789465765136000&sa=E
The rewritten link is what gets stored and sent, so recipients receive google.com/url links instead of the original URLs.
Steps to reproduce
- Call
create_draftwith plainbody:
````
A1 https://www.example.com/page/
A2 example.com
A3 <https://www.example.com/>
- Fetch the draft with
get_draft(messageFormat: RAW) and decode the MIME.
Actual
- text/plain part: all three lines contain
https://www.google.com/url?q=...&source=gmail&ust=...&sa=E - text/html part: same, rendered as plain text
- Passing
htmlBodywith an explicit<a href="https://www.example.com/page/">also gets its href rewritten; a bare domain inside<code>is wrapped in a redirect<a>. - Email addresses are not affected (they become mailto links).
update_drafton a reply draft also drops the thread association (new threadId) and the quoted original.- Messages previously sent through the connector (send_message) show the same rewritten URLs in the Sent copy's RAW MIME. In one case the plain-text part contains an unescaped
=17(ust^W...), i.e. the rewrite is inserted without proper quoted-printable encoding.
Expected
The body is stored exactly as provided; URLs are not wrapped in google.com/url redirects.
Impact
Any email containing a link (signature website, product page) is sent with Google redirect URLs. We have had to block the connector's write tools with a PreToolUse hook and compose via the Gmail web UI instead.
Environment
- Claude Code desktop app (Code tab), Windows 11
- claude.ai Gmail connector (tools: create_draft, update_draft, send_message)
- Observed 2026-09-04 and reproduced 2026-09-14
Showing cached comments. Read the full discussion on GitHub ↗
3 Comments
Same here, reproduced today (2026-09-16) from Claude Code CLI with the claude.ai Gmail connector, macOS.
Both
send_messageandcreate_draftrewrite every URL inhtmlBody(explicit<a href>) and every bare domain inbodyintohttps://www.google.com/url?q=<url>&source=gmail&ust=...&sa=E. The rewritten link is what gets stored and sent, so every link in a draft or a delivered mail goes through a Google redirect (and Gmail's UI adds a second hop on click). Plain text without a URL is the only thing left untouched.This makes drafts prepared for third parties unusable as-is: the recipient sees google.com redirect links instead of the real URL, and the user has to re-paste every link by hand before sending.
Minimal repro:
send_message(orcreate_draft) to self withhtmlBody<p><a href="https://app.clickup.com/t/abc">card</a></p>, thenget_message/get_draftwith FULL_CONTENT: thehrefis already rewritten in the stored message. When read back, theust=17...parameter sometimes shows with a raw control character (ustfollowed by 0x17) instead ofust=17, which suggests an encoding bug in the rewrite step.Same here.
Same here, it's super annoying