New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Computer use toolkit for driving desktop environments through Claude's vision and action API with screenshot capture, mouse/keyboard control, and an autonomous agent loop

version
1.10.3
GitHub stars
350
View on GitHub

Add marketplace

/plugin marketplace add athola/claude-night-market

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install phantom@claude-night-market

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Computer Control Skill

Use Claude's Computer Use API to see and control desktop environments through screenshots and mouse/keyboard actions.

When To Use

  • Automating GUI-based workflows that lack CLI alternatives
  • Testing web applications through visual interaction
  • Filling forms, navigating menus, or interacting with desktop apps
  • Building automation pipelines that need visual verification

When NOT To Use

  • Tasks achievable through CLI or API (no GUI needed)
  • Browser automation better served by Playwright or CDP

Why this stays opt-in. Per docs/inclusive-defaults.md (TRUE-exception category 4), Computer Use takes screenshots and synthesizes keyboard/mouse input: cross-process side effects that must always be explicitly invoked, never default-on.

Architecture

The computer use system has three layers:

  1. Display Toolkit (phantom.display) - executes OS-level actions via xdotool/scrot on the real or virtual display
  2. Agent Loop (phantom.loop) - manages the conversation cycle between Claude API and the display toolkit
  3. CLI (phantom.cli) - command-line interface for running tasks or checking environment readiness
User Task
    |
    v
Agent Loop  <---->  Claude API (beta)
    |                   |
    v                   v
Display Toolkit    tool_use responses
    |              (click, type, screenshot)
    v
OS Commands (xdotool, scrot)
    |
    v
Display (X11 / Xvfb / WSLg)

Quick Start

Check environment

cd plugins/phantom
uv run python -m phantom.cli --check

Run a task

export ANTHROPIC_API_KEY="sk-ant-..."
uv run python -m phantom.cli "Open Firefox and search for Claude AI"

--confirm asks before each action and runs it only on a reply that starts with y or Y. Any other reply, or a closed stdin, rejects it. --budget-usd 0.50 stops the run with budget_exceeded once its estimated API cost passes that many dollars.

Use in Python

from phantom.display import DisplayConfig
from phantom.loop import LoopConfig, LoopHooks, LoopSetup, run_loop


def approve(action: dict) -> bool:
    try:
        reply = input(f"Run {action.get('action')}? [y/N] ")
    except EOFError:  # closed stdin is a no
        return False
    return reply.strip().lower().startswith("y")


result = run_loop(
    task="Take a screenshot of the desktop",
    api_key="sk-ant-...",
    setup=LoopSetup(
        loop_config=LoopConfig(
            model="claude-sonnet-5",
            max_iterations=10,
            budget_usd=0.50,
        ),
        display_config=DisplayConfig(width=1920, height=1080),
    ),
    hooks=LoopHooks(confirm_callback=approve),
)

print(f"Done in {result.iterations} iterations")
print(result.final_text)

API Versions

ModelTool VersionBeta Flag
Opus 4.6, Sonnet 4.6, Opus 4.5computer_20251124computer-use-2025-11-24
Sonnet 4.5, Haiku 4.5, oldercomputer_20250124computer-use-2025-01-24

The resolve_tool_version() function handles this mapping automatically based on the model name.

Available Actions

All versions:

  • screenshot - capture display
  • left_click - click at [x, y]
  • type - type text string
  • key - press key combo (e.g., ctrl+s)
  • mouse_move - move cursor

Enhanced (20250124+):

  • scroll - scroll with direction and amount
  • left_click_drag - drag between coordinates
  • right_click, middle_click, double_click, triple_click
  • hold_key - hold key for duration
  • wait - pause between actions

Latest (20251124):

  • zoom - inspect screen region at full resolution

Safety

Computer use carries risks. Follow these guidelines:

  1. Use a sandbox: Run in Docker or a VM, not your main OS
  2. Limit access: Do not provide login credentials unless necessary, and never for banking or sensitive services
  3. Set iteration caps: Always use max_iterations to prevent runaway API costs
  4. Human approval: For actions with real-world consequences, pass confirm_callback (--confirm on the CLI). It returns True to run the action and False to reject it. on_action only observes actions, and its return value is ignored
  5. Close sensitive apps: Claude sees the full screen via screenshots; close anything private before starting

