📚 Research Hub
Iran-US War
War Scenarios (48) Western Views Hormuz Closure Iran Assessment
Tech
Vibe Island Perch Spec Drone Guide
Society
Life Trajectories
🐦

Perch — Build Specification

A macOS notch app that monitors all your Claude Code sessions. Approve permissions, answer questions, and jump to terminals — without switching apps.

Swift · AppKit + SwiftUI · Unix Sockets · 3-5 Weeks

Overview

What Perch is, who it's for, and why you'd build it.

What Perch Does
Perch sits in your MacBook's notch (or floats on non-notch displays) and monitors all your Claude Code sessions. When Claude needs permission to run a tool, asks a question, or presents a plan — you handle it from the notch without switching apps. Click any session to jump straight to its terminal.
4
Terminal Apps
2-way
Communication
Concurrent Sessions
3-5w
Build Estimate
🐦 Why "Perch"?
It perches in the notch, watching over your coding sessions like a bird on a wire. Short, memorable, Mac-app-name energy. And it's where Claude comes to roost when it needs your attention.
🎯 Target User
Developers running multiple Claude Code sessions across terminal windows/panes — who are tired of cmd-tabbing to approve permissions and answer questions.
Why Fork Claude Island?
MIT-licensed, already has NSPanel overlay, Unix socket IPC, Claude Code hooks, auto-setup, and markdown rendering. You're adding two-way comms + multi-session + terminal jumping on a proven foundation.

Scope Definition

What's in, what's out, and what that means for effort.

✓ IN SCOPE

  • Claude Codeonly AI tool
  • Multi-sessionunlimited concurrent CC sessions
  • Two-way interactionpermissions, Q&A, plan review
  • Terminal jumping — iTerm2, Terminal.app, Ghostty, Kitty
  • Notch overlaynon-activating NSPanel
  • Floating barfallback for non-notch/external displays
  • Session pickerswitch between active sessions
  • Status indicatorsidle, thinking, tool-use, waiting
  • Markdown plan rendering
  • Sound alertswhen attention needed

✗ OUT OF SCOPE

  • Codex CLI, Gemini CLI, Cursor, OpenCode, Droid
  • Multi-format config handling (TOML)
  • VSIX IDE extension
  • License/payment system
  • 13+ terminal apps (4 is enough)
  • Custom sound packs (basic alerts only)
  • Pixel art / animated sprites
  • Token/cost tracking
  • Analytics / telemetry
Effort Reduction
Cutting 5 of 6 agents, TOML config parsing, VSIX extension, licensing, and 9+ terminal apps drops the build from 8-12 weeks (Vibe Island parity) to 3-5 weeks. The biggest remaining effort is terminal jumping + two-way interaction.

Perch vs Vibe Island vs Claude Island

FeatureClaude Island (base)Perch (your build)Vibe Island ($20)
AI AgentsClaude CodeClaude Code6 agents
Multi-sessionNoYesYes
Two-way interactionRead-onlyFullFull
Permission approvalNoYesYes
Q&A from notchNoYesYes
Plan reviewYesYesYes
Terminal jumpingNo4 apps13+ apps
Notch overlayYesYesYes
Sound alertsNoBasic8-bit synth
PriceFree (MIT)Free (your build)$19.99
Build effortDone3-5 weeks8-12 weeks

Feature Spec

Complete feature list for Perch.

Core Multi-Session Claude Code Control
Session registryTrack all active CC sessions with unique IDs, PIDs, and working directories
Session pickerHorizontal scrollable list in notch showing all sessions with status badges
Permission approvalAllow/Deny buttons when CC requests tool execution (Bash, Edit, Write, etc.)
AskUserQuestion responseOption buttons + free-text input rendered in notch panel
Plan reviewExpandable markdown view of CC plans with approve/reject actions
Status trackingPer-session state: idle, thinking, tool-use, waiting-for-permission, asking-question
UI Notch Interface
Notch overlayNSPanel in notch area, non-activating, never steals focus
Compact modeCollapsed: shows session count + attention-needed badge
Expanded modeClick to expand: session list, active session detail, interaction panel
Floating barFallback for external monitors and non-notch Macs
Attention pulseGentle glow animation when a session needs input
Session color codingEach session gets a unique color for quick identification
Navigation Terminal Jumping
iTerm2AppleScript: activate window, select tab, select pane by session ID
Terminal.appAppleScript: activate window, select tab
Ghostty 1.3+Ghostty IPC protocol for window/tab focus
Kittykitten @ remote control for window focus
Audio Alerts
Permission neededDistinct sound when CC is waiting for tool approval
Question askedSound when CC asks a question via AskUserQuestion
Session completedChime when a CC session finishes its task
Error/crashAlert sound when a session errors
Setup Configuration
Auto-setupOn first launch, writes hook config to ~/.claude/settings.json
Zero-configNo manual setup required; hooks auto-installed
Menu bar iconQuick access to settings, session list, quit

