Memory, routing, orchestration, cost — every piece in daily use, with the measurements attached.
← all explainers
· Yasaswy Nagavolu

Deskflow: One Keyboard, Mouse and Clipboard for a Windows PC and a Mac

Deskflow is a Claude Code skill that shares one keyboard, one mouse and one text clipboard between a Windows PC and a Mac. One file holds the whole setup, a local portal arranges the screens at true scale, and every apply backs up, verifies and rolls back on failure. Here is how it works, how to install it, and what is still only a plan.

developer-toolsclitoolingmacoswindows

Sharing one keyboard and mouse between a Windows PC and a Mac sounds like a solved problem, and then the desk gets real. The cursor will not cross where the two screens really touch. A portrait monitor sits next to a landscape one and the edges do not line up. The Command key does the wrong thing on the other machine. Worst of all, a bad setting can cut the link, and the only keyboard you have is the one that no longer reaches the second machine. This is a small skill I wrote for my own desk, and it is part of the shared mouse and keyboard I promised in part 1 of From Windows to Mac.

How it works: one desk, one file, one safe apply

Deskflow the app shares the keyboard, mouse and text clipboard over your own network. The skill is the part that sets it up and keeps it right: it learns your real monitors, lets you arrange them at true scale, writes the settings for each machine, and undoes a change that breaks the link. Step through the desk below. Everything on it is drawn from real sizes.

ONE DESK, TWO COMPUTERS
MAC1
PC1
PC2
MAC
WINDOWS PC

One keyboard and one mouse, plugged into the PC. The hub is whichever machine they are plugged into.

copied on the PC
PLANNEDMic: the PC microphone as a normal mic on the Mac.
PLANNEDSound: Mac sound out of the PC speakers.

You copy a line of text on the PC. The cursor is on the wide screen.

Set up from a Claude Code chat by the Deskflow skill. The screens above are drawn from real sizes: 800 by 337 mm, 336 by 597 mm and 344 by 222 mm.
The cursor, the keys and the text clipboard cross where the screens really touch. Mic and sound are not built.

Three ideas hold it together.

  • One file is the only state. fleet.json names every machine, its screens, which machine is the hub and how the keys map. Each write is checked against a schema, locked, saved in one piece and counted as a new revision. A machine is stored by name, never by address.
  • One machine writes the file. The owner (by default the machine with the keyboard and mouse) is the only one that edits it. The other machine writes only its own report and receives the file, so two machines never fight over it.
  • Any machine can be the hub. The hub is the machine the keyboard and mouse are plugged into. You can move that role to the other machine with one command. No direction is special.

What fleet.json holds

Here is a trimmed fleet.json for the desk above. The names are generic (pc, mac), the monitor serials are made up, and the product names are the real model names of common monitors.

{
  "version": 1,
  "revision": 7,
  "hubs": { "input": "pc", "clipboard": "pc", "audio": "pc" },
  "displays": {
    "DEL-1A2B3C4D": {
      "name": "AW3423DWF",
      "serial_tail": "0001",
      "inputs": {
        "pc":  { "monitor_id": "DELA212-AB0001A1", "connection": "DisplayPort", "state": "active" },
        "mac": { "monitor_id": "10ACA21A-AB0001A1", "connection": "DisplayPort", "state": "not_detected" }
      }
    },
    "DEL-3C4D5E6F": {
      "name": "DELL U2415",
      "serial_tail": "0004",
      "inputs": { "pc": { "monitor_id": "DELA140-EF0004D4", "connection": "HDMI", "state": "inactive" } }
    }
  },
  "machines": {
    "pc": {
      "os": "windows",
      "monitors": [
        { "id": "DELA212-AB0001A1", "name": "AW3423DWF", "phys": "DEL-1A2B3C4D",
          "w": 3440, "h": 1440, "mm_w": 800, "mm_h": 337, "orientation": "landscape",
          "primary": true, "state": "active" },
        { "id": "DELA196-CD0002B2", "name": "DELL S2721QS", "phys": "DEL-5E6F7A8B",
          "w": 2160, "h": 3840, "mm_w": 336, "mm_h": 597, "orientation": "portrait",
          "primary": false, "state": "active" }
      ],
      "layout": { "offset_mm": { "x": 0, "y": 0 } },
      "keyboard": { "preset": "position" }
    },
    "mac": {
      "os": "macos",
      "monitors": [
        { "id": "0610A05D-9A0003C3", "name": "Color LCD", "phys": "APP-9A8B7C6D",
          "w": 1728, "h": 1117, "mm_w": 344, "mm_h": 222, "scale": 2.0, "orientation": "landscape",
          "primary": true, "state": "active" }
      ],
      "layout": { "offset_mm": { "x": -344, "y": 115 } },
      "keyboard": { "preset": "position" }
    }
  }
}

