Building Hermit: An iOS SSH Client Purpose-Built for Claude Code
2026-03-15
It started as a joke. Someone posted a fake Apple keyboard online that only had three keys — 1, 2, and 3. If you use Claude Code, you get it immediately: accept, reject, edit. That’s basically all you need.
I made my own variation: five keys. 1, 2, 3, Escape, and a microphone. Showed it to a friend, laughing — “This is literally all I need now.”
Then the joke became a question: why build hardware when I could build software?
I don’t need a custom keyboard. I need an SSH client with exactly five soft keys and voice input. Connect to my dev machine, attach to a tmux session where Claude Code is running, and interact with it using just those buttons.
That’s how Hermit was born.
What Hermit Actually Is
If you’ve read my earlier posts about remote development from an iPhone, you know the workflow: SSH into your Mac, attach to tmux, interact with Claude Code. I’ve been doing this with Blink Shell for months.
Hermit strips that workflow down to its essence. It’s not a general-purpose terminal emulator. It’s a productivity tool for one specific thing: connecting to remote dev machines and interacting with Claude Code through tmux sessions.
Pull out your phone. Open Hermit. Tap your session. You’re connected. Need to approve a tool call? Tap “1”. Need to cancel? Tap “esc”. Need to dictate a complex instruction? Tap the mic, speak it, proofread, send.
Built in a Single Session
The entire app — spec to working SSH client on a real device — was built in a single Claude Code session.
I started with a detailed spec document covering data models, navigation, views, and architecture decisions. SwiftUI for the UI. Citadel (built on SwiftNIO) for SSH connections. xterm.js in a WKWebView for terminal rendering. iOS 17 minimum, portrait only, dark mode enforced.
The UI
The app is intentionally minimal:
- Session list — hosts grouped with their sessions, tap to connect
- Terminal view — xterm.js taking up most of the screen, ribbon bar of soft keys at the bottom
- Voice input modal — text editor sheet for dictation with a Send button
- Settings — voice provider selection, iCloud sync status
That’s it. No tabs, no split views, no feature bloat.
Data and Sync
One of the decisions I’m happiest with: the entire data model is a single JSON file that syncs via iCloud Drive.
The file lives at iCloud Drive/Hermit/Documents/hermit-data.json. It uses NSFileCoordinator for safe file access and NSMetadataQuery to watch for remote changes. Private keys stay in the iOS Keychain — never in the data file.
Here’s the fun part: since the data file is just JSON in iCloud Drive, a Claude Code session on your Mac can programmatically update your hosts and sessions by writing to that file. Hermit picks up the changes automatically.
SSH Integration
Citadel handles real SSH connections with ed25519 private key authentication. When you tap a session, Hermit opens a PTY shell and runs tmux new-session -As <name> to attach (or create) your tmux session.
Terminal size synchronization turned out to be critical. xterm.js’s fit addon reports the actual dimensions of the phone screen to Swift, which tells the PTY the correct size. Without this, you get an 80-column PTY on a narrower phone screen — text overflows and Claude Code’s status line repeats instead of updating in-place.
The Terminal Rendering Journey
This was the biggest rabbit hole. xterm.js initially loaded from CDN — worked great in the simulator, completely blank on real devices.
Bundled xterm.js, xterm.css, and the fit addon locally into the app. Still blank. Turned out the stub SSH data was being written before xterm.js finished loading.
The fix: a ready-signal system. xterm.js sends a “terminalReady” message to Swift via the WKWebView bridge. The WebViewStore buffers all incoming data until that signal fires. Once it does, everything flows through and you get a real terminal on your phone.
The Soft Keys
The default ribbon: 1, 2, 3, esc, mic.
Getting the keystrokes right was its own challenge. Initially I sent "1\n" — a character plus newline. Didn’t work. Claude Code reads single characters in raw mode for its approval prompts. Changed to bare keystrokes ("1", "2", "3") and everything clicked. Escape sends \u{1B}, mic opens the voice input modal.
The buttons are per-host configurable, stored in each host’s RibbonConfig. Different machines can have different ribbon layouts.
Voice Input
Tap the mic on the ribbon bar. A VoiceInputModal opens with a TextEditor — iOS keyboard dictation works great here. Proofread the transcription, tap Send, and the text gets piped to the SSH session with a carriage return.
I had Super Whisper URL scheme integration plumbed in, but honestly iOS built-in dictation is surprisingly good for this use case. I dictate multi-sentence instructions to Claude Code regularly and the accuracy is fine.
Deployment
Fastlane configured with App Store Connect API key auth. One command:
bundle exec fastlane beta
Increments the build number, archives, signs, and uploads to TestFlight. The ITSAppUsesNonExemptEncryption flag in Info.plist means builds auto-approve without compliance prompts.
For fast iteration during development: detect if the iPhone is connected via USB and build directly to device. Fall back to TestFlight when the phone isn’t plugged in.
The Bugs That Bit Me
A highlight reel of things that went wrong:
Bundle ID conflict. com.hermit.app was already taken on the App Store. Switched to com.zeromissionllc.hermit.
Legacy resolution. Missing UILaunchScreen in Info.plist caused the app to render at iPhone 3G resolution. In 2026. The fix was adding an empty dictionary entry.
Citadel version. The spec referenced version 0.26.0, which doesn’t exist. The latest was 0.9.2. Classic AI hallucination in the spec — caught it during package resolution.
Ed25519 key parsing. Wrote a custom OpenSSH private key parser and had an off-by-4-bytes bug in the seed extraction. Four bytes between “SSH works” and “SSH silently fails.”
iCloud entitlements. Needed explicit container ID registration in the Apple Developer portal. The entitlement in the app isn’t enough — Apple needs to know about the container on their end too.
The Recursive Loop
The funniest moment of the whole build: testing the app in the iOS simulator while Claude Code was connected to the same tmux session.
Every action Claude took appeared in the simulated terminal. The simulated terminal’s output went back to Claude. Claude tried to respond to its own output. Infinite loop of self-interaction.
We had to use the real phone for testing approval prompts after that.
Five Keys to a Real Product
By the end of the session, the app was being used to build itself. Dictating instructions into Hermit’s voice modal, approving Claude Code’s tool calls with the 1/2/3 buttons, watching terminal output scroll by on a phone screen.
The five-key joke keyboard became a real product in about eight hours.
Hermit is open source at github.com/gotoplanb/Hermit. The code is public so anyone can review exactly what runs on their device and how SSH credentials are handled. If you find it useful, consider donating to one of the upstream projects that make it possible: Citadel, xterm.js, or SwiftNIO.