agentleFS
kortix-aikortix-ai/agent-computer-use/CLAUDE.md

agent-computer-use

CLAUDE.md65 starsChanged 7 months agoMITView on GitHub

Computer use CLI for AI agents. Built with Rust, distributed via npm. Rust code lives in cli/. The workspace has: Key modules in cli/src/: Key modules in cli/crates/agent-computer-use-cdp/src/: Run cd cli && cargo build for a debug build. Tests: cargo test. Next.js + Tailwind + shadcn. Pages in docs/src/app/. Components in docs/src/components/. Husky pre-commit hook runs automatically: Fix formatting with pnpm format.

The file

We split this CLAUDE.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    All output is JSON by default

    line 71
  2. Very specific:

    Run cd cli && cargo build for a debug build.

    line 73
  3. Very specific:

    If Rust files changed: cargo test

    line 88

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

agent-computer-use

Computer use CLI for AI agents. Built with Rust, distributed via npm.

Repo structure

agent-computer-use/
├── cli/                Rust CLI (Cargo workspace)
│   ├── src/            Main binary, handlers, actions, snapshot, wait, DSL parser
│   └── crates/
│       ├── agent-computer-use-core/  Platform trait, AccessibilityNode, Selector, element utils
│       ├── agent-computer-use-macos/ macOS backend (AXUIElement, CGEvent, batch attribute fetch)
│       ├── agent-computer-use-cdp/   CDP bridge for Electron apps (WebSocket, DOM walker, JS interaction)
│       ├── agent-computer-use-linux/ Linux backend (AT-SPI2)
│       ├── agent-computer-use-windows/ Windows backend (UIAutomation)
│       └── agent-computer-use-mcp/   MCP server wrapper
├── docs/               Next.js docs site
├── benchmark/          E2E benchmarks, stress tests, comparison
├── bin/                JS wrapper + precompiled binaries
├── docker/             Cross-compilation Dockerfiles
├── scripts/            Setup, build, bench scripts
└── .github/            CI/CD workflows

Quick reference

pnpm setup              # first-time setup (checks deps, builds, installs)
pnpm build              # build CLI (release)
pnpm test               # run Rust tests
pnpm lint               # cargo fmt --check + clippy
pnpm format             # auto-format Rust + JS/TS
pnpm dev                # start docs dev server
pnpm check              # lint + test (pre-commit)
pnpm bench              # criterion micro-benchmarks
pnpm bench:e2e          # real-world app benchmarks
pnpm bench:stress       # reliability stress test
pnpm bench:diff         # compare benchmark runs

Working on the CLI

Rust code lives in cli/. The workspace has:

  • agent-computer-use (crate) — produces the agent-cu binary, CLI args, handlers
  • agent-computer-use-core — platform-agnostic types (Platform trait, AccessibilityNode, Selector, element utilities)
  • agent-computer-use-macos — macOS backend (AXUIElement, CGEvent, batch AXUIElementCopyMultipleAttributeValues)
  • agent-computer-use-cdp — CDP bridge (auto-detects Electron, auto-relaunches with debug port, WebSocket connection caching)

Key modules in cli/src/:

  • actions.rs — click, type, drag with CDP-first routing, AXPress-first for native
  • snapshot.rs — ref assignment, path-based caching, CDP element tagging
  • wait.rs — polling, chain resolution, smart ranking, path resolution
  • selector_dsl.rs — selector DSL parser (supports id~=, name~=, css=, >> chains, index=N)

Key modules in cli/crates/agent-computer-use-cdp/src/:

  • connection.rs — WebSocket CDP client with URL caching (~15ms reconnect)
  • dom.rs — JS DOM walker, element tagging (data-acu), click/type/scroll/key via JS
  • detect.rs — Electron detection (bundle check + process args), auto-relaunch with CDP
  • lib.rs — ElectronAwarePlatform decorator that intercepts Platform methods for CDP apps

CLI design:

  • -a flag for app everywhere (no positional app args)
  • -s flag for selector on type
  • click handles both AXPress and coordinate fallback (no separate press command)
  • --cdp, --cdp-port, --no-cdp are power-user overrides (CDP is automatic)
  • All output is JSON by default

Run cd cli && cargo build for a debug build. Tests: cargo test.

Working on docs

cd docs && npm run dev

Next.js + Tailwind + shadcn. Pages in docs/src/app/. Components in docs/src/components/.

Before committing

Husky pre-commit hook runs automatically:

  • Rust: cargo fmt --check + cargo clippy -- -D warnings
  • If Rust files changed: cargo test

Fix formatting with pnpm format.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.