How to read it:

  • Pixels and millimetres. Every monitor carries its size in pixels and in millimetres. The millimetres are what let the portal draw the screens at true scale and let the cursor cross where the glass really touches.
  • Layout. Each machine has an offset_mm: where its group of screens sits on the shared desk. Here the Mac laptop is 344 mm to the left of the PC and 115 mm lower, so its bottom edge is level with the wide monitor.
  • State. active means the machine is driving the screen now. inactive means it is connected but not in the desktop. not_detected means a machine knows the monitor but cannot see it on that input. asleep and mirrored exist too.

How it recognises a monitor. Each screen reports a maker code and a serial number that are stored inside the screen itself (the standard display identity block). The skill joins them into one key, such as DEL-1A2B3C4D. The key is the same on Windows and on macOS, and it does not change when you move the cable to another port or another machine, so one physical screen stays one screen. What does change per port is the product code, so it is not part of the key. Each machine then records its own input to that screen, with the connection type and the state.

Install and first run

You need Node.js 18 or newer, Python 3, a Windows PC and a Mac on the same network. The skill installs the pinned Deskflow 1.27.0 release for you, so you do not download the app yourself. It downloads only from the official release page and checks the size and the SHA-256 hash before it installs anything. The Mac build is also checked for a valid developer signature and Apple notarization. The Windows installer is unsigned, so there the hash is the only check.

Four facts about the core install, so nothing surprises you:

  • On Windows it needs a PowerShell opened as administrator. On the Mac it needs an administrator account, because it copies the app into /Applications. Without that, it downloads nothing and tells you what to run.
  • If Deskflow is already running, it stops and tells you. Close the app yourself, or add --replace-running.
  • install-core --dry-run prints the plan and changes nothing. Run it first if you want to see what will happen.
  • It never downgrades a newer version on its own.

Step 1, on both machines. Install the skill. The bundle also installs dev-bridge, a small file bridge between the two machines. It is the only way the skill moves files across: the Mac’s screen report goes to the PC, and fleet.json comes back.

npx '@yasaswy.nagavolu/agents' install --bundle deskflow --yes

Step 2, on both machines. Set up dev-bridge once. It needs a shared-folder login between the machines. Run dev_bridge.py setup on each one. On the PC it prints a block to paste into an elevated PowerShell, and on the Mac it prints one sudo step. Then run dev_bridge.py login on the Mac, which asks once for the PC’s sign-in password and keeps it in the Mac’s Keychain. Check with dev_bridge.py status until the share shows as mounted. dev-bridge has its own page of steps. The rest of this article assumes it works.

Step 3, on the PC. Run install-core in a PowerShell opened as administrator. Then run the rest in a normal PowerShell.

python $HOME\.claude\skills\deskflow\deskflow.py install-core
python $HOME\.claude\skills\deskflow\deskflow.py detect
python $HOME\.claude\skills\deskflow\deskflow.py pair cert
python $HOME\.claude\skills\deskflow\deskflow.py install --roles restart,server

install --roles restart is the task that lets the portal’s Apply button restart Deskflow. install --roles server starts the Deskflow server at login. Both run hidden, as your own user, with no admin rights.

Step 4, on the Mac. Run these from the logged-in desktop, not over SSH, so the Mac can see its own screens.

python3 ~/.claude/skills/deskflow/deskflow.py install-core
python3 ~/.claude/skills/deskflow/deskflow.py pair cert
python3 ~/.claude/skills/deskflow/collect_mac.py --send

collect_mac.py --send sends the Mac’s screens and certificate fingerprint to the PC. Now run pair status on both machines and compare the two fingerprints once, by eye. After that there is no prompt to accept anything, and the trust list on each machine holds exactly the other machine.

Step 5, on the PC. Arrange and apply. Run serve, arrange the screens in the portal (next section), press Save, then Apply. One more thing on Windows: the firewall rule that lets the Mac connect is written only by an apply that has administrator rights. A normal run leaves the firewall alone and reports needs_admin. So run this once in an administrator PowerShell, and add --dry-run first if you want to read every statement and its undo:

python $HOME\.claude\skills\deskflow\deskflow.py node apply

The rule covers your local network only, and the skill touches no other firewall rule. Optionally run node install on the PC too. It applies a changed fleet.json at every login and every 5 minutes, so later edits do not need a manual apply.

Step 6, on the Mac. Get fleet.json and start the client. The Mac has no fleet.json until it syncs one from the PC. The client’s login item is written only when that file names this Mac as a client, so the order matters.

python3 ~/.claude/skills/deskflow/deskflow.py fleet sync
python3 ~/.claude/skills/deskflow/deskflow.py node install
python3 ~/.claude/skills/deskflow/deskflow.py doctor

If you ran node install before the sync, run it again. doctor only reads. It prints one line per check with OK, WARN, FAIL or SKIP and the fix for each, so run it on both machines.

