agent-desktop-ffi

agent-desktop-ffi is a skill for Claude Code, Codex from openwong2kim/wmux. It costs 122 tokens per session (2,825 once invoked), scanned A, original, MIT.

A C interface for agent-desktop, allowing programs in languages such as Python, Swift, Node, Go, C++, and Ruby to call it directly.

In plain words
What is it for?
Embedding desktop observation and control in another program through a shared library and C header.
Why use it?
It avoids starting the command-line program for every operation and documents memory ownership, errors, threads, and linking.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Embedding desktop observation and control in another program through a shared library and C header.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/openwong2kim/wmux/agent-desktop-ffi
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.

Any agent
npx skills add openwong2kim/wmux --skill agent-desktop-ffi
Clone the repo
git clone --depth 1 https://github.com/openwong2kim/wmux

Made for: Claude Code, Codex.

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-ffi

README.md
[![agentmods](https://agentmods.dev/badge/skills/openwong2kim/wmux/agent-desktop-ffi/github.svg)](https://agentmods.dev/skills/openwong2kim/wmux/agent-desktop-ffi)
Your own site
<a href="https://agentmods.dev/skills/openwong2kim/wmux/agent-desktop-ffi"><img src="https://agentmods.dev/badge/skills/openwong2kim/wmux/agent-desktop-ffi/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agent-desktop-ffi

Your own site · 80×15
<a href="https://agentmods.dev/skills/openwong2kim/wmux/agent-desktop-ffi"><img src="https://agentmods.dev/badge/skills/openwong2kim/wmux/agent-desktop-ffi.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 122 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,825 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00122 $0.02825
Opus 5.5 $0.00049 $0.01130
Sonnet 5.5 $0.00024 $0.00565
Haiku 4.5 $0.00012 $0.00282

Measured yesterday against content hash 4a2564ce3739, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agent-desktop-ffi 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 yesterday.

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.

native/agent-desktop/skills/agent-desktop-ffi/SKILL.md · 190 lines

How it starts

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

agent-desktop-ffi

Direct C-ABI access to the same operations as the CLI. Build the cdylib with the release-ffi profile:

cargo build --profile release-ffi -p agent-desktop-ffi

The output is target/release-ffi/libagent_desktop_ffi.dylib (.so on Linux, agent_desktop_ffi.dll on Windows) plus a committed C header at crates/ffi/include/agent_desktop.h. The default release profile uses panic = "abort": a Rust panic inside an extern "C" function would SIGABRT the host. release-ffi keeps panic = "unwind", which the panic traps need.

Four reference topics, loaded as needed:

  • ownership.md: who allocates and who frees every pointer the FFI hands back.
  • error-handling.md: errno-style last-error contract, error codes, enum validation, panic boundary.
  • threading.md: host-thread contract, mutation ordering across threads and processes, adapter-bound native handles, AXIsProcessTrusted inheritance.
  • build-and-link.md: prebuilt archives, ABI handshake, struct size validation, C and Python examples.

Observe-act workflow (canonical path)

ad_init(AD_ABI_VERSION_MAJOR)                    // verify header ↔ dylib match
adapter = ad_adapter_create_with_session("s1")   // or ad_adapter_create()
rc = ad_snapshot(adapter, "Finder", 0, 10, false, false, &json_out)
// parse json_out: locate snapshot-qualified refs in data.tree
ad_free_string(json_out)
// build action:
AdAction act = {0}; act.kind = AD_ACTION_KIND_CLICK;
rc = ad_execute_by_ref(adapter, "@s8f3k2p9:e5", &act, 0, &result_out)
ad_free_string(result_out)
ad_adapter_destroy(adapter)

ad_snapshot returns the CLI envelope {version, ok, command, data}. data.tree carries snapshot-qualified refs for interactive elements. Read data.complete before trusting a tree: false means the observation budget ran out and the tree is partial, not an error. ad_snapshot reads the owner selected by surface. On macOS, menu and menubar are application-owned, need no document window, and omit data.window; window-owned snapshots include it. Window targeting, skeleton mode and --root drill-down are not exposed over the ABI. A bare @eN ref returns AD_RESULT_ERR_INVALID_ARGS.

Read the full file on GitHub · 190 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 190 lines · 122 tokens per session scan A 4a2564ce3739

Subscribe to this mod's changes

agent-desktop-ffi is a skill published in the GitHub repository openwong2kim/wmux (448 stars, last pushed yesterday), licensed MIT. It adds 122 tokens to every session and 2,825 once invoked, about $0.0005 per session on Opus 5.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-11-07.

Related

agent-desktop-ffi compared with skills from other repositories

agent-desktop-ffi next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-desktop-ffiopenwong2kim/wmuxSkill448yesterdayMITA122Claude Code, Codex
coding-agents-farmgriddynamics/rosettaSkill373yesterdayApache-2.0B32Claude Code
apitapn1byn1kt/apitapSkill13118d agoApache-2.0A0Claude Code, Codex
x-use-inboxihuzaifashoukat/x-useSkill1815d agoMITA64Claude Code
x-use-engageihuzaifashoukat/x-useSkill1815d agoMITA57Claude Code
x-use-contentihuzaifashoukat/x-useSkill1815d agoMITA48Claude Code
x-use-reviewihuzaifashoukat/x-useSkill1815d agoMITA56Claude Code