How rizulsharma-2003/tamagotchi works
MacTamagotchi is a local-first macOS menu-bar pet and Claude Code companion. The central path is Claude hook setup, hook events delivered over a private Unix socket, and the app reflecting live session activity in Mochi and Patch; users also interact through the menu bar and optional desktop pet. Separate branches cover Ask Mochi, phone linking, room customization, and play/progression. Edges are limited to relationships explicit in the README or shown by the source index/excerpts; many internal details are unsampled.
Main entry points: AssistantController.swift Ask Mochi · IntegrationController.swift Hook setup · CompanionWorld.swift Companion world · PhoneController.swift Phone sync
Components 25
Claude Integration
- Hook setup
Sources/App/Integration/IntegrationController.swift - Hook installer
Sources/TamagotchiCore/Integration/ClaudeHookInstaller.swift - Claude detection
Sources/TamagotchiCore/Integration/ClaudeCodeLocator.swift - Hook helper
Sources/HookHelper/main.swift - Local event bridge
Sources/TamagotchiWire/BridgeClient.swift - Wire events
Sources/TamagotchiWire/WireEvent.swift
Mac Companion
- App environment
Sources/App/AppEnvironment.swift - Menu bar scene
Sources/App/MenuBar/StatusItemController.swift - Scene rendering
Sources/App/Rendering/SceneView.swift - Desktop pet
Sources/App/Desktop/DesktopPetController.swift
World and Progress
- Companion world
Sources/TamagotchiCore/World/CompanionWorld.swift - Progress tracking
Sources/TamagotchiCore/Progress/AchievementEngine.swift - Settings store
Sources/TamagotchiCore/Settings/SettingsStore.swift
Companion Features
- Ask Mochi
Sources/App/Features/Assistant/AssistantController.swift - Helper session
Sources/App/Features/Assistant/BrainSession.swift - Quick commands
Sources/TamagotchiCore/Assistant/QuickCommands.swift - Mac actions
Sources/App/Features/Assistant/MacActions.swift - Room editor
Sources/App/Features/Room/RoomEditorController.swift - Furniture catalog
Sources/TamagotchiCore/Features/FurnitureCatalog.swift - Mini-games
Sources/App/Features/Games/GamesController.swift
Phone Link
- Phone sync
Sources/App/Features/Phone/PhoneController.swift - Link security
Sources/TamagotchiCore/Link/LinkStore.swift - Mochi Pocket
iOS/MochiPocket/ContentView.swift
Other components
- Mac user
- Claude Code
Connections 25
- Mac user → Hook setup: connects Claude
README.md - Hook setup → Claude detection: detects install
Sources/App/Integration/IntegrationController.swift - Hook setup → Hook installer: installs hooks
Sources/App/Integration/IntegrationController.swift - Hook installer → Claude Code: configures hooks
README.md - Claude Code → Hook helper: emits hook events
README.md - Hook helper → Local event bridge: sends event
- Local event bridge → Wire events: transfers JSON
Sources/TamagotchiWire/BridgeClient.swift - App environment → Companion world: owns companion
- Companion world → Progress tracking: records progress
- Companion world → Wire events: consumes events
- App environment → Settings store: uses settings
- Mac user → Menu bar scene: interacts
README.md - Menu bar scene → Scene rendering: renders scene
- Mac user → Desktop pet: pets or moves
README.md - Desktop pet → Scene rendering: hosts scene
Sources/App/Desktop/DesktopPetController.swift - Mac user → Ask Mochi: asks Mochi
README.md - Ask Mochi → Quick commands: parses request
Sources/App/Features/Assistant/AssistantController.swift - Ask Mochi → Mac actions: performs action
Sources/App/Features/Assistant/AssistantController.swift - Ask Mochi → Helper session: sends complex request
Sources/App/Features/Assistant/AssistantController.swift - Mac user → Room editor: customizes room
README.md - Room editor → Furniture catalog: checks furniture
Sources/App/Features/Room/RoomEditorController.swift - Mac user → Mini-games: plays games
README.md - Mac user → Phone sync: connects phone
README.md - Phone sync → Link security: uses link store
Sources/App/Features/Phone/PhoneController.swift - Phone sync → Mochi Pocket: syncs companion