Home
Softono
rockpile

rockpile

Open source Swift
40
Stars
3
Forks
0
Issues
0
Watchers
2 months
Last Commit

About rockpile

๐Ÿฆž A pixel-art companion living in your MacBook's notch โ€” visualizing AI agent activity in real time

Platforms

Web Self-hosted macOS iOS

Languages

Swift

Links

๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡ | ๐Ÿ‡บ๐Ÿ‡ธ English | ๐Ÿ‡ฏ๐Ÿ‡ต ๆ—ฅๆœฌ่ชž

Rockpile Rockpile

A pixel-art companion living in your MacBook's notch โ€” visualizing AI agent activity in real time

macOS 15+ Swift 6 License: MIT Version

GitHub Stars GitHub Forks GitHub Issues GitHub Last Commit


Rockpile Screenshot

Rockpile Features


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 / yesterday Yesterday 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:

  1. Choose language โ€” Chinese / English / Japanese
  2. Choose mode โ€” Local / Monitor / Server
  3. Configure Oโ‚‚ โ€” AI provider, tank capacity, Admin Key (optional)
  4. 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 check
WebSocket ws://:18789 Gateway bidirectional comm

Roadmap

  • [x] v0.1 โ€” Foundation: 3 modes, 7 states, Oโ‚‚ system, setup wizard
  • [x] v1.0 โ€” Rebrand ClawEMO โ†’ Rockpile
  • [x] v1.1 โ€” Session history (footprints), version update flow
  • [x] v1.2 โ€” Footprint system, atomic write persistence
  • [x] v1.3 โ€” Gateway WebSocket, reverse commands, remote activity tracking
  • [x] v2.0 โ€” Dual creature system, Token API monitoring, trilingual i18n
  • [ ] v2.5 โ€” Drag-to-feed, kill switch, progression system
  • [ ] v3.0 โ€” LAN tank visiting, team leaderboard, shared aquarium

Full roadmap at ROADMAP.md.


Documentation

Doc Description
INSTALL.md Installation guide (detailed steps for all 3 modes)
DEVLOG.md Development log (architecture, version history, tech details)
ROADMAP.md Product roadmap

Build & Release

# Development build
xcodegen generate && xcodebuild -project Rockpile.xcodeproj -scheme Rockpile

# Sign + DMG
bash build-release.sh

# Sign + DMG + Apple notarization
bash build-release.sh notarize

# Deploy to local + Mac Mini
bash deploy-to-mini.sh build

Acknowledgments

  • Pixel crawfish sprites generated by AI and hand-tuned
  • Inspired by Notchi, Star Office UI, and other great macOS Notch companion projects
  • Built with XcodeGen for project configuration
  • Packaged with create-dmg

License

MIT License โ€” free to use, modify, and distribute.

Sprite art assets are for this project only and are not covered by the MIT License.


๐Ÿฆž A shrimp in the notch.

Download ยท Install Guide ยท Dev Log ยท Roadmap