Claude Code doesn't use simple text input for its menus. It uses an Ink-based cursor navigation system where you press arrow keys to highlight an option and Enter to select it. This creates a unique challenge for automation — and Remocode's AI Supervisor solves it with a precise keystroke translation pipeline.
How Claude Code's Menus Actually Work
When Claude Code needs approval, it presents a numbered menu in the terminal. But this isn't a standard "type a number" interface. It's built with Ink, React's terminal UI framework, which renders a cursor-based selection widget.
What You See
? Allow Claude to edit src/App.tsx?
1. Yes
2. Yes, and don't ask again for this file
3. NoWhat's Actually Happening
- ●The menu has a cursor (invisible or shown as a highlight) positioned on option 1
- ●Arrow Down moves the cursor down one option
- ●Arrow Up moves the cursor up — and wraps around from the top to the bottom
- ●Enter selects the currently highlighted option
- ●Typing the number "2" does nothing — it's not a text input field
This distinction is crucial. Any automation that tries to type a number will fail silently. The terminal accepts the keystroke but Ink ignores it.
The Early Problem: Raw Numbers
Before Remocode v1.1.3, the Supervisor had a simplified decision handler. When the AI model decided to select option 3, the handler would send the character "3" to the terminal. This worked for some CLI tools but completely failed for Claude Code.
The result: the Supervisor would make the right decision but execute it incorrectly. It would try to select "No" by typing "3", but nothing would happen. Claude Code would sit there waiting, and the Supervisor would detect the same prompt again on the next scan cycle, creating an infinite loop of failed selections.
The Fix: Arrow-Key Translation
Remocode v1.1.3 unified the Supervisor's execution pipeline with the manual test button's pipeline. Now, when the AI model says "select option 3", the Supervisor translates that into actual arrow-key sequences.
The Translation Algorithm
- ●AI model returns the option number (e.g., 3)
- ●Calculate arrow presses: option number minus 1 = number of Down arrow presses
- ●Send keystrokes sequentially with small delays between each:
- ●Down arrow (moves to option 2)
- ●Down arrow (moves to option 3)
- ●Enter (selects option 3)
Why Sequential With Delays?
Ink processes keystrokes one at a time. Sending all arrow keys simultaneously (as a single string) only registers the first one. Each keystroke needs a brief delay to ensure Ink processes it before the next arrives.
The Wrap-Around Problem
Ink menus wrap: pressing Up from option 1 jumps to the last option. The safest approach is to always navigate downward from the top. The Supervisor assumes the cursor starts at option 1 and sends exactly (N-1) Down arrows to reach option N.
The Five Response Types
The Supervisor's execution pipeline handles five distinct response types from the AI model:
1. Yes/No Approval
AI says: "Approve this action" Supervisor does: Sends Enter (option 1 is pre-selected on "Yes")
2. Numbered Menu Selection
AI says: "Select option 2" Supervisor does: Sends 1 Down arrow + Enter
3. Text Response
AI says: "Answer with: Use PostgreSQL with Prisma ORM" Supervisor does: Types the text character by character, then sends Enter
4. Rejection
AI says: "Reject this action" Supervisor does: Sends Escape, which cancels the current prompt
5. Escalation
AI says: "Escalate to human" Supervisor does: Sends nothing to the terminal. Instead, shows the prompt and reasoning in the AI panel for you to review.
The 2-Second Scan Loop in Detail
The scan loop is the Supervisor's heartbeat:
- ●Read terminal — Capture the last 20 lines of visible content
- ●Dedup check — Compare with the previous scan. If identical, skip (zero cost)
- ●Send to AI model — Terminal content + project brief + autonomy level
- ●Parse response — Extract action type, option number or text, and reasoning
- ●Execute — Translate the decision into keystrokes and send to the terminal
- ●Log — Record the decision in the AI panel with full reasoning
- ●Wait — Sleep until the next 2-second tick
The dedup check is critical for cost control. If Claude Code is thinking (terminal unchanged), the Supervisor makes zero AI calls. You only pay for actual decisions.
Debugging Menu Navigation Issues
If the Supervisor selects the wrong option, check these:
Menu Indexing
The AI model might return a 0-indexed or 1-indexed number depending on how the prompt is phrased. Remocode normalizes to 1-indexed (option 1 = first item, no arrow presses needed).
Terminal Rendering Delays
If Claude Code hasn't finished rendering the menu when the Supervisor scans, it might see a partial menu. The 20-line capture window and 2-second scan interval make this rare, but it can happen on slow connections.
Model Accuracy
If the Supervisor frequently makes wrong decisions, try upgrading from your current model. GPT-5-nano handles most cases well, but complex menus with many similar options might benefit from a slightly larger model.
Conclusion
Claude Code's arrow-key menus are a real obstacle for terminal automation. Remocode's AI Supervisor solves this with a keystroke translation pipeline that converts AI decisions into precise arrow-down sequences with proper timing. Combined with the 2-second scan loop, dedup optimization, and full decision logging, it's a reliable way to run Claude Code autonomously without fighting the menu system.
Ready to try Remocode?
Start with a 7-day Pro trial — no credit card required. Download now and start coding with AI from anywhere.
Download Remocodefor macOS