XcodeBazelMCP: Skill for Claude Code

.agents/skills/swift-agent-debug-log/SKILL.md

swift-agent-debug-log is a skill for Claude Code, Codex from DebugSwift/XcodeBazelMCP. It costs 58 tokens per session (1,109 once invoked), scanned A, original, MIT.

A logging protocol for Swift and iOS applications that records debugging hypotheses as newline-delimited JSON, one JSON object per line, on a host computer or simulator.

In plain words
What is it for?
Use it in Cursor debug sessions to record hypotheses, clear or retrieve logs, and reproduce problems on macOS, iOS simulators, or tests.
Why use it?
It avoids trying to write from an iOS simulator into protected repository paths and gives the debugging tools a defined place to read the logs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is DebugSwift/XcodeBazelMCP's own configuration. It tells Claude Code and Codex how to work on XcodeBazelMCP itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything XcodeBazelMCP configures →

Reuse

Borrowing it

Nothing to install: this file belongs to DebugSwift/XcodeBazelMCP. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/DebugSwift/XcodeBazelMCP/main/.agents/skills/swift-agent-debug-log/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/DebugSwift/XcodeBazelMCP

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 swift-agent-debug-log

README.md
[![agentmods](https://agentmods.dev/badge/skills/debugswift/xcodebazelmcp/swift-agent-debug-log/github.svg)](https://agentmods.dev/skills/debugswift/xcodebazelmcp/swift-agent-debug-log)
Your own site
<a href="https://agentmods.dev/skills/debugswift/xcodebazelmcp/swift-agent-debug-log"><img src="https://agentmods.dev/badge/skills/debugswift/xcodebazelmcp/swift-agent-debug-log/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 swift-agent-debug-log

Your own site · 80×15
<a href="https://agentmods.dev/skills/debugswift/xcodebazelmcp/swift-agent-debug-log"><img src="https://agentmods.dev/badge/skills/debugswift/xcodebazelmcp/swift-agent-debug-log.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,109 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.00058 $0.01109
Opus 5.5 $0.00023 $0.00444
Sonnet 5.5 $0.00012 $0.00222
Haiku 4.5 $0.00006 $0.00111

Measured 2mo ago against content hash d33b499e4745, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

swift-agent-debug-log 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 2mo 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.

.agents/skills/swift-agent-debug-log/SKILL.md · 110 lines

How it starts

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

Swift Agent Debug Log (Cursor DEBUG MODE)

XcodeBazelMCP owns runtime (build, launch, read logs). This skill is the protocol (NDJSON schema, hypothesisId, session cleanup).

Log path strategy

Runtime Where Swift writes How the agent reads
macOS / unit tests Host path from env bazel_ios_agent_debug_log_read
iOS Simulator Documents/agent-debug.ndjson (sandbox-safe) bazel_ios_agent_debug_log_pull or env if using host mount

Never hardcode repo paths like Apps/Consumer/.cursor/debug-*.log in app code — the sim sandbox cannot write there.

Environment (preferred for host / tests)

bazel_ios_build_and_run / bazel_ios_agent_debug_repro pass via launchEnv → SIMCTL_CHILD_*:

  • AGENT_DEBUG_LOG_PATH — absolute host path (e.g. <workspace>/.cursor/debug-{session}.log)
  • AGENT_DEBUG_SESSION_ID — Cursor debug session id

Swift reads ProcessInfo.processInfo.environment and appends one NDJSON object per line.

Simulator fallback

If no host path is writable, append NDJSON to:

FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]/agent-debug.ndjson

Then pull with bazel_ios_agent_debug_log_pull (destPath optional copy to .cursor/debug-*.log).

Swift instrumentation (minimal)

func agentDebugLog(
  location: String,
  message: String,
  data: [String: Any] = [:],
  hypothesisId: String,
  runId: String = "pre-fix"
) {
  let env = ProcessInfo.processInfo.environment
  let sessionId = env["AGENT_DEBUG_SESSION_ID"] ?? ""
  let payload: [String: Any] = [
    "sessionId": sessionId,
    "location": location,
    "message": message,
    "data": data,
    "hypothesisId": hypothesisId,
    "runId": runId,
    "timestamp": Int(Date().timeIntervalSince1970 * 1000),
  ]
  guard let line = try? JSONSerialization.data(withJSONObject: payload),
        let str = String(data: line, encoding: .utf8) else { return }
  let row = str + "\n"
  if let path = env["AGENT_DEBUG_LOG_PATH"], !path.isEmpty {
    if let handle = FileHandle(forWritingAtPath: path) {
      handle.seekToEndOfFile(); handle.write(Data(row.utf8)); try? handle.close()
    } else {
      FileManager.default.createFile(atPath: path, contents: Data(row.utf8))
    }
    return
  }
  let doc = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0]
  let url = doc.appendingPathComponent("agent-debug.ndjson")
  if let handle = try? FileHandle(forWritingTo: url) {
    handle.seekToEndOfFile(); handle.write(Data(row.utf8)); try? handle.close()
  } else {
    try? row.write(to: url, atomically: true, encoding: .utf8)
  }
}

Read the full file on GitHub · 110 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. 2mo ago First seen · 110 lines · 58 tokens per session scan A d33b499e4745

Subscribe to this mod's changes

swift-agent-debug-log is a skill published in the GitHub repository DebugSwift/XcodeBazelMCP (8 stars, last pushed 3mo ago), licensed MIT. It adds 58 tokens to every session and 1,109 once invoked, about $0.0002 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-08-31.

Related

Other skills, from other repositories

ipad-layout-audit

Detects hardcoded iPhone-sized widths, missing iPad orientation keys, and absent size-class adaptation that cause layout failures on iPad reviewers' devices under guidelines 2.1 and 2.4.1.

cruisediary/apple-app-review-skills · 49 tokens

cli-anything-nslogger

CLI harness for NSLogger — parse, filter, export, and monitor NSLogger log files (.rawnsloggerdata / .nsloggerdata).

HKUDS/CLI-Anything · 36 tokens

xcodebuildmcp-cli

Official skill for the XcodeBuildMCP CLI. Use when doing iOS/macOS/watchOS/tvOS/visionOS work (build, test, run, debug, log, UI automation).

getsentry/XcodeBuildMCP · 48 tokens

argent-metro-debugger

Debug a JS runtime via CDP using argent debugger tools. Primary path is React Native via Metro (iOS / Android / Vega); a subset of the tools (debugger-connect, debugger-status, debugger-evaluate, debugger-log-registry) also drive a Chromium (CDP) app's renderer (an Electron app, or any Chromium browser exposing CDP)…

software-mansion/argent · 104 tokens

argent-react-native-optimization

Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.

software-mansion/argent · 71 tokens

argent-native-profiler

Native profiling for CPU hotspots, UI hangs, memory issues. iOS via xctrace; Android via Perfetto. Use when diagnosing native-level performance issues.

software-mansion/argent · 37 tokens