How to answer Claude Code and Codex permission prompts from your phone
Claude Code and Codex stop and ask you things: "Allow this Bash command?", "Which colour would you like?", "Do you trust this folder?". If you're not at the desk, the agent just sits there. Short answer: JoeBro is a fre
Claude Code and Codex stop and ask you things: "Allow this Bash command?", "Which colour would you like?", "Do you trust this folder?". If you're not at the desk, the agent just sits there.
Short answer: JoeBro is a free, open-source Mac workspace for your AI agents (Claude Code, Codex and OpenCode, plus an iPhone app). Its iPhone app shows each agent session as a chat and lets you answer the agent's questions and approve or deny permission prompts from your phone, including from the lock screen. The rest of this post is how it works.
Most tools solve this with hooks that call back to a server. I wanted something that works for any agent that shows a menu in a terminal, with no cooperation from the agent. So JoeBro reads the menu off the terminal screen and answers it with the same keystrokes you would press. This is how that works.
Step 1: get at the terminal
The agents run in a terminal I can control, either tmux or Kitty. JoeBro learns which terminal pane a session belongs to from the agent's own hook events (the session id plus a tmux pane or Kitty window id). If it can't match an agent to exactly one controllable terminal, it refuses to touch it, because sending keys to the wrong pane is worse than doing nothing.
From there it needs only three primitives: read the last N lines of the screen with ANSI stripped, send a key, send a line of text.
Step 2: recognise a menu
Agents draw menus in slightly different ways, so I didn't write a parser per agent. The parser looks at the last 40 lines of the screen and does this:
-
Find the key hint. Near the bottom there is nearly always a line like
Enter to select,Esc to cancel,Tab/Arrow keys to navigateor(y/n). That anchors the menu. If there is no hint (the screen was cut off), a cursor on a numbered row right at the bottom still counts. -
Walk upward collecting options. An option line is an optional cursor glyph (
❯,›,>), an optional number (1.or1)) and a label. Indented lines beneath an option are its description. Rules and box-drawing lines are skipped. -
Handle numbered and unnumbered menus. Numbered menus are answered by pressing the number. Unnumbered ones (the trust prompt:
❯ No, exit/Yes, I trust this folder) are answered with arrow keys: work out the distance from the highlighted row to the wanted one, press up or down that many times, then Enter. -
Find the question. The nearest real line above the options, preferring a line with a
?. Claude's multi-question forms show a☐ Colour ☐ Size ✔ Submitbar, which becomes the header. - Spot free-text options such as "Type something" or "No, and tell Claude what to do", so the phone can offer a text box and type the reply after selecting them.
If fewer than two options come out, or nothing is highlighted in an unnumbered menu, the result is "no menu". A false positive here would mean sending keys into a normal prompt, so I made it strict.
The parser is a pure function from a screen string to a menu (or nothing), which made it easy to test: the test file is just captured screens from the real agents, one per case (question forms, the review screen, permission prompts, trust prompt).
Step 3: answer it
When the phone taps "Approve", the Mac re-reads the screen first (menus change), checks the option still exists, then sends the keystrokes. After a short pause it reads the screen again and returns the next menu if one follows, which is how multi-question forms and the "Review your answers" screen work. The answer is also written into the session as an "Answered: ..." line, because the agents' hooks don't report menu picks.
If a prompt has been waiting for a while, the phone gets a push notification (lock screen and Dynamic Island), with Approve and Deny buttons for agents in a controllable terminal.
What I'd do differently
- Screen scraping is fragile by nature. When an agent changes its menu layout the parser needs a new test case. The fail-safe direction (return nothing) means the cost is "you have to answer at the desk", not a wrong answer.
- A structured approval protocol would be better. Where agents offer one I'd rather use it. The terminal route has the advantage of working with whatever is on screen, today, for all three agents.
JoeBro is GPLv3 and free; the parser is parse_menu in JoeBro/Backend/jb_coding.py. The one-line install (macOS 26+) sets up the app and plugs it into Claude Code, Codex and OpenCode:
curl -fsSL https://joebro.pages.dev/install.sh | bash
Code: https://github.com/joexk1/JoeBro . Short answers to common questions: https://joebro.pages.dev/faq/ (iPhone app: https://github.com/joexk1/JoeBro-Mobile). A star helps other people find it.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.