Guide

Let Claude Code, Codex and Cursor get 2FA codes on your Mac

Your agent can fill in a sign-in form, but the code goes to your phone or inbox. CodeCatch hands it the code, once you say yes.

You ask Claude Code to sign in to a site and check something. It finds the page, types your email, clicks Send code, and stops. The code is on your phone, and the agent can’t read it.

Short answer: install CodeCatch, turn on Let Agents Ask for Codes in Settings → Agents, and click Connect next to your agent. When a site sends a code, the agent asks CodeCatch for it, and you approve with Touch ID.

Why agents get stuck at 2FA

Two-step sign-in is built to stop anyone who only has your password. An agent is in that spot: it can use the browser, but the code goes to your Messages or your inbox. So it waits for you to type the code, or gives up.

How CodeCatch helps

CodeCatch already catches codes from Messages and mail on your Mac. Now an agent can ask it for one with a short command:

codecatch get github.com

CodeCatch waits for the github.com code, then shows a card with the app that asked, the sender and the time. You click Allow and confirm with Touch ID. The agent gets the code and types it in.

Set it up in three steps

  1. Install CodeCatch and let it read Messages and your mail, as usual.
  2. Open Settings → Agents and turn on Let Agents Ask for Codes. This also installs the codecatch command.
  3. Click Connect next to Claude Code, Codex or Cursor. This adds a small skill the agent reads only when it needs a code. For other agents, copy the text under Other Agents into their instructions.

A green dot means the agent is connected. Cursor also reads Claude Code’s and Codex’s skills, so it is covered once either one is connected. While Let Agents Ask for Codes is off, the rest of the page is dimmed and agents can’t ask.

What you control

  • Every code asks first. Allow takes Touch ID or your Mac password each time.
  • Always Allow skips the prompt for one site, or for all sites, from one app.
  • Allow All Without Asking lets any agent get codes with no prompt. It also needs Touch ID to turn on.
  • Sign-in links have their own switch and start off, because a link signs the agent in as you.
  • Password reset links never go to agents.

How it stays safe

  • The command talks to CodeCatch through a socket only you can open on your Mac. Nothing goes over the network.
  • CodeCatch checks the app that asks by its code signature, and the command checks that it is talking to the real CodeCatch.
  • A code only counts when it comes from the site’s own domain. An email that says “GitHub” but comes from another domain doesn’t count.
  • One request at a time. Three denials in a row turn agent access off. Rules give out at most 20 codes an hour.
  • Request History shows which app asked for which site, and what happened. It never keeps the code.

One honest limit: if a program already has Full Disk Access, it can read Messages and Mail itself. CodeCatch can’t stop that.

For developers and scripts

Pass --json to get the code and details as JSON, and --since to skip codes from before you clicked Send code:

T=$(date +%s)
# click "Send code" on the site, then:
codecatch get github.com --since $T --json

The command waits up to 90 seconds for the code, plus time for you to approve. Exit codes tell a script what to do next: 0 ok, 2 you said no, 3 no code arrived, 4 access is off, 5 not approved in time. codecatch --help has the rest.

Questions

Can an agent read all my codes?

No. An agent asks for one site at a time and gets one code, after you approve it. It can’t list or search your codes, and it never sees your messages.

Does it work when I’m away?

Only if you allow it. Always Allow a site for an app, or turn on Allow All, and codes go out without a prompt, up to 20 an hour. You still see each one in Request History.

Which agents work with it?

Claude Code, Codex and Cursor connect with one click. Any other agent or script that can run a command can use it too: paste the short instructions into its settings.

Do I need to keep CodeCatch open?

CodeCatch runs in the menu bar. If it isn’t running, the command opens it.

Can an agent get a password reset link?

No. Reset links never go to agents. Sign-in links do only if you turn on Sign-In Links in Settings → Agents.

CodeCatch app icon

Let your agent finish the sign-in.

CodeCatch gives it the code, after you say yes.

Free · macOS 15+ · Apple silicon and Intel