Borrowing it
Nothing to install: this file belongs to rmathew1973/ios-sim-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/rmathew1973/ios-sim-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/rmathew1973/ios-sim-mcpWrote 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.
[](https://agentmods.dev/instructions/rmathew1973/ios-sim-mcp/claude-md)<a href="https://agentmods.dev/instructions/rmathew1973/ios-sim-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/rmathew1973/ios-sim-mcp/claude-md/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.
<a href="https://agentmods.dev/instructions/rmathew1973/ios-sim-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/rmathew1973/ios-sim-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.04311 | $0.04311 |
| Opus 5 | $0.02155 | $0.02155 |
| Sonnet 5 | $0.00862 | $0.00862 |
| Haiku 4.5 | $0.00431 | $0.00431 |
Grade A, and why
ios-sim-mcp 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
ios-sim-mcp
MCP server for driving the iOS Simulator the way Chrome MCP drives a browser: semantic AX tree with stable refs, fast snapshot/tap/type cycles, no screenshot-and-click loops.
Architecture
Layer 1 (current, shipping): wraps idb (Facebook's iOS Device Bridge — talks to CoreSimulator's private framework, no WebDriverAgent bridge). Each call is ~100ms.
Layer 2 (in progress): DYLD_INSERT_LIBRARIES dylib injected at app launch via SIMCTL_CHILD_DYLD_INSERT_LIBRARIES (passed to xcrun simctl launch — idb's launch path doesn't forward env). Opt-in per launch (launch_app({inject: true})).
- 2a ✅ Proof-of-life — constructor runs, emits
os_loglifecycle line. See dylib/ios_sim_mcp_dylib.m + dylib/build.sh. Subsystem:com.hmbsoftware.ios-sim-mcp, category:lifecycle. Smoke-tested via test/inject.ts. - 2b ✅ Unix socket + JSON-Lines RPC. Socket at
/tmp/ios-sim-mcp-<sanitized-bundle-id>.sock, perms 0600. Per-connection serial read loop on a concurrent dispatch queue. Methods registered viaism_register_method(ping,info,paste_text). MCP side: src/dylib_client.ts with line-buffered protocol, pending-call map, lazy connect with 4s deadline, auto-reconnect after relaunch. Tools:dylib_ping,dylib_info,dylib_call,paste_text.type_textauto-routes throughpaste_textwhen dylib is loaded. Measured: ~1ms per call once connected, 822ms cold first call (mostly socket-existence wait after launch). Smoke-tested via test/dylib_2b.ts + test/paste_perfect.ts.- paste_text uses
UIPasteboard.generalPasteboard.string = text+ first-responder[responder paste:nil], bouncing to the main queue. First-responder lookup walksUIWindowScene.windows(iOS 13+) preferringisKeyWindow, then falls back toUIApplication.windows. Solves three real input bugs: (1) iOS first-letter autocapitalization mangling lowercase emails ([email protected]→[email protected]→ login fails), (2) Unicode silently dropped through HID translation (café→ nothing), (3) smart-quote substitution chewinga"b'cintoA. Verified byte-perfect for emails, passwords, Unicode, and quote-containing strings.
- paste_text uses
- 2c ✅
view_tree+view_hit_test. WalksUIWindowScene.windows(withUIApplication.windowsfallback) → recursivesubviews, on the main thread (dispatch_sync(main)). Per node: class, window-coord frame, alpha/hidden/interactive, accessibility id+label+value, text content forUILabel/UIButton/UITextField/UITextView, andvc_classwhen this view is aUIViewController'sviewIfLoaded. Caps: defaultmax_nodes=1500,max_depth=30;hit_cap: truein response when truncated. Skips invisible (hidden / α<0.01 / zero-size) unlessinclude_invisible: true. Renderer: src/view_tree.ts withclass_filter/ax_id_contains/text_containsfilters (subtree ancestor preservation). Tools:view_tree,view_hit_test. Smoke-tested via test/view_tree.ts. Sub-5ms response for a 105-node SwiftUI Settings tree. - 2e ✅ JavaScriptCore eval bridge.
JSContextsingleton (lazily created on firsteval_js, persists across calls, reset viaeval_js_reset). All evaluation runs on the main queue viadispatch_sync— same discipline asview_tree/paste_text— so JS code can safely touch UIKit.ism_install_js_bridgessets up globals:app/defaults/pasteboard/bundle/process/notif_centeras direct Apple objects, plus block-callable helperskey_window()/all_windows()/first_responder()/find_view_by_ax_id/find_view_by_class/find_vc_by_class/post_notification/cls/log. JSExport categories declared on NSBundle, NSProcessInfo, NSUserDefaults, UIPasteboard, UIApplication, UIView, UIWindow, UIViewController, UILabel, UIButton, UITextField, UITextView — all getters declared with@propertysyntax so JS sees them as value access (bundle.bundleIdentifier), not function calls (bundle.bundleIdentifier()); methods declared with- (return)method:become camelCase JS functions following JSC's selector→name rules (setObject:forKey:→setObjectForKey(value, key)).ism_coerce_js_valuemaps results to {kind, value} with kindsstring|number|boolean|null|undefined|array|object|array_described|objc|other— JSON-able objects pass through; ObjC-bridged objects get{class, description}. Tools:eval_js,eval_js_reset. Smoke-tested via test/eval_js.ts: 13/13 covering arithmetic, string ops, bridged property access, ObjC bridged return, state persistence, syntax/runtime exceptions, NSUserDefaults round-trip, helper functions.- Caveat: long-running JS blocks the main queue (dispatch_sync). 5s default MCP-side timeout protects the client but the host app's UI freezes for that duration. Don't run infinite loops.
- 2g ✅ WKWebView eval bridge +
open_urldeep-link tool.ism_find_webviews()walks all windows DFS and collects everyWKWebView.webview_listreports{index, ax_id, url, title, frame, hidden}per webview.webview_eval_jspicks one (priority:ax_id>index> first visible > first) and calls-[WKWebView evaluateJavaScript:completionHandler:]on the main queue; the completion handler runs on a background semaphore-waited thread with a 4s cap (below the MCP-side 5s default). Result coercion mirrorseval_js({kind, value}). MCP-side ergonomic wrapperswebview_fill/webview_click/webview_findinline params as JSON and run hardened JS —webview_fillusesObject.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value').set.call(el, text)+dispatchEvent(new Event('input'/'change'))so React's synthetic value tracker and Angular's NgModel actually pick up the change.open_urltool wrapsxcrun simctl openurl <udid> <url>for delivering deep links / OAuth callback URLs / http(s) URLs. Builds with-framework WebKit.- Auth flow recipe — out-of-process web auth (the AppAuth /
ASWebAuthenticationSessioncase). The login UI runs inSafariViewService/AuthenticationServicesAgent, a separate system process. The dylib cannot reach it — no DOM injection, no view tree, no URL-protocol interception (URLSession swizzle is host-process only). Don't try to drive the sheet. Instead, short-circuit it: (1)network_stubthe token endpoint with a canned token JSON response, (2)open_url("yourapp://oauth/callback?code=test&state=...")to deliver the redirect URL directly to the app — AppAuth's URL-handler resumes the flow and calls the (now stubbed)/token, login completes without ever rendering the web sheet. - Auth flow recipe — in-process WKWebView. If the app uses a custom WKWebView-based external user agent (e.g.
OIDExternalUserAgentIOSCustomBrowser, or any embedded-browser sign-in), usewebview_listto confirm presence,webview_find('input[name=email]')to verify the field is rendered, thenwebview_fill({selector:'input[name=email]', text:'…'})+webview_click({selector:'button[type=submit]'}). - Limitation:
WKWebViewitself runs networking in its own process — the host-process URLProtocol interceptor still won't see resource loads from inside the webview. JS eval against the DOM works fine.
- Auth flow recipe — out-of-process web auth (the AppAuth /
- 2f ✅ Network stubbing. Extends
ISMURLProtocol.startLoadingwith a stub-match check before the forwarding path.ism_find_matching_stubdoes first-match-wins substring lookup on URL + optional case-insensitive method filter, guarded byism_net_stubs_lock. On match, synthesizesNSHTTPURLResponsewith the stub's status/headers, feeds the body throughdidLoadData, callsURLProtocolDidFinishLoading, and records the response viaism_net_record_completedwith the request markedstubbed:true+stub_id.delay_mshonored viadispatch_after. Stub body accepted asbody(UTF-8 string) orbody_base64(binary). Methods:network_stub_add/list/remove/clear. Tools:network_stub,network_stubs,network_unstub,network_unstub_all. Smoke-tested via test/network_stubs.ts: 13/13 covering synthesis with custom headers + JSON body, tail marking, method filter (POST stub doesn't catch GET), delay_ms timing, single + bulk removal. - 2d ✅ Network interception.
ISMURLProtocolsubclassesNSURLProtocol; we install via[NSURLProtocol registerClass:](legacy URLConnection path) + swizzle the class methods+[NSURLSessionConfiguration defaultSessionConfiguration]and+ephemeralSessionConfigurationto prepend our protocol class toprotocolClasses(modern URLSession path). InstartLoadingwe forward via a fresh ephemeral session whose config is fetched via the ORIGINAL ephemeral IMP (saved inism_orig_ephemeralConfig_imp) — bypasses the swizzle to break recursion. Re-entry guard:[NSURLProtocol setProperty:@YES forKey:kISMHandledKey inRequest:forward], declined by+canInitWithRequest:. Ring buffer (default 500 records) + side dictionaries for full request/response bodies (default cap 256KB; full bodies retrievable by id). Methods:network_start,network_stop,network_status,network_tail,network_get_body,network_clear,network_self_test. Tools mirror those. Verified end-to-end againsthttpbin.org(200/405/418), URL filter works, sub-5ms tail latency. Coverage caveats (must be honest about): catchesURLSession-based code only — misses rawCFNetwork/nw_connection_t, backgroundURLSessions, gRPC libraries that bypass URLSession, andWKWebViewresource loads (separate process).HTTPBodyStreamrequest bodies are noted but not captured. Sessions constructed beforenetwork_startare not retro-fitted (relaunch withinject:trueto catch app-startup traffic).- Critical SwiftUI caveat:
accessibilityIdentifierset in SwiftUI (.accessibilityIdentifier("foo")) lives on the SwiftUI AX tree, NOT on the bridgedUIView.accessibilityIdentifier. Soview_tree'sax_id_containsfilter won't find SwiftUI-set ids. Use the AXsnapshottool for SwiftUI ax-id lookups; useview_treefor SwiftUI when you need view class hierarchy, frames, or hit-testing. Native UIKit apps with explicitaccessibilityIdentifieronUIVieware found correctly by both. view_hit_testreturns the topmost hit via[keyWindow hitTest:p withEvent:nil]plus the fullnextResponderchain (typically reachesUIApplication/AppDelegate). View controllers in the chain are taggedis_vc: true(rendered as[VC]).
- Critical SwiftUI caveat:
- 2d
URLProtocol-based network interception with bodies (the big unlock). - 2e
JSContexteval bridge.
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.
- 8d ago First seen · 85 lines · 4,311 tokens per session scan A 134bd2bb6082
ios-sim-mcp CLAUDE.md is an instructions file published in the GitHub repository rmathew1973/ios-sim-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 4,311 tokens to every session, about $0.0216 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.
Other instructions, from other repositories
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.