Xcall

From bendrucker/claude · View interactive version

Xcall is an AI agent skill from the GitHub repository bendrucker/claude. Call x-callback-url schemes from the CLI synchronously. Use when invoking macOS app URL schemes (Things, Bear, OmniFocus, etc.).

How to use this skill

Skill file

xcall

Send x-callback-url requests from the command line and receive responses synchronously.

How It Works

xcall is a Swift CLI that builds into a macOS .app bundle. The .app is required because macOS only delivers URL scheme callbacks to registered applications. On first use, run.sh compiles the source into ~/.cache/claude/x-callback-url/xcall.app and registers the callback scheme (xcall-claude://) with Launch Services.

There is one bundle, shared by every consuming plugin, at a path outside the plugin tree. macOS registers exactly one handler for xcall-claude://, and lsregister -f on a second bundle does not take the scheme back from the first, so a per-consumer bundle makes consumers retire each other's copies in turn. The marketplace cache is content-addressed, so a bundle built beside the source loses its registration to a deleted path on the next plugin update.

Sandbox

Neither half of the bridge survives the command sandbox. lsregister cannot reach Launch Services to register the bundle, and a compiled xcall cannot complete the URL-scheme round trip. Both run outside it when xcall-run is the whole Bash command, through its sandbox.excludedCommands entry.

An entry matches the command text from its start. Anything ahead of the path (VAR=value, time, env, timeout) or chained after it keeps the command sandboxed, and the callback is lost. Invoke run.sh by path with nothing ahead of it.

xcall cannot bound its own wait. Any deadline it scheduled would live in applicationDidFinishLaunching, which AppKit never calls when it cannot reach the WindowServer, so the sandboxed case that most needs a deadline is the one where it is never armed. run.sh holds both deadlines instead, from outside the process, and neither phase can wait forever:

Usage

!sh "${CLAUDE_PLUGIN_ROOT}/scripts/bin-path-check.sh" xcall-run

xcall-run "<url>"

| Output | Contents |

| :--- | :--- |

| stdout | x-success query string on success |

| stderr | x-error query string or timeout message |

| Exit codes | 0 = success, 1 = error, 2 = cancel, 3 = build failed, 4 = timed out waiting for the callback |

Examples

Things 3

# Add a todo, get its ID back
xcall-run "things:///add?title=Buy%20milk"
# stdout: x-things-id=ABC123

# Update a todo, confirm it applied
xcall-run "things:///update?id=ABC123&auth-token=TOKEN&completed=true"
# stdout: x-things-id=ABC123

# Batch create via JSON
xcall-run "things:///json?data=..."
# stdout: x-things-ids=["ABC123","DEF456"]

Bear

# Create a note and get its ID
xcall-run "bear://x-callback-url/create?title=Meeting%20Notes&text=..."
# stdout: identifier=ABC-123&title=Meeting%20Notes

x-callback-url Protocol

The x-callback-url protocol defines three callback parameters.

xcall appends these using its registered xcall-claude:// scheme.

Supported Apps

Any macOS app that supports x-callback-url and lacks a CLI:

Apps with their own CLI (e.g., Shortcuts via shortcuts run) don't need xcall — use the CLI directly.

Build Details

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.