Rockpile
๐ฆ A pixel-art companion living in your MacBook's notch โ visualizing AI agent activity in real time
Install / Use
/learn @ar-gen-tin/RockpileREADME
๐จ๐ณ ไธญๆ | ๐บ๐ธ English | ๐ฏ๐ต ๆฅๆฌ่ช
<img src="docs/images/crawfish.png" width="36" height="36" alt="Rockpile" style="vertical-align: middle;" /> Rockpile
A pixel-art companion living in your MacBook's notch โ visualizing AI agent activity in real time
<br>

What is Rockpile?
Rockpile is a pixel-art crawfish companion that lives in your MacBook's Notch area. It connects to your AI Agent (Claude Code, etc.) via Socket, mapping the agent's thinking, coding, waiting, and error states into real-time sprite animations, emotions, and underwater environment changes.
- ๐ง Agent thinking โ the crawfish ponders deeply
- ๐จ Calling tools โ the crawfish works busily
- โณ Waiting for input โ the crawfish looks around
- ๐ Tokens depleted โ water turns murky, crawfish belly-up...
A shrimp in the notch.
Features
๐ฎ Dual Creature System
Two pixel creatures share the same tank, each tracking a different AI data source:
| Creature | Role | Data Source | |----------|------|------------| | ๐ฆ Hermit Crab | Local AI | Unix Socket / local files | | ๐ฆ Crawfish | Remote AI | TCP / Gateway WebSocket |
๐ Immersive Underwater Scene
- Pixel-art seabed โ sand, swaying seaweed, rising bubbles, light rays
- Oโ-linked โ the more tokens consumed, the murkier the water and fewer bubbles
- Interaction particles โ the two creatures meet and play during idle time, with stars and splashes
๐ Oโ Tank (Token Usage Meter)
A Street Fighter-style pixel health bar that intuitively maps token consumption:
| Oโ % | Color | Water Effect | |-------|-------|-------------| | 100โ60% | ๐ข Green | Clear water, normal bubbles | | 60โ30% | ๐ก Yellow | Darker water, fewer bubbles | | 30โ10% | ๐ด Red blink | Murky water, dim light | | 0% | ๐ K.O. | Belly-up |
Two modes supported:
- Claude Quota โ reads
stats-cache.json, tracks daily subscription quota - Pay-as-you-go โ supports Anthropic / xAI / OpenAI API real usage queries
๐ Three Operating Modes
Mode A: Local Mode B: Remote Dual-Mac Mode C: Server
โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ
โ Agent โ โ Agent โ โ Rockpile โ โ Agent โ
โ Rockpile โ โ Rockpile โ โ ๐ฆ Notch โ โ Rockpile โ
โ ๐ฆ Notch โ โ (no UI) โ โ (monitor)โ โ (no UI) โ
โโโโโโโโโโโโ โโโโโโฌโโโโโโ โโโโโโฌโโโโโโ โโโโโโโโโโโโ
Unix Socket TCP:18790 โ Gateway
โโโโโโโโโโโโโถ โ WebSocket
| Mode | Metaphor | Use Case | |------|----------|----------| | Local | Farm shrimp ๐ | Agent and App on the same Mac | | Monitor | Fish tank ๐ | MacBook displays remote Mac Mini's agent status | | Server | Wild shrimp ๐ | Mac Mini runs Agent, sends events to monitor |
๐ญ 7 States ร 4 Emotions
| State | Trigger | Emotion Variants | |-------|---------|-----------------| | ๐ค Idle | Agent finished task | ๐ ๐ ๐ข ๐ | | ๐ง Thinking | LLM reasoning | ๐ ๐ | | ๐จ Working | Tool calls / code gen | ๐ ๐ ๐ข | | โณ Waiting | Awaiting user input | ๐ ๐ข | | โ Error | Tool call failed | ๐ ๐ข | | ๐ Compacting | Context compression | ๐ ๐ | | ๐ด Sleeping | 5 min inactivity | ๐ ๐ |
Emotions are analyzed in real time by Claude Haiku from user message sentiment, with natural 60-second decay.
๐ค Interaction System
| Action | Effect | |--------|--------| | Click | Context-aware reaction (jump + text) | | Double-click | Heart particles | | Long press | Info card | | Right-click | Feed (+Oโ) |
The two creatures automatically interact during idle time โ bump, chase circles, claw fist-bump, side-by-side sway.
๐ก Gateway Bidirectional Communication
- WebSocket connection to remote Agent (
ws://<host>:18789) - Real-time remote sessions, token details, health status
- Reverse commands โ send messages to remote Agent directly from the Notch
- Auto-reconnect (exponential backoff 1s โ 30s)
- Token authentication (HMAC-SHA256)
๐พ Session Footprints
Sessions are automatically saved after completion, displaying:
- Timestamps (smart format: today
14:32/ yesterdayYesterday 14:32/3/8 14:32) - Token consumption (
1.2K/2.1M) - Tool call summary (
bashยทeditยทgrep +2) - Expandable token breakdown (input / output / cache read / cache write)
๐ Three Languages
- ๐จ๐ณ Chinese
- ๐บ๐ธ English
- ๐ฏ๐ต Japanese
๐ Project Statistics
| Metric | Value | |--------|-------| | Language | Swift 6.0 (100%) | | Source Files | 63 Swift files | | Lines of Code | ~12,600+ | | Sprite Assets | 34 sets (41 images) | | Modules | Core (6) ยท Models (9) ยท Services (19) ยท Views (22) ยท Window (5) | | i18n | ๐จ๐ณ Chinese ยท ๐บ๐ธ English ยท ๐ฏ๐ต Japanese | | Min Deployment | macOS 15.0 Sequoia |
Requirements
| Item | Requirement |
|------|------------|
| OS | macOS 15.0 (Sequoia) or later |
| Hardware | MacBook with Notch (2021+) |
| Xcode | 16.0+ (for building from source) |
| XcodeGen | brew install xcodegen |
Installation
Option 1: DMG Installer (Recommended)
Download the latest .dmg from Releases and drag to Applications.
Signed + Apple notarized. Double-click to open, no security workaround needed.
Option 2: Build from Source
# Clone the project
git clone https://github.com/ar-gen-tin/rockpile.git
cd rockpile
# Install build tools
brew install xcodegen
# Generate Xcode project & build
xcodegen generate
xcodebuild -project Rockpile.xcodeproj \
-scheme Rockpile \
-configuration Release \
build
# Or open in Xcode directly
open Rockpile.xcodeproj # Cmd+R to run
Option 3: Signed Release Build
# Build + sign + DMG
bash build-release.sh
# Build + sign + DMG + Apple notarization
bash build-release.sh notarize
Output at dist/Rockpile-v{version}.dmg.
Quick Start
1. First Launch
Open Rockpile โ the setup wizard appears automatically:
- Choose language โ Chinese / English / Japanese
- Choose mode โ Local / Monitor / Server
- Configure Oโ โ AI provider, tank capacity, Admin Key (optional)
- Install plugin โ Auto-generates Hook plugin to
~/.rockpile/plugins/rockpile/
2. Daily Use
- The crawfish appears beside the Notch โ reflecting Agent status in real time
- Hover / click the Notch โ expand panel for activity log, Oโ usage, session footprints
- Menu bar icon โ quick access to status, pairing code, settings
3. Remote Pairing (Dual-Mac Mode)
MacBook (Monitor) Mac Mini (Server)
1. Choose "Monitor" mode 1. Choose "Server" mode
2. Screen shows pairing code: 1HG-E15W โ 2. Enter pairing code
3. ๐ฆ Starts responding to remote events 3. Plugin auto-installed, restart Agent
Pairing code = Base-36 encoded IP address (e.g. 192.168.1.100 โ 1HG-E15W)
Architecture
Claude Code Plugin (JS)
โ Unix Socket / TCP:18790
SocketServer (BSD Socket, DispatchSource)
โ HookEvent JSON
StateMachine (@MainActor, @Observable)
โ State routing
SessionStore โ SessionData[] โ ClawState / EmotionState / TokenTracker
โ SwiftUI reactive
NotchContentView โ PondView (underwater) + ExpandedPanelView (info panel)
Gateway WebSocket (ws://<host>:18789)
โ Bidirectional
GatewayClient โ GatewayDashboard (health/status/sessions)
โ Reverse commands
CommandSender โ chat.send โ Remote Agent
Tech Stack
| Item | Technology | |------|-----------| | Language | Swift 6.0 (strict concurrency) | | UI | SwiftUI + AppKit | | State | @Observable + @MainActor | | Networking | BSD Socket + URLSession WebSocket | | Animation | TimelineView + Canvas (no Timer leaks) | | Persistence | UserDefaults + Keychain + atomic file writes | | Build | XcodeGen + xcodebuild | | Signing | Developer ID + Hardened Runtime + Notarization |
Project Structure
Rockpile/
โโโ Core/ # Settings, localization, design system, launch
โโโ Models/ # State enums, emotions, session data, token tracking
โโโ Services/ # Socket server, Gateway, emotion analysis, plugin mgmt
โโโ Views/ # Underwater scene, sprite animation, panels, onboarding
โโโ Window/ # Notch window, shape, hit testing
โโโ Assets.xcassets/ # 38 sprite sets (7 states ร 2-3 emotions ร 2 creatures)
โโโ AppDelegate.swift # Lifecycle & mode routing
โโโ RockpileApp.swift # @main entry
Communication Protocols
| Protocol | Port / Path | Purpose |
|----------|------------|---------|
| Unix Socket | /tmp/rockpile.sock | Local mode event transport |
| TCP | 18790 | Remote mode event transport |
| HTTP | 18790 /health | Health
