agent-desktop CLAUDE.md

agent-desktop CLAUDE.md is an instructions file for coding agents from lahfir/agent-desktop. It costs 5,828 tokens per session, scanned A, original, Apache-2.0.

A contributor guide for Agent Desktop, a Rust project with a command-line application and several platform-specific components. It lists build, test, formatting, linting, and cross-compilation commands.

In plain words
What is it for?
Use it when building, testing, linting, formatting, or checking Agent Desktop components for macOS, Windows, or Linux.
Why use it?
It helps an agent choose the right checks for the whole project or for a specific component. This reduces the chance of changes working on one platform while failing on another.

Instructions file

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 instructions/lahfir/agent-desktop/claude-md
Clone the repo
git clone --depth 1 https://github.com/lahfir/agent-desktop

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agent-desktop CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lahfir/agent-desktop/claude-md.svg)](https://agentmods.dev/instructions/lahfir/agent-desktop/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/lahfir/agent-desktop/claude-md"><img src="https://agentmods.dev/badge/instructions/lahfir/agent-desktop/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,828 This file is loaded in full into every session.
When invoked 5,828 The same file — it is already loaded in full.
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.05828 $0.05828
Opus 5 $0.02914 $0.02914
Sonnet 5 $0.01166 $0.01166
Haiku 4.5 $0.00583 $0.00583

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

Security

Grade A, and why

agent-desktop CLAUDE.md 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 4d 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.

CLAUDE.md · 425 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Common Commands

cargo build                                    # Debug build
cargo build --release                          # Release build (<15MB target)
cargo test --workspace                         # Run every test (lib, binary, and integration targets)
cargo test --lib --workspace                   # Library unit tests only; SKIPS the agent-desktop binary crate
cargo test -p agent-desktop                    # Binary crate tests (CLI contract, dispatch, batch, policy)
cargo test --lib -p agent-desktop-core         # Test core crate only
cargo test --lib -p agent-desktop-macos        # Test macOS crate only
cargo test test_name                           # Run a single test by name
cargo check -p agent-desktop-core --all-targets --target x86_64-pc-windows-msvc  # Core must cross-compile
cargo check -p agent-desktop-core --all-targets --target x86_64-unknown-linux-gnu
cargo clippy --all-targets -- -D warnings      # Lint (must pass, zero warnings)
cargo fmt --all -- --check                     # Format check
cargo fmt --all                                # Auto-format
cargo tree -p agent-desktop-core               # Verify no platform crate leaks (CI enforces)
bash tests/e2e/run.sh                          # E2E: real binary vs fixture app, verify by observation (needs --release + AX permission)
bash scripts/perf-baseline-compare.sh          # Perf A/B vs merge-base -> report.html (add --apps "Slack,Google Chrome" for Electron coverage)

Run the binary: ./target/release/agent-desktop snapshot --app Finder -i

The E2E harness drives the release binary against a real SwiftUI/AppKit fixture and asserts every effect by independent observation (never the command's own ok:true), covering every ref action in both headless and --headed mode. See tests/e2e/README.md.

Pre-commit Hook

The repo ships a pre-commit hook at .githooks/pre-commit that runs cargo fmt --check, cargo clippy --all-targets -- -D warnings, and cargo test --lib --workspace against staged Rust changes. Wire it up once after cloning:

Read the full file on GitHub · 425 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. 4d ago First seen · 425 lines · 5,828 tokens per session scan A 85bf9e410ace

Subscribe to this mod's changes

agent-desktop CLAUDE.md is an instructions file published in the GitHub repository lahfir/agent-desktop (1,034 stars, last pushed today), licensed Apache-2.0. It adds 5,828 tokens to every session, about $0.0291 per session on Opus 5. 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.