Reverse engineer AirPods head tracking to control a mouse on Linux

A Redditor used Claude Code for an afternoon to get AirPods 3 gyro data streaming on Linux at 200 Hz, something no open source project supported, and turned it into a mouse driver.

Done withClaude Code· Nov 5, 2026

What they did

The poster wanted to move their mouse cursor on Linux by turning their head, using the gyroscope AirPods carry for spatial audio. Every open source project they found said AirPods 3 were not supported, so they spent an afternoon on it with Claude Code. After many failed attempts they told Claude Code to send background agents through other projects' source code. One of those agents found the answer in iOS framework code: AirPods 3 use a different protocol from the Pro models. Claude Code wrote most of the driver while the poster tested on the real earbuds and made the decisions. The result is published on GitHub as mousepods.

How it went

Two problems turned out to be in the way: the different protocol, and a Bluetooth packet size (MTU) setting under which Linux hid the sensors. Once that was fixed the earbuds streamed motion data at about 200 Hz. The poster runs it at 100 Hz to keep Bluetooth stable and says it feels smooth. It was tested on AirPods 3 and AirPods Pro 2, and it outputs yaw, pitch and roll.

Worth knowing

The breakthrough came from parallel agents reading other codebases, not from the main session guessing. You need the physical hardware in the loop, since only real tests tell you whether a fix worked. The poster says it should work with Pro 3 too but has not tested it, and plans to try feeding it into opentrack for sim racing.

Try it

With Claude Code· 5 parts to fill in

I want to read [sensor data, e.g. head tracking] from [device] on [Linux distro], and existing projects say it is not supported. Start by listing what is known about the protocol. Then send background agents to search the source of [related open source projects or SDKs] for how they talk to this device or close relatives, and report back what each finds. Write a small test tool that tries one hypothesis at a time and prints raw packets. After each attempt, tell me exactly what to run with the real device and wait for my result before the next change. Stop when data streams steadily, then write it up as [a driver or library] with notes on what fixed it.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related