Environment Requirements

Linux (native or WSL2 with WSLg):

sudo apt install xdotool scrot xclip

Headless (Docker/CI):

# Install Xvfb for virtual display
sudo apt install xvfb xdotool scrot xclip
Xvfb :1 -screen 0 1920x1080x24 &
export DISPLAY=:1

Prompting Tips

  1. Be specific about each step of the task
  2. Add "After each step, take a screenshot and verify" to catch mistakes early
  3. Use keyboard shortcuts when UI elements are hard to click
  4. Provide example screenshots for repeatable workflows
  5. Set a system prompt with domain-specific instructions

Exit Criteria

  • uv run python -m phantom.cli --check exits 0 before any task is launched; if it fails, required OS tools (xdotool, scrot, xclip) are installed or Xvfb is started before proceeding
  • max_iterations set on every run_loop() call; no task launched without an explicit iteration cap to prevent runaway API costs
  • Final result includes result.iterations count and result.final_text confirming the task outcome; empty final_text treated as failure, not success
  • Sensitive applications (password managers, banking, private files) closed before task starts; task prompt does not contain raw credentials

From the athola/claude-night-market README

Claude Night Market

Version License: MIT Plugins Skills Claude Code

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

Written for a practitioner: someone who already uses Claude Code and wants to know what these plugins do and whether to install them. If you are new to Claude Code, start with the official docs. For the design rationale behind a plugin, see the book.

Night Market skills in action

Install

Requires Claude Code 2.1.16+ (2.1.32+ for agent teams, 2.1.38+ for security features, 2.1.287+ for the context and loop bands that conserve and egregore draw above the prompt) and Python 3.9+ for hooks, which is what macOS ships.

# Add the marketplace, then install the plugins you want
/plugin marketplace add athola/claude-night-market
/plugin install sanctum@claude-night-market    # Git workflows
/plugin install pensive@claude-night-market    # Code review
/plugin install spec-kit@claude-night-market   # Spec-driven dev

Run claude --init-only once after installing. It runs the plugins' Setup hooks, then exits. Updates are not automatic for third-party marketplaces. The Installation Guide shows how to enable auto-update, and covers the one-command, opkg, and skill-files-only install paths.

If the Skill tool is unavailable, read skill files directly at plugins/{plugin}/skills/{skill-name}/SKILL.md.

Everyday Use

Night Market is built around the loop you already work in. A typical feature runs end to end on a handful of commands:

  1. Start a feature. /attune:mission routes you through brainstorm, specify, plan, and execute phases.
  2. Write the code. imbue enforces a failing test before the implementation is written.
  3. Review before you push. /full-review runs a multi-discipline pass; /refine-code cleans up duplication and dead code.
  4. Ship it. /prepare-pr runs quality gates and drafts a description that says who the change is for, where it lands inside and outside the codebase, and when it is fully integrated.
  5. Pick up where you left off. /catchup rebuilds context from recent git history after a break.

The commands you reach for most:

TaskCommand
Run the project lifecycle/attune:mission
Initialize a new project/attune:arch-init
Review a PR/full-review
Address review feedback/fix-pr
Implement an issue/do-issue
Prepare a pull request/prepare-pr
Write a spec/speckit-specify
Catch up on changes/catchup
Package project knowledge as skills/attune:skill-library
Clean up the codebase/unbloat
Pressure-test a decision/attune:war-room

Full task-by-task walkthroughs are in the Common Workflows Guide.

What's Inside

23 plugins in four layers. Each installs independently, and dependencies pull their shared runtime automatically.

Foundation is the base every other layer builds on: leyline (auth, quotas, error patterns, trust verification), sanctum (git, commits, PR prep, sessions), and imbue (TDD enforcement, proof-of-work, scope guarding).

Utility handles cross-cutting concerns: conserve (context and token optimization), conjure (delegation to seven external model CLIs plus a local runner), hookify (a behavioral rules engine with a security catalog), egregore (autonomous agent orchestration), herald (notifications), and oracle (local ML inference).

