Automatically Approve Claude Code Permissions in iMessage with Shortcuts

Automating Claude Code in iMessage.

Let me start by saying that you probably shouldn’t do this. I’ve been having a surprisingly good time using Claude Code via its new iMessage channel (which is part of my attempt to recreate OpenClaw with an “OpenClaude” system, more about this here), but I find its permission prompt system fairly annoying. You see, while Claude’s Telegram integration allows you to tap on interactive buttons in a chat to grant Claude permission to do something, the iMessage integration (based on primitive AppleScript) supports no such buttons. As a result, the Claude Code team came up with a simple, but tedious idea: you have to manually type “yes” followed by a randomized authorization code every time.

This is no way to live.

Once again, you probably shouldn’t do this, but I’m one of those sickos running Claude with --dangerously-skip-permissions enabled at all times because the whole point of an agent is to do things on my behalf in the background, and having to micro-manage an agent with constant permission prompts defeats the entire purpose of it. (I’m hoping that auto mode will eventually improve this aspect.) That said, even when running Claude Code with dangerous mode, it’ll still ask you to grant permissions to certain write commands on your computer, which is a reasonable approach.

However, since I’m silly enough to always trust Opus 4.6 at this point and can’t be bothered to type “yes [random code]” too many times in a row, I came up with a simple Shortcuts-based automation to always grant Claude Code permissions in iMessage as soon as they arrive, automatically. Here’s how.

Shortcuts supports a ‘Message’ trigger in Personal Automations that allows you to set up a series of automated actions that run whenever you receive a message from a specific contact that contains a specific string of text. Before going any further, I should also clarify that I use Claude Code in iMessage with a separate Apple ID and SMS forwarding to my Mac Studio server disabled. In my Contacts app, I created a Claude contact set to that Apple ID; Claude’s iMessage integration is set up so that only my Apple ID is allowed to chat with it. Back to Shortcuts: after picking the sender (Claude) and ‘Run Immediately’ as an option for running the automation (so I don’t have even more permission prompts to accept), I entered “Permission request” in the ‘Message Contains’ field. This is based on the message template that Claude Code uses right now; if it changes in the future, this trigger’s text filter will need to be updated.

Setting up the iMessage trigger.

Now comes the (slightly) trickier part: you need to run some actions when a permission request message arrives from Claude, and you’ll have to add these actions manually since the Messages trigger does not allow you to pick an existing shortcut from your library (meaning I can’t share an iCloud.com link with you in this article). It’s not too difficult, though: just copy the actions from the screenshot below.

The most confusing part is the first ‘Text’ action: you’ll want to pick the ‘Shortcut Input’ magic variable from the scrollable toolbar above the keyboard, then tap the variable and choose the ‘Content’ option. This lets the shortcut process the contents of the text message sent by Claude. In this case, we’re using a regular expression that captures the “yes [code]” bit from the message; that part is then used to send a message back to Claude containing the authorization text.

Make sure to configure the first variable correctly.

Once again, be careful! Once you set this up, Shortcuts will automatically reply to Claude Code by granting any authorization request automatically, in the background, without your manual intervention. I personally only use Opus 4.6 with high thinking effort and trust the model to do the right thing, but your mileage may vary with lower thinking levels, Sonnet 4.6, or – God forbid – Haiku 4.5.

I can’t lie: I really like this experience with Claude Code in iMessage. I wish Anthropic figured out how to let Claude send files and images on iMessage (it’s limited to text and URLs right now), but being able to automate Claude + iMessage with Shortcuts or talking through it via Siri and Announce Notifications is pretty incredible. I’ll have more follow-up content for Club members soon, but I haven’t touched OpenClaw in over a week since I set up Claude in iMessage and Telegram, and I’ve enjoyed not having to think about things breaking or fiddly integrations.