Using Claude Code to Personalise the Xteink X4
I recently picked up the widely hyped Xteink X4 e-reader, in one of those moments where I can happily justify purchasing more tech in pursuit of improving my life.
Of course I immediately installed the open-source Crosspoint Reader firmware on the device, which led to a novel realisation. (heh)
I love reading on the X4 - it feels great to hold, the eInk screen is crisp and readable, and it fits in my pocket so I can pull it out rather than reaching for my phone.
I put it to sleep when it goes in my pocket, and wake it up when I want to read. Thatโs all good, and stops me accidentally pressing buttons to switch pages in my pocket, but there is a noticeable (2-3 second) delay when waking the device up that adds a tiny bit of friction to an otherwise lovely process.
Wondering whether there was an alternative, I searched the repo, issues and pull requests for any signs of an alternative, maybe a button lock feature so I could keep the page Iโm reading but lock the buttons from being pressed in my pockets. No such luck.
My C++ knowledge is rusty at best, and my time to learn a new codebase, even one as well organised as Crosspoint, is limited, so I was not jumping at the chance to contribute myself. However, having seen a number of pull requests on the repo that were already AI-coded, I thought Iโd try my chances with Claude Code.
So I opened up Claude in plan mode (shift-tab twice) and gave it a very short prompt:
I want to add a โbutton lockโ feature to this firmware (i.e. double tap power button to lock buttons), how would I approach that?
Within moments it had a plan, which on review didnโt touch as much code as Iโd expected it to. I let Claude do its thing and flashed the updated firmware to the device (uvx --with intelhex platformio run --target upload).
There were a few issues - the device didnโt quite refresh properly after locking (a follow-up prompt resolved this), and thereโs no visual indicator that the buttons are locked (maybe something for another time), but it worked.
Iโve used Claude Code and other LLM-coding tools enough to not be super surprised that it was able to do this, but I was surprised that:
- I can own well-built minimal hardware that is great at its one job
- I can install open-source, community maintained firmware on the device
- I can customise that device to do what I want it to do, without necessarily knowing how the firmware is built and structured
In a time where we donโt own or have control over much of the tech in our lives, being able to feel like I can fully customise a device I own felt strangely liberating.
Oh and maybe Iโll tidy this change up and submit a pull request, if I can get over my hesistance to subject other people to vibe-coded PRs.