Architecture

How Perch works under the hood.

Event Flow
Claude Code → Hook (shell script) → Unix Socket → Perch Event Parser → Session State Machine → UI Update
User Action (Allow/Deny/Answer) → Perch → Unix Socket response → Hook returns to Claude Code

Two-Way Communication Detail

/* Permission Flow */
CC requests Bash("rm -rf /tmp/test") → hook fires pre_tool_use
  → Perch shows: "Bash: rm -rf /tmp/test" [Allow] [Deny]
  → User clicks Allow → hook returns exit 0
  → User clicks Deny → hook returns exit 2 (BLOCK)

/* Question Flow */
CC calls AskUserQuestion → hook fires notification
  → Perch shows question + option buttons
  → User selects option → response written to stdin/socket

/* Multi-Session */
Each CC session gets unique session_id from hook env vars
  → Perch maintains Map<SessionID, SessionState>
  → UI shows all sessions, highlights ones needing attention

System Components

🔌 Socket Server
  • Unix domain socket at /tmp/perch.sock
  • Accepts JSON event messages from hook scripts
  • Returns responses for two-way hooks (permissions, Q&A)
  • Each connection tagged with session ID
🛠 Hook Scripts
  • Auto-installed to ~/.claude/settings.json
  • PreToolUsesends tool name + args, waits for allow/deny
  • PostToolUsesends result for status update
  • Notificationsends questions, plan mode events
  • Stopsession ended, clean up
🎨 Notch Panel
  • NSPanel + .nonactivatingPanel
  • SwiftUI views via NSHostingView
  • Collapsed: session dots + attention badge
  • Expanded: session list + interaction panel
  • Core Animation transitions
📋 Session Manager
  • Registers new sessions on first hook event
  • Tracks state per session (idle, thinking, waiting)
  • Maps session ID → terminal app + window/tab/pane
  • Cleans up on session end or timeout
  • Publishes state changes to UI via Combine/ObservableObject
💻 Terminal Jumper
  • iTerm2: AppleScript — tell app "iTerm2" to select session id
  • Terminal.app: AppleScript — activate + select tab
  • Ghostty: IPC via ghostty +ipc
  • Kitty: kitten @ focus-window --match id:X
🔊 Alert System
  • NSSound or AVAudioPlayer for bundled .aiff/.wav
  • 4 distinct alert types (permission, question, done, error)
  • Respects macOS Do Not Disturb
  • Optional: mute when terminal is focused

Build Spec

Technical requirements to build Perch.

Development Environment

🛠 Tools
  • Xcode 15+
  • macOS 14+ SDK (Sonoma)
  • Apple Developer account (for signing)
  • Swift 5.9+
📦 Dependencies
  • Swift NIOUnix socket server
  • swift-markdownPlan rendering
  • DynamicNotchKitNotch UI helper (MIT)
  • All system frameworks (AppKit, AVFoundation, CoreAnimation)

Component Build Matrix

ComponentTechnologyComplexityEst. Time
Notch panel + floating barNSPanel + SwiftUIMedium3-4 days
Unix socket serverSwift NIOMedium2-3 days
Hook scripts + auto-installerShell + JSON config writeLow1 day
Event parserSwift CodableLow1 day
Session state machineSwift enum + CombineMedium2-3 days
Multi-session UISwiftUI list + badgesMedium2-3 days
Permission approval UISwiftUI + socket responseMedium2-3 days
Q&A response UISwiftUI + socket responseMedium2-3 days
Markdown plan viewerswift-markdownLow-Med1-2 days
Terminal jumping (4 apps)AppleScript + IPCHigh5-7 days
Sound alertsNSSound / AVAudioPlayerLow1 day
Notch geometry + fallbackCGDisplay APIsLow-Med1-2 days
Menu bar integrationNSStatusItemLow0.5 day
Two-Way Hook Implementation
Claude Code hooks support blocking: a PreToolUse hook can return exit 0 (allow) or exit 2 (block). The hook script connects to the Unix socket, sends the tool request, and blocks waiting for Perch to respond. When the user clicks Allow/Deny in the notch, Perch writes the response back and the hook exits. This is the key mechanism enabling two-way control.

