Rules based manager of windows state for Windows 11: position, desktop, pin.
Attention
Project is dirty and will not work out of the box.
Features:
- Place windows by config rules
- Find window by title/path regex
- Use PowerToys FancyZones layouts
- Actions: x, y, width, height, fancyZones monitor/position, pin
- Autoplace new windows after open
- Store/restore opened windows
- Set wallpapers by virtual desktop
- Opened windows stats
- Remember and restore window position per Claude Code session (claude-wt)
- Command line: place, store, restore, stats, claude-wt
Based on MScholtes/VirtualDesktop CLI tool.
I use it with:
Install
With an agent
The repo is also a plugin for Claude Code and Codex. It carries two skills: setup walks
through the install on a Windows machine (dependencies, config, tray), project-add registers
a project in claudeWt.projects.
Claude Code:
/plugin marketplace add popstas/windows11-manager
/plugin install windows11-manager@windows11-manager
Codex CLI:
codex plugin marketplace add popstas/windows11-manager
codex plugin add windows11-manager@windows11-manager
Then run /windows11-manager:setup. The skills live in skills/; to run them from a
working copy instead of the plugin snapshot, link the directory into the agent's skills folder
(ln -s "$PWD/skills/setup" ~/.claude/skills/windows11-manager-setup).
Config
The config is a YAML file — .yaml, never .yml. It is data only: no code runs from
it. Searched in five places, first hit wins:
%APPDATA%\windows-mqtt\windows11-manager.config.yaml
%APPDATA%\windows11-manager\config.yaml
~/.config/windows11-manager.config.yaml
./windows11-manager.config.yaml (current working directory)
<repo>/config.yaml (project root fallback)
Repeated fragments — placement templates and the like — go under the top-level
x-anchors key as YAML anchors and are pulled in with the merge key <<. The key is
stripped after parsing, so nothing under it reaches the manager: it exists only to
carry the anchors. Declaring them there rather than on the first rule that needs them
keeps the rules independent — otherwise the first rule is also the definition and
cannot be moved or deleted without silently breaking its neighbours.
x-anchors:
mon1RightThird: &mon1RightThird
fancyZones: { monitor: 1, position: 3 }
windows:
- <<: *mon1RightThird
titleMatch: Telegram
Two commands help while writing or moving a config:
node src/index.js config-dump [path] [--json] # print the parsed config (anchors resolved)
node src/index.js config-verify <a> <b> # compare two configs, list the differing paths
config-dump without a path dumps whichever config the search order picked — the
answer to "which file is actually being read, and what did it turn into".
config-verify takes a .yaml config or a .json snapshot on either side and prints
each mismatch as a path; it exits with code 1 when anything differs, so a rewritten
config can be proved equivalent to the old one before it is deployed.
Claude Windows Terminals sessions restore
Remembers where the Windows Terminal window of each Claude Code session sat, puts it
back when you re-enter that session, and brings the whole layout back after a crash.
Lives in src/claude-wt/.
Scheme
A daemon ticks once a second and never spawns anything in that loop:
flowchart LR
A[visible window handles] --> B[Windows Terminal windows only]
B --> C[window title]
C --> D{title -> session}
D -->|ccfzf dump| E[session id]
D -->|own title history| E
E --> F[(state file<br/>slot per session)]
F --> G[move window back<br/>position + virtual desktop]
- Poll window handles —
EnumWindows only, no per-window process lookup. A handle is
resolved to a process exactly once in its lifetime, so a steady tick costs ~1 ms.
The full getWindows() sweep costs ~21 ms and is never called in the loop.
- Read the title of terminal windows only. Claude Code sets the terminal title to the
session summary and prefixes it with a status glyph (
✳ ccfzf) while it is working;
the glyph is stripped before any comparison.
- Resolve title → session id: first from the ccfzf dump, then from the module's own
history of titles it has seen. A title claimed by two windows or two equally good
sessions is refused rather than guessed.
- Store a slot per session id — title history, cwd, bounds, virtual desktop number —
in
claudeWt.statePath, written atomically.
- When a window's title settles on a known session, put the window back at the
remembered rectangle and virtual desktop.