How Lookma works: the hands, the manners and the spoken yes
Contents
The launch post covers what Lookma is and why I built it. The short version: you just say what you want, and an agent does it on your real screen, in your own apps, while you watch. Nothing happens in a cloud browser or a virtual machine. You see every step, and you can stop it.
This post is the tour under the hood. The model was capable from the first day, so most of the work went into things I had not planned to spend time on: showing where the agent is about to act, staying out of my way while we share one computer, and deciding what counts as a spoken “yes”. Then I lived with it every day, and that changed two more: when it listens, and how it talks. Here is how each one works, and the bugs that shaped it.
Version one, and four things wrong with it
The first version was thin on purpose. It put a voice layer over an interactive Claude Code session and added a status display in a browser window. I talked, Claude Code worked, the display showed what it was up to.
Using it for real work exposed four problems.
- Most of the work was invisible. The majority of actions were quick steps that never showed up anywhere. The display said the agent was busy, and that was all.
- Approvals got stuck. When Claude Code needed permission, the question sat in a terminal window that I could not find from across the room, let alone answer.
- New Chrome tabs opened behind everything. The agent would open the page I asked for, and I would be looking at something else.
- On the desktop I could not tell where it was acting. A click happened somewhere, a window changed, and I had to work out after the fact what it had touched.
None of these is a model problem. The model was doing the right things. I just could not see them, could not answer its questions, and could not follow its attention. For a tool whose whole point is that you watch it work, that is the product failing.
Owning the hands
The obvious way to operate a Mac from Claude Code is the computer use that Claude Code ships with. I tried it and decided against it, for reasons that are all about this particular use rather than about its quality:
- it hides apps that have not been approved while it acts, which defeats “on my real screen”;
- it asks for approval per app, and only in the terminal;
- it holds a lock that allows one session at a time;
- it returns coordinates in the space of a scaled screenshot, so I would not know exactly where on the real screen an action was going to land.
That last one decided it. If I want to draw a mark on the screen before the click, I have to know the target before the click, in real screen coordinates. The only way to know that reliably is for the click to go through my own code.
So the agent gets a handful of tools, and nothing else for touching the desktop: see, click,
drag, type, key, scroll and open. All of them are carried out by a small Swift app. To
open an app, open presses its icon in the Dock, the way you would. The others work through the
accessibility tree first, the same structure a screen reader uses, and fall back to coordinates
when an element is not exposed there.
Because every action passes through that app, the exact target is known ahead of time. A coral ring and a ghost cursor land on it about 350 ms before anything happens. That is long enough for your eye to get there and short enough that it does not feel like waiting. A drag gets a mark on both ends, where it picks up and where it drops, before the button goes down.
It squinted at every screen
Once Codex could drive Lookma too (more on that below), I asked it to open Maps. It took thirteen seconds, because it was squinting at a photo of my screen before every click: every look sent a full screenshot.
But a Mac already describes itself. Every button, link and text field is in the accessibility tree,
with its name. So now see reads that first, like someone who knows the app, and returns a short
list of elements. A screenshot comes only when the agent asks for one, because the screen really has
no words: a map, a canvas, a row of unlabeled icons. And every action comes back with the app’s new
element list, so the agent does not have to stop and look again after each click.
While I was there, I fixed what made it clumsy. It can right-click, and the menu’s items come first in the list it gets back, so it can pick one straight away. It can drag, inside one app. And scrolling used to move three lines at a time. Now it moves about a page and says where it landed, or that it reached the end.
What it costs
Narrow tools mean more calls, so I measured. In my first measurement, Claude Sonnet, using only the original six tools, ran each task twice, and every run ended with the correct result. The Calculator task enters a multiplication by clicking the buttons:
| Task | Time | Tool calls |
|---|---|---|
| Maps: find a place | 12–14 s | 5 |
| Chrome: a search | about 9.5 s | 4–6 |
| Calculator: a multiplication | 17–22 s | about 20 |
The useful number is where the time goes. The tools themselves took between 0.8 and 5.3 s of each
run. A typical accessibility press takes about 7 ms, and a typical see about 200 ms. The rest is the
model thinking between steps.
Later, once each step marked its target, acted and listed the app again, I added a log line that times every hands step. A step takes from well under a second to about a second and a half. Most of a task is still the agent thinking between steps.
So making Lookma feel faster is less about shaving milliseconds off clicks, and more about giving the agent less to think about, and keeping me in the loop while it works, so ten seconds of work does not feel like ten seconds of silence.
What the hands taught me
Writing a few tools sounds like a weekend. Here is the list of things that took longer.
A press can succeed and do nothing. The accessibility API lets you “press” an element, and it reports success. For some elements, SwiftUI menu buttons in my case, it reports success and nothing happens. Those roles now get a real mouse click instead.
Typing goes wherever the focus is. During one test the agent quit an app, and focus fell through to a chat app with the cursor in the message box. The next thing the agent typed would have gone straight into a conversation. Before typing anything, the hands now check that the frontmost app is the app they mean to type into.
A Space switch is not instant. After switching to another desktop, the window you want is reported before it is actually on screen. The hands wait until it is really there.
Clean up what you turn on. To read some apps properly you set accessibility attributes on them. I once left one switched on in Chrome after exiting. Everything that gets set is now restored on the way out.
The agent should not see its own overlay. The ring and captions are drawn on a window that sits above everything and passes clicks through. They show up in screen recordings, which is what you want for a demo, but they are excluded from the agent’s own screenshots with a ScreenCaptureKit filter. Otherwise the agent ends up reading its own captions.
Permissions belong to the signature, not the app. macOS ties the Accessibility and Screen Recording grants to the code signature. An ad-hoc signed build gets a new identity every time you rebuild, so it loses both grants on every rebuild. The confusing part is that the toggle in System Settings can still look on while the permission does not work.
Stepping aside
An agent that works on your real screen shares one cursor, one keyboard focus and one set of windows with you. If you are typing an email when it decides to bring Maps to the front, it has just interrupted you, and possibly sent your next keystrokes somewhere else.
Lookma reads how long it has been since your last input, from CGEventSource. While you are busy, steps split into two kinds:
- steps that can run without taking the front, such as an accessibility press or
see, go ahead, with a small hint at the edge of the screen so you know something happened; - steps that need the front, such as typing, a drag or a right-click, wait until you have been idle for 3 seconds or you say “go ahead”.
This is a small rule, and it changed how the tool feels more than anything else here. Without it I kept my hands off the computer while the agent worked, which made it a machine I had lent out rather than one I was sharing.
One card for every question
The stuck-approval problem from version one had a harder half that I did not notice at first.
Claude Code used to run inside tmux, in a terminal nobody looked at. Its normal permission requests could be relayed out as structured events, and those were easy to show on screen. But some questions existed only as dialogs drawn in the terminal: the warnings and trust questions Claude Code shows at startup, for example. Nothing announced them. If nobody was looking at that terminal, the session just stopped.
So Lookma read the terminal. Once a second it captured the tmux pane and ran it through one generic parser that recognised a dialog and its options. I checked that parser against 66 real captures. A recognised dialog became the same card as any other approval. Answering one was deliberately timid: arrow keys only, a second look at the pane before pressing Enter, and never an “always” or “don’t ask again” option.
The parser also fixed a bug that I am glad I found on my own machine. An earlier version answered “approve” by picking the first option, because the first option is almost always the yes. The folder-trust dialog lists “No, exit” first. Approving it made Claude Code quit.
It worked, but every start still began with a warning card I had to approve. Now that whole layer is gone. Claude Code runs headless through Anthropic’s Agent SDK, on the same Claude plan, and its permission requests arrive as real requests, one at a time, each waiting for its answer. Codex, the second agent, asks the same way through its app server when it wants to go beyond the folders it is sandboxed to. Nothing is read off a screen any more, and “stop” really stops.
What stayed is the rule. A question can come from two places: the agent, when it wants to use a tool, and Lookma itself, the first time the hands touch an app. Both turn into one card, with one chime and one short spoken prompt, and the answer is routed back the way the question came. Approve always means yes to this one thing, never “always”.
Saying yes out loud
The card can be clicked. But the point was to not need the mouse, so it can also be answered by voice, and that is the part of this project I trusted least and tested most.
The voice side runs on OpenAI Realtime. The speech model hears you, decides you approved, and calls a function. The whole safety question is when to believe that call.
I ran about 500 test sessions with synthetic voices against the raw model, with no rules of mine in between. Three results stood out:
- A lone, rising “approve?”, someone asking rather than telling, was taken as approval 15 times out of 15.
- A “go ahead” spoken 0.3 s after the card appeared, far too soon to have been a response to it, was taken as approval 11 times out of 16.
- The assistant’s own voice, leaking from the speakers back into the microphone, was taken as approval 4 times out of 12.
I had hoped the transcript could tell a question from a statement. The transcriber kept the question mark for 3 of 16 voices.
So the model’s judgment is treated as a request, and a gate in front of it decides. An approval goes through only if all of these hold:
- the transcript is a paired phrase, “yes, I approve”, something nobody says by accident and that does not occur in ordinary talk about the task;
- the card has been on screen for at least 1 second;
- the words are not the assistant’s own voice;
- the transcript is matched to that exact utterance, not to something said earlier.
If any check fails, nothing is sent and the assistant asks again. With that rule, the must-not-approve cases went to 0 false approvals out of 169.
Two bugs then showed up in live use that the synthetic tests had missed, and they pulled in opposite directions.
In the first, an echo of the assistant’s own speech was heard as “Sure.” while it was still asking its question. That was treated as a decline of the startup card, and Claude Code exited. I had guarded approvals carefully and left declines open, on the theory that “no” is the safe answer. It is safe, but a wrong “no” still costs you something you wanted. Declines now pass the same checks.
In the second, I said a real “yes, I approve” while the assistant was still talking, and an over-strict rule refused it because it overlapped the assistant’s speech. The fix was to narrow what counts as suspicious: only an answer that arrives while the assistant itself is voicing an approval phrase. And then to make that window nearly empty, by having the assistant ask just “…Approve?” instead of reading the whole request aloud.
Tip: What I would tell someone building voice consent
Do not let the speech model be the judge. Give it a phrase to listen for, check the transcript yourself, tie the answer to what was on screen and when, and test the refusals at least as hard as the approvals.
It heard too much
At launch, the microphone was always on while Lookma ran, unless you paused it. Then it overheard me talking about Lookma, not to it, saying the voice “doesn’t feel like a real conversation”, and it set out to send a Slack message to someone it had invented. I hit pause about ten seconds in.
The model was doing its best with what it heard. The problem was that it heard everything: whatever was said in the room, meant for it or not, even its own voice coming back through the speakers. Every sound became a question it had to answer, was that for me?, and sometimes it guessed wrong.
So now it waits for my finger. I hold fn and talk, like a walkie-talkie, and when I let go it knows
I am done. No more guessing whether a pause meant “finished” or “thinking”. Pressing fn while it
talks cuts it off mid-sentence. When I want my hands free, a quick tap opens a conversation that
stays open until 20 seconds of quiet, and quiet means nobody talking, no work running and no card
waiting, so it does not close on me halfway through a task. While the key is up the microphone is
off and nothing goes to OpenAI, but the voice session stays warm, so it can still speak up the
moment the work has news. Always listening is still there as an option, --talk always.
There used to be a filter that only let a turn through to the model when its transcript “meant something”, so a cough or an “um” never reached it. It is gone. The voice now hears the audio and decides for itself whether speech was meant for it; when it was not, it passes and says nothing. With the key, that question mostly disappears. The consent gate stays exactly as strict either way. Hearing you speak says nothing about what you meant to say.
One trap if you try it: fn is also the Globe key, and macOS may use it to switch input sources. If you type in more than one language, set “Press Globe key to” to “Do Nothing” in System Settings, and use Control-Space to switch. Lookma’s setup check warns you if it is not.
It talked like a machine
There are two models here: one for the voice, and an agent doing the work. Early on that showed. The voice would report what “Claude says”, like a receptionist relaying messages from the back office. It now speaks in the first person and never names the agent. You hear one assistant that says “I found it” and “I need your approval for this”.
Getting the manners right took longer. At launch, the voice was a terse butler: one sentence or nothing, and silent while it worked. In daily use it did not feel like talking to a person. I would say “open Maps” and get about fifteen seconds of silence before “I’ve opened Maps”.
I rebuilt the voice around one simple idea: it owes me things. A reply to everything I say, and every bit of news from the work, and a debt only counts as paid once I actually heard a true answer. So now it says “OK, opening Maps” right away, and tells me what happened when it happens. If a reply gets lost, it says it again later.
Not everything went smoothly. For a day, its sentences kept stopping halfway through a word. It turned out a limit I had set on reply length counted the audio too, so any two-sentence answer simply ran out. The limit is now only a safety net, far above anything it should say. And it still sometimes says it will do something and then does not start it. I am watching that one before I decide how to fix it.
How it fits together
There are three parts, and two plug-ins.
- A resident Node core. It is the only component that makes decisions. It holds whose turn it is, what has focus, whether you are busy, the open cards, and the pipeline that every hands step goes through.
- A Swift app. It owns the click-through overlay window, the hands, the idle signal, the fn key, and a menu bar item with Pause, Type a Request… and Quit. ⌃⌥P pauses everything from any app, the microphone included.
- The overlay page inside that app. A web page that draws captions, marks and cards, and runs the voice client.
I wanted to use Codex as well as Claude Code, so Lookma now works with either:
lookma --agent codex. Doing it properly meant making both ends plug-ins. The agent that does the
work is one folder: Claude Code, headless through the Agent SDK, or Codex through its app server,
sandboxed to the folders you pass. The voice I talk to is another folder, OpenAI Realtime today.
The contract with an agent is small on purpose: start, prompt, interrupt, close, and a few events
coming back. The agent touches the screen only through Lookma‘s hands, so everything above works the
same whichever one is plugged in. Adding another agent or another voice should be a folder and a
page of docs.
Everything listens on 127.0.0.1 only. Apart from the agent itself, which sees the element lists and the occasional screenshot of the app it works in, the one thing that leaves the machine is voice: your audio while the microphone is open, and the text it reads to you, go to OpenAI.
Where it stands
I use Lookma every day, and it is open source. The launch post has the quick start, and the code is at github.com/liuyoshio/lookma.
It is still rough in places. It runs on macOS only, and only on the main display. A drag works inside one app, not from one app to another. Voice needs an OpenAI key, though typing works without one. And a task of a few steps still takes several seconds, mostly the agent thinking.
When I started, I thought the hard part of a visible agent would be the agent. The model was capable from the first day. The work was in everything around it: showing where it is about to act, waiting when I am in the middle of something, bringing its questions to where I am, being careful about what it takes for an answer, listening only when I mean it, and answering like a person. Those are the same things I would want from a person using my computer while I am in the room.
If you try it, I would love to hear where it breaks for you. Open an issue; that is how the next post gets written.