Domain is where the day-to-day work happens: pensive (code and architecture review), attune (project lifecycle), spec-kit (spec-driven development), parseltongue (Python), minister (GitHub issues and DORA metrics), memory-palace (knowledge organization), archetypes (architecture paradigms), gauntlet (codebase learning), phantom (computer use), scribe (documentation and slop detection), scry (recordings), tome (research), and cartograph (codebase visualization).

Meta improves the system itself: abstract (skill authoring, hook development, evaluation, and skill-stability tracking).

Plugin architecture across Foundation, Utility, Domain, and Meta layers

The full skill, command, and agent inventory is in the Capabilities Reference.

Safety

⚠️ Plugins run inside your Claude Code session and can read or edit your repo, run shell commands, and call external services. Review any plugin before installing it.

Five guards reduce the blast radius, but none replace your own review:

  • TDD gates (imbue) block implementation writes that lack a failing test.
  • Destructive-command blockers (conserve, hookify) auto-approve safe commands and halt or warn on rm -rf, git push --force, and production-shaped targets.
  • Credential-read denial (conserve) refuses cat, head, grep, rg and git show on .env, .netrc, credential files and SSH keys.
  • External-content sanitizing (leyline) strips invisible characters from web fetches and other external-tool output, and blocks prompt-injection phrases before the model reads them.
  • Additive-bias audits (leyline) flag unjustified additions before commit.

CONSTITUTION.md holds the rules that override any conflicting skill or hook, each paired with what checks it. STEWARDSHIP.md is the maintenance contract.

Network and data

Three parts of the marketplace reach off your machine, and each can be turned off. Two hooks use your existing GitHub credentials, and both do nothing when gh is unauthenticated or the network is unavailable.

  • Star prompt (leyline, hooks/auto-star-repo.sh). On session start it checks whether you have starred this repository, through gh or a GITHUB_TOKEN / GH_TOKEN variable. It reads star status, asks once per session, and never stars without your consent. CLAUDE_NIGHT_MARKET_NO_STAR_PROMPT=1 disables it.
  • Learnings posting (abstract, hooks/post_learnings_stop.py). On session stop, when ~/.claude/skills/LEARNINGS.md has content, it posts a skill-usage discussion through gh and may promote high-severity items to issues. The target is target_repo in ~/.claude/skills/discussions/config.json, else the current repo. It is on by default. auto_post_learnings: false in that file disables it.
  • Delegation (conjure, also reached by attune missions and egregore steps) sends the prompt and the file contents it carries to the first external model CLI that answers, in the order Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, under the credentials you configured for it. It runs by default. CONJURE_DELEGATION=off declines it for one run, and "enabled": false in ~/.claude/hooks/delegation/config.json declines it on one machine. When no provider answers, the work stays on your machine.

Plugin Development

make validate-all
make lint && make test   # checks only; rewrites nothing
make fix                 # ruff format + ruff check --fix

A plugin directory holds .claude-plugin/plugin.json (metadata) plus any of commands/, skills/, hooks/, agents/, workflows/, and tests/, with a Makefile and pyproject.toml. A workflows/ script orchestrates several subagents at once and runs only when you ask for one. Copy the layout from an existing plugin such as plugins/abstract, then see the Plugin Development Guide for structure and naming conventions. Working on this repo needs Python 3.12+ and GNU make 3.82+. The guide covers both, including why Xcode's make 3.81 reports a green build it did not run.

Documentation

Per-plugin pages are in book/src/plugins/.

Stewardship and Contributing

Every plugin is entrusted to the community: steward rather than own, and think several iterations ahead. Each plugin maintains its own tests and docs; run make test at the repo root to execute every suite, and /stewardship-health to view per-plugin health. Contribution guidelines are in the Plugin Development Guide.

Acknowledgements

Night Market builds on Anthropic Claude Code and integrates with github/spec-kit (v1.4.0) and obra/superpowers (v7.0.2, see the integration guide). Its AI involvement is declared under the Quillx disclosure standard as 3/5 (Adapted): human-directed, AI-generated, and meaningfully edited.

License

MIT

Details

Marketplace
athola/claude-night-market
Source
plugins/phantom
Category
Community
Keywords
computer-use, desktop, automation, screenshot, mouse, keyboard, gui
Listed since
Apr 7, 2026

More from athola/claude-night-market

All 23

Similar to phantom

More Workflow Automation