[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-698":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":16,"starSnapshotCount":16,"syncStatus":29,"lastSyncTime":30,"discoverSource":31},698,"claude-desktop-buddy","anthropics\u002Fclaude-desktop-buddy","anthropics","Reference and an example for the Bluetooth API for makers in Claude Cowork & Claude Code Desktop","",null,"C++",2223,374,23,5,0,29,104,549,87,29.72,"Other",false,"main",[],"2026-06-12 02:00:17","# claude-desktop-buddy\n\nClaude for macOS and Windows can connect Claude Cowork and Claude Code to\nmaker devices over BLE, so developers and makers can build hardware that\ndisplays permission prompts, recent messages, and other interactions. We've\nbeen impressed by the creativity of the maker community around Claude -\nproviding a lightweight, opt-in API is our way of making it easier to build\nfun little hardware devices that integrate with Claude.\n\n> **Building your own device?** You don't need any of the code here. See\n> **[REFERENCE.md](REFERENCE.md)** for the wire protocol: Nordic UART\n> Service UUIDs, JSON schemas, and the folder push transport.\n\nAs an example, we built a desk pet on ESP32 that lives off permission\napprovals and interaction with Claude. It sleeps when nothing's happening,\nwakes when sessions start, gets visibly impatient when an approval prompt is\nwaiting, and lets you approve or deny right from the device.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fdevice.jpg\" alt=\"M5StickC Plus running the buddy firmware\" width=\"500\">\n\u003C\u002Fp>\n\n## Hardware\n\nThe firmware targets ESP32 with the Arduino framework. As written, it\ndepends on the M5StickCPlus library for its display, IMU, and button\ndrivers—so you'll need that board, or a fork that swaps those drivers for\nyour own pin layout.\n\n## Flashing\n\nInstall\n[PlatformIO Core](https:\u002F\u002Fdocs.platformio.org\u002Fen\u002Flatest\u002Fcore\u002Finstallation\u002F),\nthen:\n\n```bash\npio run -t upload\n```\n\nIf you're starting from a previously-flashed device, wipe it first:\n\n```bash\npio run -t erase && pio run -t upload\n```\n\nOnce running, you can also wipe everything from the device itself: **hold A\n→ settings → reset → factory reset → tap twice**.\n\n## Pairing\n\nTo pair your device with Claude, first enable developer mode (**Help →\nTroubleshooting → Enable Developer Mode**). Then, open the Hardware Buddy\nwindow in **Developer → Open Hardware Buddy…**, click **Connect**, and pick\nyour device from the list. macOS will prompt for Bluetooth permission on\nfirst connect; grant it.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fmenu.png\" alt=\"Developer → Open Hardware Buddy… menu item\" width=\"420\">\n  \u003Cimg src=\"docs\u002Fhardware-buddy-window.png\" alt=\"Hardware Buddy window with Connect button and folder drop target\" width=\"420\">\n\u003C\u002Fp>\n\nOnce paired, the bridge auto-reconnects whenever both sides are awake.\n\nIf discovery isn't finding the stick:\n\n- Make sure it's awake (any button press)\n- Check the stick's settings menu → bluetooth is on\n\n## Controls\n\n|                         | Normal               | Pet         | Info        | Approval    |\n| ----------------------- | -------------------- | ----------- | ----------- | ----------- |\n| **A** (front)           | next screen          | next screen | next screen | **approve** |\n| **B** (right)           | scroll transcript    | next page   | next page   | **deny**    |\n| **Hold A**              | menu                 | menu        | menu        | menu        |\n| **Power** (left, short) | toggle screen off    |             |             |             |\n| **Power** (left, ~6s)   | hard power off       |             |             |             |\n| **Shake**               | dizzy                |             |             | —           |\n| **Face-down**           | nap (energy refills) |             |             |             |\n\nThe screen auto-powers-off after 30s of no interaction (kept on while an\napproval prompt is up). Any button press wakes it.\n\n## ASCII pets\n\nEighteen pets, each with seven animations (sleep, idle, busy, attention,\ncelebrate, dizzy, heart). Menu → \"next pet\" cycles them with a counter.\nChoice persists to NVS.\n\n## GIF pets\n\nIf you want a custom GIF character instead of an ASCII buddy, drag a\ncharacter pack folder onto the drop target in the Hardware Buddy window. The\napp streams it over BLE and the stick switches to GIF mode live. **Settings\n→ delete char** reverts to ASCII mode.\n\nA character pack is a folder with `manifest.json` and 96px-wide GIFs:\n\n```json\n{\n  \"name\": \"bufo\",\n  \"colors\": {\n    \"body\": \"#6B8E23\",\n    \"bg\": \"#000000\",\n    \"text\": \"#FFFFFF\",\n    \"textDim\": \"#808080\",\n    \"ink\": \"#000000\"\n  },\n  \"states\": {\n    \"sleep\": \"sleep.gif\",\n    \"idle\": [\"idle_0.gif\", \"idle_1.gif\", \"idle_2.gif\"],\n    \"busy\": \"busy.gif\",\n    \"attention\": \"attention.gif\",\n    \"celebrate\": \"celebrate.gif\",\n    \"dizzy\": \"dizzy.gif\",\n    \"heart\": \"heart.gif\"\n  }\n}\n```\n\nState values can be a single filename or an array. Arrays rotate: each\nloop-end advances to the next GIF, useful for an idle activity carousel so\nthe home screen doesn't loop one clip forever.\n\nGIFs are 96px wide; height up to ~140px stays on a 135×240 portrait screen.\nCrop tight to the character — transparent margins waste screen and shrink\nthe sprite. `tools\u002Fprep_character.py` handles the resize: feed it source\nGIFs at any sizes and it produces a 96px-wide set where the character is the\nsame scale in every state.\n\nThe whole folder must fit under 1.8MB —\n`gifsicle --lossy=80 -O3 --colors 64` typically cuts 40–60%.\n\nSee `characters\u002Fbufo\u002F` for a working example.\n\nIf you're iterating on a character and would rather skip the BLE round-trip,\n`tools\u002Fflash_character.py characters\u002Fbufo` stages it into `data\u002F` and runs\n`pio run -t uploadfs` directly over USB.\n\n## The seven states\n\n| State       | Trigger                     | Feel                        |\n| ----------- | --------------------------- | --------------------------- |\n| `sleep`     | bridge not connected        | eyes closed, slow breathing |\n| `idle`      | connected, nothing urgent   | blinking, looking around    |\n| `busy`      | sessions actively running   | sweating, working           |\n| `attention` | approval pending            | alert, **LED blinks**       |\n| `celebrate` | level up (every 50K tokens) | confetti, bouncing          |\n| `dizzy`     | you shook the stick         | spiral eyes, wobbling       |\n| `heart`     | approved in under 5s        | floating hearts             |\n\n## Project layout\n\n```\nsrc\u002F\n  main.cpp       — loop, state machine, UI screens\n  buddy.cpp      — ASCII species dispatch + render helpers\n  buddies\u002F       — one file per species, seven anim functions each\n  ble_bridge.cpp — Nordic UART service, line-buffered TX\u002FRX\n  character.cpp  — GIF decode + render\n  data.h         — wire protocol, JSON parse\n  xfer.h         — folder push receiver\n  stats.h        — NVS-backed stats, settings, owner, species choice\ncharacters\u002F      — example GIF character packs\ntools\u002F           — generators and converters\n```\n\n## Availability\n\nThe BLE API is only available when the desktop apps are in developer mode\n(**Help → Troubleshooting → Enable Developer Mode**). It's intended for\nmakers and developers and isn't an officially supported product feature.\n","claude-desktop-buddy 是一个用于将 Claude Cowork 和 Claude Code 通过蓝牙低功耗（BLE）连接到硬件设备的示例项目。其核心功能包括显示权限提示、最近消息等交互内容，支持 macOS 和 Windows 平台。该项目采用 C++ 编写，并使用 Arduino 框架针对 ESP32 微控制器进行开发，特别适合需要与 Claude 应用程序集成的小型硬件设备开发者。此外，它还提供了一个轻量级且可选的 API，方便用户创建有趣的硬件设备。例如，项目中展示了一个基于 M5StickC Plus 的桌面宠物，可以根据 Claude 中的活动状态做出相应反应，如睡眠、唤醒或对批准请求作出响应。",2,"2026-06-11 02:38:43","CREATED_QUERY"]