space

Commands for managing macOS Spaces, which are separate desktop work areas in Mission Control. They can list Spaces and windows, switch between Spaces, and move windows between them.

In plain words
What is it for?
Use them to inspect Spaces, switch to a numbered Space, move a selected window, or move a window and follow it to the destination Space.
Why use it?
They give an agent a way to organize application windows across desktops instead of leaving that work to manual actions. The commands require explicit consent for actions that bring a Space to the foreground.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/openclaw/peekaboo/space
Clone the repo
git clone --depth 1 https://github.com/openclaw/Peekaboo
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 748 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00748
Opus 5 $0.00000 $0.00374
Sonnet 5 $0.00000 $0.00150
Haiku 4.5 $0.00000 $0.00075

Measured 2d ago against content hash 16cb7898a4e9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

space scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/space.md · 44 lines

How it starts

The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.

peekaboo space

space wraps Peekaboo’s SpaceManagementService (private macOS APIs) to list Spaces, switch among them, and move windows. It’s best-effort—Apple may change these APIs—but it gives agents a reliable hook into Mission Control style workflows.

Subcommands

Name Purpose Key options
list Enumerate Spaces (per display) and, optionally, every window assigned to them. --detailed triggers a per-window crawl so you see which apps live on each Space.
switch Jump to a Space by number. --to <n> (1-based) plus required --foreground consent. The command validates against the current count.
move-window Move an app window to another Space or the current one. --window-id selects an exact window without an app; otherwise use --app or --pid with at most one of --window-title or --window-index. Add --to <n> or --to-current; --follow --foreground explicitly switches to the destination Space after moving.

Implementation notes

  • list --detailed enumerates every running app, lists its windows via applications.listWindows, and maps them back to Spaces using CoreGraphics window IDs. That means it may take a second on multi-display setups but yields accurate assignments.
  • switch and move-window both call SpaceCommandEnvironment.service, which can be overridden in tests; production runs use the live actor that talks to SpaceManagementService.
  • move-window reuses WindowIdentificationOptions, so apps can be resolved via names or PID:1234, and you can specify a particular window by title or index.
  • Plain window placement stays in the background. switch and move-window --follow refuse before inventory lookup or mutation unless --foreground is explicit, because both replace the user's visible Space. MCP callers use the equivalent foreground: true consent.
  • A followed move composes the native move and switch receipts. Confirmed no-change, confirmed change, partial, and indeterminate switch results retain their real dispatch counts and retry semantics instead of being rewritten as a synthetic success.
  • JSON output from list is a compact {spaces:[{id,type,is_active,display_id}]} structure; action subcommands return {action,success,...} payloads that match the arguments you passed (space number, window title, follow flag, etc.).

Read the full file on GitHub · 44 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 44 lines · 0 tokens per session scan A 16cb7898a4e9

Subscribe to this mod's changes

space is a command published in the GitHub repository openclaw/Peekaboo (5,098 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 748 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.