doctor

doctor is a command for Claude Code from omarshahine/apple-pim. It costs 20 tokens per session (891 once invoked), scanned A, original, MIT.

A diagnostic command for an Apple PIM installation, checking its command-line tools, helper app, running processes, permissions, and MCP build.

In plain words
What is it for?
Use it to inspect an installation and, when requested, clear stuck helper processes with its fix option.
Why use it?
It helps identify why the installation or its helper process cannot run, including broken links, missing permissions, and stuck processes.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the apple-pim plugin — 16 skills, 7 commands shipped together

Good fit Use it to inspect an installation and, when requested, clear stuck helper processes with its fix option.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add omarshahine/apple-pim
Claude Code
/plugin install apple-pim

Made for: Claude Code.

Or install apple-pim, the plugin that ships this one along with the rest of its 16 skills, 7 commands.

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 doctor

README.md
[![agentmods](https://agentmods.dev/badge/commands/omarshahine/apple-pim/doctor.svg)](https://agentmods.dev/commands/omarshahine/apple-pim/doctor)
Your own site
<a href="https://agentmods.dev/commands/omarshahine/apple-pim/doctor"><img src="https://agentmods.dev/badge/commands/omarshahine/apple-pim/doctor.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 891 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.00020 $0.00891
Opus 5 $0.00010 $0.00445
Sonnet 5 $0.00004 $0.00178
Haiku 4.5 $0.00002 $0.00089

Measured 2d ago against content hash 14a40f525827, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

doctor 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 2d 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.

commands/doctor.md · 75 lines

How it starts

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

Apple PIM Doctor

Run the end-to-end install diagnostic and interpret the results for the user.

Run it

bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh"

With --fix (only when the user asked to fix, or after showing them a stuck-helper failure):

bash "${CLAUDE_PLUGIN_ROOT}/scripts/doctor.sh" --fix

What it checks, in dependency order

  1. Swift CLI binaries in ~/.local/bin — flags broken symlinks (the classic post-repo-rename failure), missing binaries, and non-executable files. A symlinked install gets a dev-mode warning: it breaks if the source repo is moved, renamed, or cleaned.
  2. PATH visibility of ~/.local/bin.
  3. Apple PIM Helper.app — presence, dispatcher executability, code signature. (Installs made before the rename are named PIMHelper.app; the doctor reports them and tells you to re-run the installer, which renames in place.) The signature matters: macOS TCC binds permission grants to it.
  4. Stuck helper processes — a wedged pim-helper (usually an unanswered permission dialog) blocks every later call with Launch Services error -1712. --fix reaps these.
  5. TCC authorization per domain, prompt-free, on both routes. The direct route is what a normal terminal gets. The helper route is what an agent shell gets, and it carries its own grant, bound to the helper's bundle and signature. Each domain prints one line per route. auth-status only reads the authorization status and never requests access, so probing through the helper cannot raise a dialog. The helper-route probe is skipped, with a warning, while a helper is already resident — only one can run at a time.
  6. MCP server artifactsdist/server.js and node_modules.

Interpreting results for the user

  • Exit 0 = healthy; summarize any warnings briefly.
  • Broken symlink → the source repo moved or was renamed. Remedy: rebuild and reinstall as copies (setup.sh --install from the repo), which is immune to future renames.
  • Stuck helper → offer --fix, then have the user retry their original request.
  • notDetermined on the direct route, helper installed → normal in an agent shell, and not a verdict on its own. Read the helper-route line under it.
  • notDetermined + no helper → run scripts/build-helper-app.sh, then the next Calendar/Reminders/Contacts call raises the macOS dialog; tell the user to answer it (they have ~2 minutes).
  • helper route not granted (failure) → calls from an agent shell will block on a dialog nobody sees for up to 2 minutes, then wedge the helper. The usual cause is a helper rebuild, which re-signs the bundle and drops every grant. Have the user make a real Calendar / Reminders / Contacts call from a normal terminal and answer the prompt.
  • helper route not yet granted (warning) → the same missing grant, but the direct route works here, so nothing is broken until something calls from an embedded shell.
  • helper route denied → the grant exists and is switched off. System Settings > Privacy & Security > the matching section, enable Apple PIM Helper.
  • helper probe inconclusive → the probe could not reach the helper: one was already resident, the launch failed, or it returned nothing. Check the Helper processes section, clear a stuck instance with --fix, re-run.
  • After any fix, verify by calling a real tool (e.g. reminder lists), not just by re-running doctor.

Read the full file on GitHub · 75 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. 2d ago Changed · +2 lines 14a40f525827
  2. 7d ago First seen · 73 lines · 20 tokens per session scan A 86e24b823855

Subscribe to this mod's changes

doctor is a command published in the GitHub repository omarshahine/apple-pim (51 stars, last pushed 3d ago), licensed MIT. It adds 20 tokens to every session and 891 once invoked, about $0.0001 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-31.