Build Plan

3 phases, 3-5 weeks total. Ship early, iterate.

Phase 1 Core + Two-Way
~1.5 weeks

Goal: Single CC session with full two-way control in notch.

  • Fork Claude Island repo
  • Refactor existing socket server for bidirectional communication
  • Add PreToolUse blocking hook with Allow/Deny UI
  • Add AskUserQuestion response UI (option buttons + text input)
  • Update notch panel to show permission/question prompts
  • Test end-to-end: CC requests permission → Perch shows → user clicks → CC continues

Milestone: Demo video of approving a Bash command from the notch.

Phase 2 Multi-Session + Jumping
~2 weeks

Goal: Run 3+ CC sessions, see all in notch, jump to any terminal.

  • Build session registry (Map<SessionID, SessionState>)
  • Session picker UI in notch (horizontal scroll, color-coded dots)
  • Attention badge system (pulse when session needs input)
  • Terminal jumping: iTerm2 (AppleScript), Terminal.app (AppleScript)
  • Terminal jumping: Ghostty (IPC), Kitty (kitten @)
  • Session → terminal mapping (detect which terminal launched which CC session)
  • Floating bar fallback for non-notch displays

Milestone: 3 concurrent CC sessions, approve permissions on any, click to jump to terminal.

Phase 3 Polish + Ship
~1-1.5 weeks

Goal: Production quality. Ready for daily use.

  • Sound alerts (4 types: permission, question, done, error)
  • Markdown plan viewer with approve/reject
  • Menu bar icon + settings panel
  • Edge cases: CC crash recovery, orphaned sessions, display changes
  • Auto-setup improvements (detect existing hooks, merge safely)
  • Multi-display handling (notch on laptop, floating on external)
  • Code signing + notarization for distribution
  • README + installation guide

Milestone: Ship v1.0 as signed .dmg.

Risk: Terminal Jumping
Terminal jumping is the most unpredictable component. iTerm2 and Terminal.app have stable AppleScript APIs. Ghostty and Kitty IPC may require experimentation. Budget 1-2 extra days for edge cases (tmux panes, split windows, multiple tabs).

Fork Strategy

What Claude Island gives you for free, and what you need to build.

✓ Get Free from Claude Island
  • NSPanel notch overlaynon-activating, positioned
  • Unix socket serverbasic IPC infrastructure
  • Claude Code hooksshell scripts + auto-installer
  • Event parsingJSON decoding of CC events
  • Status displaybasic state rendering in notch
  • Markdown renderingplan/message display
  • Auto-setupfirst-launch hook configuration
  • Dark/light themematches macOS appearance
🔨 Build Yourself
  • Bidirectional sockethooks block and wait for response
  • Permission UIAllow/Deny with tool details
  • Q&A UIOption buttons + text input
  • Multi-session registrysession tracking + lifecycle
  • Session picker UIhorizontal list + color coding
  • Terminal jumping4 terminal app integrations
  • Sound alerts4 event-type sounds
  • Floating bar fallbacknon-notch display mode

Claude Island Repo

github.com/farouqaldori/claude-island
License: MIT — free to fork, modify, and distribute (even commercially)
Language: Swift
Framework: AppKit + SwiftUI
Stars: Active development, regular updates
Key files to study: NSPanel setup, socket server, hook installer, event parser

Alternatives to Forking

OptionProsConsRecommendation
Fork Claude Island Fastest start, proven foundation, MIT license Inherit their code style/decisions Best option
Fork AgentNotch Already has multi-agent, uses OpenTelemetry OTLP-based (different IPC pattern), more complex Consider
Build from scratch Clean architecture, no inherited debt 2-3x longer, reinventing solved problems Avoid
Use DynamicNotchKit only Just the notch UI library, build the rest Still need socket, hooks, event system from scratch If Claude Island doesn't fit
Bottom Line
Fork Claude Island. It gives you ~40% of Perch for free. Spend your 3-5 weeks on the hard parts: two-way comms, multi-session, and terminal jumping. Ship a signed .dmg that does one thing better than anything else: let you run multiple Claude Code sessions and control them all from the notch.