Mac permissions. I did not verify what macOS asks of the Deskflow app itself. Watch for a Privacy and Security prompt the first time the client starts, and allow it. The one part the skill prompts for is the optional scroll helper, which fixes a reversed wheel: scroll build, then scroll grant, then switch the helper on under Accessibility and Input Monitoring in System Settings.

Arrange the screens in the portal

serve opens a page on your own machine, on 127.0.0.1 only, so nothing outside the PC can reach it. It draws every monitor of every machine at true scale, in millimetres, in portrait or landscape. You drag the Mac next to the PC screen where it sits on the real desk, press Save, and press Apply.

The portal's desk view: a small Mac laptop screen on the left, a wide landscape PC monitor in the middle and a tall portrait PC monitor on the right, drawn at true scale with a green bar where the cursor can cross between the Mac and the wide monitor.
The real portal on a demo fleet with two PC monitors and a Mac laptop. Sizes are true: a 200 mm ruler is drawn in the corner. The green bar is where the cursor can cross.
  • The cursor crosses only where the real screens overlap, so the edges line up.
  • A banner tells you when a monitor was added or removed since you last saved, and a button snaps the screens back edge to edge.
  • Each real monitor gets one card, with an input per machine and plain chips for its state.
  • Switches per machine cover sharing, start at login, scroll direction (same as the hub or reversed) and the shared clipboard.
  • On a Mac, the skill can measure a reversed scroll wheel and cancel it. That needs a small helper app that you grant Accessibility and Input Monitoring once.
The portal's Physical monitors cards: each real monitor once, with an input per machine, and chips such as On the desk, Driven now, Not detected and Connected, not in the desktop.
The same demo, as one card per real monitor. The wide monitor is also wired to the Mac but not detected there, and a spare monitor is connected but not in the desktop. A phone shows the first card only.

Safe apply, with an automatic way back

An apply is never a blind write. The order is fixed, and every step has a way out.

  1. apply --dry-run prints the links it would write and changes nothing.
  2. The apply guard refuses a layout that would disconnect a shared machine, for example when two screens end up more than 60 mm apart. It names the machine and the gap.
  3. Both Deskflow files are backed up first.
  4. The files are written, and the core restarts.
  5. If a client was connected before, it must reconnect within 30 seconds. If not, the old files come back and the core restarts again.

Each failed apply prints one plain line, such as ROLLED BACK, NOTHING CHANGED, with the reason. The same failed result is not retried until the file changes. The firewall rule, the trust list and the certificate follow the same pattern: plan first, write one statement at a time, read it back, and undo in reverse order on any failure. The skill owns exactly one inbound firewall rule, limited to your local network, and it never touches rules of other programs.

The same change as a loop, from a chat prompt to a verified apply. Every step is a local script, so after your prompt it adds no model tokens. This is the secondary view: the desk above is the main one.

Deskflow
Custom Skill (npx bundle)npx '@yasaswy.nagavolu/agents' install --bundle deskflow
STEP 1/7▸type
Σ 0 tok·$0.00Claude Sonnet 5.5 · loop adds no tokens
Deskflow skill
edit
arrange
save
apply
peer
report
Deskflow link
clipboard
cursor
PLANNED mic
PLANNED sound
Deskflow
Custom Skill (npx bundle)npx '@yasaswy.nagavolu/agents' install --bundle deskflow
STEP 1/7▸type
Σ 0 tok·$0.00Claude Sonnet 5.5 · loop adds no tokens
Deskflow skill
edit
arrange
save
apply
peer
report
Deskflow link
clipboard
cursor
PLANNED mic
PLANNED sound

What works and what is only a plan

KeyboardBuilt

One keyboard types on whichever machine the cursor is on. Command and Option line up with the keys on the other machine by physical position.

MouseBuilt

One mouse crosses between the machines at the screen edge you drew. A reversed scroll wheel on the Mac can be measured and cancelled.

ClipboardText only

Copy text on one machine and paste it on the other. Images do not cross yet.

MicrophonePlan only

A written plan: the PC microphone would act as a normal microphone on the Mac. Nothing is installed.

SoundPlan only

A written plan: sound from every machine would play through the PC speakers. Nothing is installed.

Three things work today. Two are only a written plan.

For mic and sound sharing I have a written plan and a short list of two open source audio engines. I have not picked one, and I have not installed anything or changed any audio setting. I will write about it only once it runs.

Technicals

The real stack behind this build, on record:

  • Agentic harness: Claude Code.
  • Skill name: Deskflow (the deskflow skill), which sets up the open source Deskflow 1.27.0 app. Installed with npx '@yasaswy.nagavolu/agents' install --bundle deskflow.
  • Memory/RAG system: none for the skill itself. The design notes were kept in one-brain, a local memory MCP.
  • Source: the skills/deskflow folder of the @yasaswy.nagavolu/agents package. There is no separate companion repository.