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.
In this repository3 other files it gives its agents.
- docs/AGENTS.mdAGENTS.md
- docs/CLAUDE.mdCLAUDE.md
- agent-computer-useSkill
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
- Distinctive: line 71
All output is JSON by default
- Very specific: line 73
Run cd cli && cargo build for a debug build.
- Very specific: line 88
If Rust files changed: cargo test
≈ “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.
Files
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 workflowsQuick 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 runsWorking on the CLI
Rust code lives in cli/. The workspace has:
agent-computer-use(crate) — produces theagent-cubinary, CLI args, handlersagent-computer-use-core— platform-agnostic types (Platform trait, AccessibilityNode, Selector, element utilities)agent-computer-use-macos— macOS backend (AXUIElement, CGEvent, batchAXUIElementCopyMultipleAttributeValues)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 nativesnapshot.rs— ref assignment, path-based caching, CDP element taggingwait.rs— polling, chain resolution, smart ranking, path resolutionselector_dsl.rs— selector DSL parser (supportsid~=,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 JSdetect.rs— Electron detection (bundle check + process args), auto-relaunch with CDPlib.rs—ElectronAwarePlatformdecorator that intercepts Platform methods for CDP apps
CLI design:
-aflag for app everywhere (no positional app args)-sflag for selector ontypeclickhandles both AXPress and coordinate fallback (no separatepresscommand)--cdp,--cdp-port,--no-cdpare 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 devNext.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.
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
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.

