PanePilot: a native Rust window manager for macOS with on-device AI
I built PanePilot, a native macOS window manager that keeps your workspace arranged as you open, resize, and close windows. The window engine is written in Rust, the interface uses AppKit, and optional natural-language
I built PanePilot, a native macOS window manager that keeps your workspace arranged as you open, resize, and close windows.
The window engine is written in Rust, the interface uses AppKit, and optional natural-language commands run through Apple Intelligence on your Mac.
Repository: github.com/stevie1mat/PanePilot
A 30-second walkthrough
Watch the demo with sound. The video combines real PanePilot screens with stickman illustrations of window behaviour.
What happens when your workspace changes?
PanePilot looks at the free space on each display and responds to changes:
- Open an app: its window lands in free space, or the layout makes room for it.
- Resize a window: neighbouring windows reflow around your edit.
- Close a window: nearby windows grow into the space it leaves behind.
These are illustrative layouts. Placement respects available space, protected windows, and the minimum sizes apps actually accept.
Each display is arranged separately. You can use adaptive layouts or choose columns, rows, or a main window with a stack. Window gaps are adjustable from 0 to 16 points.
When the windows cannot fit at their allowed sizes, PanePilot stacks the least-used ones rather than squeezing everything into narrow strips. App icons along a stack let you bring a window forward.
Fill Free Space expands the focused window into available room. Close Gaps Now fills the gaps between windows, including along screen edges.
Drag, split, swap, or stack
A translucent preview shows the landing position while you drag.
| Action | What happens |
|---|---|
| Drop into empty space | Fill that space, stopping at neighbours |
| Drop onto another window | Split its space in half, or into thirds near its edge |
| Hold Shift while dropping onto a window | Swap their positions and sizes, including across displays |
| Hold Command while dropping onto a window | Cascade them in the same spot and fill the space left behind |
| Resize a window | Reflow neighbours and snap edges to nearby windows, halves, or thirds |
A window you move by hand is left alone by automation for two minutes. You can also protect an entire app or lock an individual window so automation leaves it in place.
For apps that support their own Merge All Windows command, PanePilot can merge windows into tabs. Undo selects the original tabs and detaches them again.
Ask PanePilot in your own words
You can type requests such as:
Put Finder and Code next to each other.
Make room for my browser.
Apple's on-device Foundation Models interpret the request as a structured action. The Rust command parser validates the fields before executing anything.
Your request
β
Apple Intelligence on your Mac
β
Structured action checked by Rust
β
Window arrangement
The model runs off the UI thread, with a 60-second bound. Its availability is reported in the panel. There is no API key or account requirement, and the request does not leave your Mac.
Ask PanePilot requires macOS 26 and Apple Intelligence. The window-management controls work without the model. Plain commands such as tidy, arrange Safari and Terminal, swap Safari and Terminal, save layout work, and undo are supported too.
Save the workspace you like
PanePilot remembers different kinds of arrangements:
| Feature | What it remembers |
|---|---|
| Saved layouts | A named arrangement of your whole workspace |
| Saved spots | A window position for the current monitor setup |
| Display history | The arrangement to restore when a monitor setup returns |
Place a window in the same spot a few times and PanePilot can ask, βAlways put Mail here?β It asks before saving the spot, and a declined suggestion is not repeated.
It also learns minimum window sizes from what apps actually accept, and remembers the sizes you usually use. Activity counts help decide which windows deserve more room: active time, activations, clicks, keys, and scrolls. These are counts; screen contents and typed text are not recorded. Learned data can be cleared.
Undo and recovery are part of the window engine
Window managers have to deal with apps that refuse a requested size. PanePilot checks the frames the apps actually took after an arrangement.
Save recovery frames β Move windows β Check actual positions
β
βββββββββββββββββ΄βββββββββββββββββ
β β
Fits correctly Refused size causes overlap
β β
Keep the layout Restore the previous layout
and learn the app's limit
Undo Last Action reverses an automatic change. Restore Original Layout and Pause returns the windows to the frames saved before the session's first change and pauses automation.
Recovery frames are written to disk before windows move.
A native app, built around Rust
The window engine, geometry, layout choices, persistence, and command parsing are written in Rust. The control panel and menu bar are native AppKit, called from Rust through objc_msgSend. There is no web view in the panel.
A small Swift helper handles Apple's Foundation Models and macOS login services.
Rust
βββ Geometry: free space, splitting, filling, snapping
βββ Layouts: adaptive arrangement, reflow, stacks
βββ State: spots, layouts, usage, learned sizes, recovery
βββ Commands: parsing and validation
βββ Native AppKit interface
Swift helper
βββ Foundation Models: on-device language requests
βββ ServiceManagement: open at login
The main source files are:
-
src/geometry.rs: free space, fill, split, and snapping. -
src/command.rs: command parsing, regions, and adaptive layouts. -
src/model.rs: persisted settings, spots, layouts, usage, and minimum sizes. -
src/mac.rs: AppKit shell, Accessibility, window enumeration, and the tick loop. -
src/mac/features.rs: arrangement, drag and drop, stacks, and learning. -
src/mac/pages.rs: the native control panel pages. -
bridge/AppleAI.swift: the on-device model and login helper.
The panel brings together Layouts, Saved spots, Protected apps, Usage today, Behaviour, and Permissions. Closing it leaves the app running in the menu bar, without a Dock icon.
Privacy and requirements
PanePilot uses macOS Accessibility permission to control windows. It does not record your screen or the text you type. There is no sign-up, analytics, advertising, or application server. Settings and recovery data stay locally on the Mac.
Requirements:
- Apple Silicon.
- macOS 14 Sonoma or later for window management.
- macOS 26 with Apple Intelligence for Ask PanePilot.
- Accessibility permission granted to PanePilot.
Build and run
Clone the repository and build with Rust and Xcode available:
git clone https://github.com/stevie1mat/PanePilot.git
cd PanePilot
cargo fetch
./scripts/build.sh
open dist/PanePilot.app
The build script uses Cargo's offline mode; cargo fetch caches its dependencies first. You also need an Xcode/SDK version that provides the Swift APIs used by the helper.
For the project checks and local package:
cargo test --offline
cargo clippy --offline -- -D warnings
./scripts/package.sh
Enable PanePilot in System Settings β Privacy & Security β Accessibility. Keep one installed copy at a stable location so macOS can recognise its permission entry.
The local build is ad-hoc signed, not notarized. See the repository's README and validation files for the installation details and recorded QA evidence.
Useful shortcuts:
- ControlβOptionβSpace: open the feature menu.
- ControlβOptionβReturn: fill free space with the focused window.
Explore PanePilot
Browse the source on GitHub β
The README has the full feature guide, real UI screenshots, diagrams, and demo. The source is available to inspect and build.
I'd be interested to hear which workflow you would use it for: a single MacBook display, multiple monitors, or switching between desk setups.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.


