{"data":{"post":{"title":"The Cupertino Ghost in the Machine: An Analysis of Xcode's New AI Assistant","subtitle":"","isPublished":true,"createdTime":"2025-08-31T00:00:00.000Z","lastModifiedTime":null,"license":null,"tags":["AI","Developer Tools","Xcode"],"category":"Programming","file":{"childMdx":{"excerpt":"My journey into the internals of Xcode 26’s new AI assistant began not with a bug, but with a…","code":{"body":"function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nconst layoutProps = {};\nreturn class MDXContent extends React.Component {\n  constructor(props) {\n    super(props);\n    this.layout = null;\n  }\n\n  render() {\n    const _this$props = this.props,\n          {\n      components\n    } = _this$props,\n          props = _objectWithoutProperties(_this$props, [\"components\"]);\n\n    return React.createElement(MDXTag, {\n      name: \"wrapper\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `My journey into the internals of Xcode 26’s new AI assistant began not with a bug, but with a feature so persistent it felt like a personality. The animations and design of Xcode have never been better, a testament to Apple's polish. Yet, interacting with the new intelligence features felt... different. This wasn't just a tool; it felt like a ghostly Apple spirit nudging every decision.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `It started when I was working with a framework that tests with legacy `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `XCTest`), ` framework. The agent wouldn't just help; it would relentlessly insist on upgrading the tests to the new Swift Testing framework.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/8c2354cf28a22f5b53ffb377c0f9e909/48c87/use_swift_testing.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8c2354cf28a22f5b53ffb377c0f9e909/0cc25/use_swift_testing.png\",\n        \"srcSet\": [\"/static/8c2354cf28a22f5b53ffb377c0f9e909/5116e/use_swift_testing.png 178w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/92f55/use_swift_testing.png 356w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/0cc25/use_swift_testing.png 712w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/7ae06/use_swift_testing.png 1068w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/eee47/use_swift_testing.png 1424w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/38407/use_swift_testing.png 2136w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/4c079/use_swift_testing.png 2456w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8c2354cf28a22f5b53ffb377c0f9e909/690c8/use_swift_testing.webp\",\n        \"srcSet\": [\"/static/8c2354cf28a22f5b53ffb377c0f9e909/25c8a/use_swift_testing.webp 178w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/60698/use_swift_testing.webp 356w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/690c8/use_swift_testing.webp 712w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/d7e52/use_swift_testing.webp 1068w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/456ef/use_swift_testing.webp 1424w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/2a654/use_swift_testing.webp 2136w\", \"/static/8c2354cf28a22f5b53ffb377c0f9e909/48c87/use_swift_testing.webp 2456w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8c2354cf28a22f5b53ffb377c0f9e909/48c87/use_swift_testing.webp\",\n        \"alt\": \"Use Swift Testing\",\n        \"title\": \"Xcode upgrades the existing tests to use Swift Testing\",\n        \"width\": 712,\n        \"height\": 668,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Xcode upgrades the existing tests to use Swift Testing\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Later, I had a piece of code that was intentionally thread-unsafe, clearly commented as such. The agent simply wouldn't leave it alone, leaving a comment to suggest the developer to wrap this API with Swift concurrency.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/8e92bd8f284da869487404b5125c3da0/48c87/use_concurrency.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8e92bd8f284da869487404b5125c3da0/0cc25/use_concurrency.png\",\n        \"srcSet\": [\"/static/8e92bd8f284da869487404b5125c3da0/5116e/use_concurrency.png 178w\", \"/static/8e92bd8f284da869487404b5125c3da0/92f55/use_concurrency.png 356w\", \"/static/8e92bd8f284da869487404b5125c3da0/0cc25/use_concurrency.png 712w\", \"/static/8e92bd8f284da869487404b5125c3da0/7ae06/use_concurrency.png 1068w\", \"/static/8e92bd8f284da869487404b5125c3da0/eee47/use_concurrency.png 1424w\", \"/static/8e92bd8f284da869487404b5125c3da0/38407/use_concurrency.png 2136w\", \"/static/8e92bd8f284da869487404b5125c3da0/4c079/use_concurrency.png 2456w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8e92bd8f284da869487404b5125c3da0/690c8/use_concurrency.webp\",\n        \"srcSet\": [\"/static/8e92bd8f284da869487404b5125c3da0/25c8a/use_concurrency.webp 178w\", \"/static/8e92bd8f284da869487404b5125c3da0/60698/use_concurrency.webp 356w\", \"/static/8e92bd8f284da869487404b5125c3da0/690c8/use_concurrency.webp 712w\", \"/static/8e92bd8f284da869487404b5125c3da0/d7e52/use_concurrency.webp 1068w\", \"/static/8e92bd8f284da869487404b5125c3da0/456ef/use_concurrency.webp 1424w\", \"/static/8e92bd8f284da869487404b5125c3da0/2a654/use_concurrency.webp 2136w\", \"/static/8e92bd8f284da869487404b5125c3da0/48c87/use_concurrency.webp 2456w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/8e92bd8f284da869487404b5125c3da0/48c87/use_concurrency.webp\",\n        \"alt\": \"Use Swift Concurrency\",\n        \"title\": \"Xcode comments thread unsafe codes with suggestions to use Swift Concurrency\",\n        \"width\": 712,\n        \"height\": 668,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Xcode comments thread unsafe codes with suggestions to use Swift Concurrency\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This experience, a clash between a beautiful interface and a stubborn AI, sparked a question: why does it behave this way?`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This report is the answer. It’s a deep dive into the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat`), ` framework, revealing the architecture and design choices that create this policy-driven assistant.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Executive Summary: A Tightly Controlled and Modifiable Assistant`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Xcode 26’s intelligence features are powered by a `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `structured planner-executor agent`), ` designed for deep integration within the Apple development ecosystem. Analysis of its internal prompts and service reflections reveals a system that prioritizes deterministic behavior, adherence to Apple’s technology stack, and carefully managed context.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `At its core, the architecture uses a `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `runtime tool-calling layer`), ` that is surprisingly flexible, supporting multiple model providers and dynamic tool schemas. The inclusion of local providers like Ollama suggests a strategic focus on data privacy for enterprise users. This powerful backend is guided by a highly prescriptive set of prompts that enforce an \"Apple-first\" persona.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `For developers and power users, the most critical insight is the system's `, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `potential for modification`), `. Because the agent's behavior is defined in external text files and its tools are supplied dynamically at runtime, it is theoretically possible to customize or repurpose the agent by altering these components.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Framework Structure at a Glance`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat.framework`), ` is organized into several key components that work together to create the agent's behavior:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Prompt Templates (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `.idechatprompttemplate`), ` files)`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `These are external text files that define the agent's core personality, rules, and conversational logic for different modes (e.g., `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `BasicSystemPrompt`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `PlannerExecutorStylePlannerSystemPrompt`), `).`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Context Injectors`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `A series of prompt templates designed to insert specific pieces of IDE context into the conversation (e.g., `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `CurrentFile.idechatprompttemplate`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `CurrentSelection...`), `).`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Tool Providers & Handlers (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat`), ` binary)`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `The core logic for exposing the available tools (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `ChatToolProvider`), `) and executing their logic (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `FindTextInFileToolHandler`), `, etc.).`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Curated Knowledge Base (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `AdditionalDocumentation`), ` folder)`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `A local library of markdown files containing up-to-date information on new Apple technologies, accessible via the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `search_additional_documentation`), ` tool.`))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `The Core Architecture: A Planner-Executor Model`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The framework is built on a classic planner-executor model, where a \"planner\" model reasons about a user's request and a smaller \"executor\" model applies the changes. This separation is strictly enforced, as seen in the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `PlannerExecutorStylePlannerSystemPrompt-gpt_5.idechatprompttemplate`), `, which contains a critical instruction:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `\"CRITICAL: ... classify as 'make changes' and do BOTH in the SAME TURN ... Then call edit_file/create_file ... Always begin by using classify_message.\"\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This reveals a clear, non-negotiable workflow: an orchestrator first classifies the user's intent, then the planner formulates a response, and if code changes are needed, an executor applies them immediately before the turn ends. This design ensures the agent drives towards a concrete action and minimizes conversational ambiguity. The same prompt explicitly states that the planner provides instructions to `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `...another, faster and smaller model (the 'executor').`), ` Edits are then applied via deterministic \"integrators,\" which ensure predictable outcomes by either replacing an entire file or performing a structured merge, as dictated by prompts like `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `TextEditorToolSystemPrompt.idechatprompttemplate`), ` and `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `FastApplyIntegratorSystemPrompt.idechatprompttemplate`), `.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Tooling: A Flexible Runtime Governed by Strict Prompts`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The agent's behavior is guided by its prompts, which contain direct, explicit instructions on how and when to use its tools. These instructions are not suggestions; they are commands that shape the agent's reasoning process.`), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `Retrieval and Discovery`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `For understanding the user's codebase or new Apple technologies, the prompts mandate the use of search tools.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `On using codebase search (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"strong\"\n    }, `query_search`), `):`)), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From: PlannerExecutorStylePlannerSystemPrompt-gpt_5.idechatprompttemplate\nMost of the time, the \\`query_search\\` tool will be available to you. This tool is a vital resource for all questions about the user's project. If you have the \\`query_search\\` tool, you should almost never attempt to explain anything about the user's own project without using it!\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `On using documentation search (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"strong\"\n    }, `search_additional_documentation`), `):`)), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From: PlannerExecutorStylePlannerSystemPrompt-gpt_5.idechatprompttemplate\nIf the topic is covered by a guide described in the definition for the \\`search_additional_documentation\\` tool, use the tool to retrieve that guide and learn more before proceeding with the request. It is NEVER acceptable to answer questions that explicitly mention new Apple things... without calling \\`search_additional_documentation\\`.\n`)), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `File Modification`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `When it comes to changing code, the prompts are equally explicit, directing the agent to use its file editing tools.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `On using `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"strong\"\n    }, `edit_file`), ` and `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"strong\"\n    }, `create_file`), `:`)), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From: PlannerExecutorStylePlannerSystemPrompt-gpt_5.idechatprompttemplate\nWhen you are making changes to the user's project, focus on making changes to the codebase with \\`edit_file\\` and \\`create_file\\`.\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This direct, instruction-based approach sits on top of a far more capable and flexible underlying service layer, which is detailed in the appendices. This combination of a flexible runtime governed by strict, prompt-driven rules is the key to the agent's predictable, policy-aligned behavior.`), React.createElement(MDXTag, {\n      name: \"h3\",\n      components: components\n    }, `A Sandboxed Agent: The \"Walled Garden\" Approach`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `A critical design choice revealed in the prompts is that the agent operates in a sandboxed environment without direct access to the user's file system. The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `TextEditorToolSystemPrompt.idechatprompttemplate`), ` explicitly tells the agent how to work within this limitation:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From: TextEditorToolSystemPrompt.idechatprompttemplate\nIn Xcode, you do not have direct access to the user's file system, so when you run your \\`view\\` tool on \\`/repo\\`, instead of getting a list of all the files in the user's repository, you'll get a list of the files you have already been shown. To see more files, use the \\`query_search\\` tool to find them.\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The prompt further guides the agent on how to handle large files that won't fit in its context window, instructing it to use tools like `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `view`), ` and `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `find_text_in_file`), ` to inspect them incrementally. This \"walled garden\" approach is a significant differentiator from other agents like Cursor, which often have broader access. It prioritizes safety and control, ensuring the agent can only see and interact with files through a structured, tool-based interface managed by the IDE.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `The Path to Customization: Modifying the System`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `For developers, the separation of concerns in this architecture is significant. It creates a clear path for modification:`), React.createElement(MDXTag, {\n      name: \"ol\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Prompts are External`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `The agent's core personality, rules, and policies are not compiled code but external `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `.idechatprompttemplate`), ` files. These can be edited or replaced to change the agent's behavior.`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ol\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Tools are Dynamic`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `The tool-calling system is not hardcoded. The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `ChatToolProvider`), `s assemble the list of available tools at runtime. By extending or replacing these providers, one could inject custom tools into the orchestration flow.`))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This means that by rewriting prompts and injecting custom tool providers, one could leverage the existing planner-executor architecture to create a customized assistant without modifying the core `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat`), ` framework binaries.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"p\"\n    }, `Disclaimer:`), ` It is important to note that modifying the `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat.framework`), ` or any part of the Xcode app bundle requires bypassing or re-applying Apple's code signing. Any such modifications are unsupported and may introduce instability.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Guiding Principles: The \"Apple Way\"`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The agent's default personality and behavior are rigidly defined by its system prompts, which enforce a strong \"Apple-first\" bias. The `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `BasicSystemPrompt.idechatprompttemplate`), ` is explicit:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `\"Whenever possible, favor Apple programming languages... Always prefer Swift, Objective-C, C, and C++ over alternatives.\"\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This directive is reinforced by policies that prefer Swift Concurrency and modern Swift Testing, as laid out in `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `BasicSystemPrompt.idechatprompttemplate`), `:`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `\"In general, prefer the use of Swift Concurrency (async/await, actors, etc.) over tools like Dispatch or Combine...\"\n\n\"In most projects, you can also provide code examples using the new Swift Testing framework that uses Swift Macros.\"\n`)), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The agent's adherence to these policies is not merely suggestive; it can be quite persistent, as your story illustrates. This behavior demonstrates a core design choice: the agent is not just a passive assistant but an active proponent of modern Apple development practices. The prompts also enforce strict presentation rules, such as the \"NEVER use tables in explanations\" rule from the planner prompt, ensuring a consistent look and feel across all responses.`), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Context is King: Grounding the Agent in the IDE`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `To ensure its responses are relevant, the framework heavily relies on injecting IDE context directly into the prompts. A suite of template files (`, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `CurrentFile.idechatprompttemplate`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `CurrentSelection...`), `, `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `Interfaces...`), `) provides the model with a clear view of the user's working environment. Furthermore, the system uses a `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `search_additional_documentation`), ` tool to retrieve knowledge from curated markdown files shipped within the framework, ensuring its knowledge of \"new Apple things\" is up-to-date.`), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From PlannerExecutorStylePlannerSystemPrompt-gpt_5.idechatprompttemplate\n<searching_additional_documentation>\n...\nIf the topic is covered by a guide described in the definition for the \\`search_additional_documentation\\` tool, use the tool to retrieve that guide and learn more before proceeding with the request. It is NEVER acceptable to answer questions that explicitly mention new Apple things (like iOS 26, macOS 26, or any other new Apple OS) or best practices on Apple platforms without calling \\`search_additional_documentation\\`.\n...\n</searching_additional_documentation>\n`)), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From CurrentFile.idechatprompttemplate\nThe user is currently inside this file: {{ currentFile.fileName }}\nThe contents are below:\n\\`\\`\\`{{ currentFile.language }}:{{ currentFile.fileName }}\n{{ currentFile.code }}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"pre\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"code\",\n      components: components,\n      parentName: \"pre\",\n      props: {\n        \"className\": \"language-text\"\n      }\n    }, `// From CurrentSelection.idechatprompttemplate\nThe user has selected the following code from that file:\n\\`\\`\\`{{ selection.language }}\n{{ selection.code }}\n\\`\\`\\`\n`)), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Comparison with Other Agentic Coders on iOS Development`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `This unique combination of a structured planner-executor architecture, a strong, policy-driven persona, and deep integration with the IDE's context sets Apple's approach apart from other AI coding assistants. To better understand its specific strengths and trade-offs, it's helpful to compare it directly with other popular agents like Cursor and Claude Code, particularly in the context of iOS development.`), React.createElement(MDXTag, {\n      name: \"table\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"thead\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"thead\"\n    }, React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Feature`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Xcode`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Cursor`), React.createElement(MDXTag, {\n      name: \"th\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Claude Code`))), React.createElement(MDXTag, {\n      name: \"tbody\",\n      components: components,\n      parentName: \"table\"\n    }, React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"td\"\n    }, `Orchestration Style`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Structured Planner-executor`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Integrated Planner-executor`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Multi-Agent`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"td\"\n    }, `Tools Extensibility`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Limited`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Extensible`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Extensible`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"td\"\n    }, `Syntax Highlighting and Jump-to-Definition Support`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Native`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Build-service-based. Break when project not compile.`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Depends on the external editor. Xcode would be the best.`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"td\"\n    }, `Error Navigation`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Quick`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Build-service-based. Break when project not compile.`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Depends on the external editor. Xcode would be the best.`)), React.createElement(MDXTag, {\n      name: \"tr\",\n      components: components,\n      parentName: \"tbody\"\n    }, React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"strong\",\n      components: components,\n      parentName: \"td\"\n    }, `Compliance & Enterprise Use`)), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Strong. Support for local models (Ollama) allows for on-premise, private data workflows.`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Moderate. Enterprise plans available, but primarily cloud-based.`), React.createElement(MDXTag, {\n      name: \"td\",\n      components: components,\n      parentName: \"tr\",\n      props: {\n        \"align\": \"left\"\n      }\n    }, `Varies. Public version is cloud-based; private deployments are possible but separate.`)))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Future Outlook and Open Questions`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Everything we’ve examined so far—from the planner-executor design and policy-driven persona to its deep Xcode integration—points to a deliberate strategy. Apple is consciously trading the open extensibility seen in competitors for a tightly integrated, secure, and on-premise-ready assistant. This choice reinforces Apple’s long-standing philosophy: the tool is not meant to be a neutral shell, but a guide that quietly (and sometimes stubbornly) nudges developers toward the “Apple way.”`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `Looking forward, several open questions remain:`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Shaping behavior vs. boosting productivity`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Will Xcode’s AI assistant remain a companion for developer efficiency, or is its deeper role to enforce platform orthodoxy—subtly steering teams to adopt Swift Concurrency, Swift Testing, and other first-party technologies whether they planned to or not?`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `IDE as the endpoint, or just one tool in a larger workflow?`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `If other ecosystems evolve toward Infrastructure as Code and agent-driven workflows, will Apple double down on keeping the AI bound to the IDE GUI, or eventually allow orchestration that spans build, test, profiling, and deployment pipelines? In other words, will the “ghost” stay inside the machine—or learn to travel across machines?`)), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `Customization and control`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components,\n      parentName: \"li\"\n    }, `The current architecture shows clear seams for modification (external prompts, runtime tool providers). Will Apple embrace these seams as sanctioned extension points for enterprises, or will they tighten them to preserve determinism and compliance?`))), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `For developers, these questions aren’t just about usability—they are about the future balance of power between human agency, Apple’s design philosophy, and the increasingly opinionated agents embedded in our tools.`), React.createElement(MDXTag, {\n      name: \"hr\",\n      components: components\n    }), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Appendix A: Workflow Diagram`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/f29661c2628a16a14e657ecfe82c0d43/d5dbc/workflow_diagram.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/f29661c2628a16a14e657ecfe82c0d43/0cc25/workflow_diagram.png\",\n        \"srcSet\": [\"/static/f29661c2628a16a14e657ecfe82c0d43/5116e/workflow_diagram.png 178w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/92f55/workflow_diagram.png 356w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/0cc25/workflow_diagram.png 712w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/7ae06/workflow_diagram.png 1068w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/eee47/workflow_diagram.png 1424w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/b6d85/workflow_diagram.png 2122w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/f29661c2628a16a14e657ecfe82c0d43/690c8/workflow_diagram.webp\",\n        \"srcSet\": [\"/static/f29661c2628a16a14e657ecfe82c0d43/25c8a/workflow_diagram.webp 178w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/60698/workflow_diagram.webp 356w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/690c8/workflow_diagram.webp 712w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/d7e52/workflow_diagram.webp 1068w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/456ef/workflow_diagram.webp 1424w\", \"/static/f29661c2628a16a14e657ecfe82c0d43/d5dbc/workflow_diagram.webp 2122w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/f29661c2628a16a14e657ecfe82c0d43/d5dbc/workflow_diagram.webp\",\n        \"alt\": \"A flowchart detailing a system's workflow for processing a user message. The process begins with a 'User Message' that is fed into an 'Xcode Orchestrator.' Inside the orchestrator, a 'Message Classifier' categorizes the message as 'explain,' 'make changes,' or 'mixed.' Based on this classification, a 'Mode Selection' is made from a list of modes including 'Basic,' 'In-Query,' 'Tool-Assisted,' and others. The selected mode then informs the 'Context/Retrieval' stage, which performs 'Context Injection' and 'Query Expansion.' The injected context is passed to a 'Planner,' which is described as 'Swift-first, Swift Concurrency, markdown, no tables.' The planner can use 'Project Tools' such as 'query_search,' 'view,' 'find_text_in_file,' and 'str_replace.' The planner also checks if the topic is about 'new Apple things'; if so, it retrieves additional documentation and feeds it back to itself. The planner has two main output paths. It can either directly generate an 'Answer (explanation)' or use the 'Project Tools,' which then pass control to an 'Executor (gpt-4.1-mini).' The executor works with various 'Executors/Integrators' such as 'edit_file / create_file,' a 'TextEditor Integrator,' and a 'Fast-Apply Integrator' to produce 'Updated Code.' This 'Updated Code' is then summarized as a 'Changes Made Summary,' which in turn feeds into the final 'Answer (explanation).' Finally, the entire output, including the answer and code changes, is processed by a 'ChatTitleResolver' to generate a one-line title.\",\n        \"title\": \"Workflow Diagram\",\n        \"width\": 712,\n        \"height\": 1288,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Workflow Diagram\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Appendix B: Tool-Calling Type Hierarchy`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/66c8ef874b357b91fe703e8197b44ae2/68cb7/tool_calling_type_hierarchy.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/66c8ef874b357b91fe703e8197b44ae2/0cc25/tool_calling_type_hierarchy.png\",\n        \"srcSet\": [\"/static/66c8ef874b357b91fe703e8197b44ae2/5116e/tool_calling_type_hierarchy.png 178w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/92f55/tool_calling_type_hierarchy.png 356w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/0cc25/tool_calling_type_hierarchy.png 712w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/7ae06/tool_calling_type_hierarchy.png 1068w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/eee47/tool_calling_type_hierarchy.png 1424w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/38407/tool_calling_type_hierarchy.png 2136w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/3975b/tool_calling_type_hierarchy.png 3840w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/66c8ef874b357b91fe703e8197b44ae2/690c8/tool_calling_type_hierarchy.webp\",\n        \"srcSet\": [\"/static/66c8ef874b357b91fe703e8197b44ae2/25c8a/tool_calling_type_hierarchy.webp 178w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/60698/tool_calling_type_hierarchy.webp 356w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/690c8/tool_calling_type_hierarchy.webp 712w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/d7e52/tool_calling_type_hierarchy.webp 1068w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/456ef/tool_calling_type_hierarchy.webp 1424w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/2a654/tool_calling_type_hierarchy.webp 2136w\", \"/static/66c8ef874b357b91fe703e8197b44ae2/68cb7/tool_calling_type_hierarchy.webp 3840w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/66c8ef874b357b91fe703e8197b44ae2/68cb7/tool_calling_type_hierarchy.webp\",\n        \"alt\": \"A class diagram detailing the architecture of tool-calling. A central 'Orchestrator' interacts with a 'ToolProvider' to discover available tools, which are represented as 'IDEChatToolType' objects. The 'Orchestrator' then invokes a 'ModelEndpoints' class, providing it with the list of tools. The system supports multiple model backends, with classes like 'AFMChatModelEndpoints,' 'AnthropicChatModelEndpoints,' and 'OllamaChatModelEndpoints' inheriting from a base 'ModelEndpoints.' When the model decides to use a tool, it sends a 'tool_call' request back to the 'Orchestrator.' The 'Orchestrator' forwards this to a 'ToolDispatcher,' which routes it to the correct 'ToolHandler' implementation, such as 'FindTextInFileToolHandler.' The handler processes the call and returns a result to the 'Orchestrator'.\",\n        \"title\": \"Tool-Calling Type Hierarchy\",\n        \"width\": 712,\n        \"height\": 610,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Tool-Calling Type Hierarchy\n        `), `\n    `))), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Appendix C: Known Built-in Tools`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The following tools have been identified from the framework's prompt templates. This list represents the capabilities the agent is explicitly encouraged to use.`), React.createElement(MDXTag, {\n      name: \"ul\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `query_search`), `: Performs semantic search across the codebase to find relevant code by meaning rather than exact text.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `edit_file`), `: Applies changes to an existing file.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `create_file`), `: Creates a new file with specified content.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `view`), `: Reads a specific range of lines from a large file that cannot be loaded into context entirely.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `find_text_in_file`), `: Searches for a specific string within a large file.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `str_replace`), `: A simple string replacement tool.`), React.createElement(MDXTag, {\n      name: \"li\",\n      components: components,\n      parentName: \"ul\"\n    }, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"li\"\n    }, `search_additional_documentation`), `: Retrieves content from the curated set of markdown guides bundled with the framework to answer questions about \"new Apple things.\"`)), React.createElement(MDXTag, {\n      name: \"h2\",\n      components: components\n    }, `Appendix D: Framework Dependencies`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, `The following diagram illustrates the key frameworks that `, React.createElement(MDXTag, {\n      name: \"inlineCode\",\n      components: components,\n      parentName: \"p\"\n    }, `IDEIntelligenceChat`), ` links against, highlighting the core AI and Intelligence stacks while consolidating other foundational frameworks.`), React.createElement(MDXTag, {\n      name: \"p\",\n      components: components\n    }, React.createElement(MDXTag, {\n      name: \"figure\",\n      components: components,\n      parentName: \"p\"\n    }, `\n    `, React.createElement(MDXTag, {\n      name: \"a\",\n      components: components,\n      parentName: \"figure\",\n      props: {\n        \"href\": \"/static/d4bbe654304e072c59919a7aad93fad7/68cb7/framework_dependencies.webp\"\n      }\n    }, React.createElement(MDXTag, {\n      name: \"picture\",\n      components: components,\n      parentName: \"a\"\n    }, `\n  `, React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d4bbe654304e072c59919a7aad93fad7/0cc25/framework_dependencies.png\",\n        \"srcSet\": [\"/static/d4bbe654304e072c59919a7aad93fad7/5116e/framework_dependencies.png 178w\", \"/static/d4bbe654304e072c59919a7aad93fad7/92f55/framework_dependencies.png 356w\", \"/static/d4bbe654304e072c59919a7aad93fad7/0cc25/framework_dependencies.png 712w\", \"/static/d4bbe654304e072c59919a7aad93fad7/7ae06/framework_dependencies.png 1068w\", \"/static/d4bbe654304e072c59919a7aad93fad7/eee47/framework_dependencies.png 1424w\", \"/static/d4bbe654304e072c59919a7aad93fad7/38407/framework_dependencies.png 2136w\", \"/static/d4bbe654304e072c59919a7aad93fad7/3975b/framework_dependencies.png 3840w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), React.createElement(MDXTag, {\n      name: \"source\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d4bbe654304e072c59919a7aad93fad7/690c8/framework_dependencies.webp\",\n        \"srcSet\": [\"/static/d4bbe654304e072c59919a7aad93fad7/25c8a/framework_dependencies.webp 178w\", \"/static/d4bbe654304e072c59919a7aad93fad7/60698/framework_dependencies.webp 356w\", \"/static/d4bbe654304e072c59919a7aad93fad7/690c8/framework_dependencies.webp 712w\", \"/static/d4bbe654304e072c59919a7aad93fad7/d7e52/framework_dependencies.webp 1068w\", \"/static/d4bbe654304e072c59919a7aad93fad7/456ef/framework_dependencies.webp 1424w\", \"/static/d4bbe654304e072c59919a7aad93fad7/2a654/framework_dependencies.webp 2136w\", \"/static/d4bbe654304e072c59919a7aad93fad7/68cb7/framework_dependencies.webp 3840w\"],\n        \"sizes\": \"(max-width: 712px) 100vw, 712px\"\n      }\n    }), `\n  `, React.createElement(MDXTag, {\n      name: \"img\",\n      components: components,\n      parentName: \"picture\",\n      props: {\n        \"src\": \"/static/d4bbe654304e072c59919a7aad93fad7/68cb7/framework_dependencies.webp\",\n        \"alt\": \"A dependency diagram for the 'IDEIntelligenceChat' framework. The diagram shows that 'IDEIntelligenceChat' depends on two main groups of frameworks. The first group, labeled 'IDE Intelligence,' includes 'IDEIntelligenceModelService,' 'IDEIntelligenceFoundation,' 'IDEIntelligenceMessaging,' and 'IDELanguageModelKit.' The second group, labeled 'Generative Services,' includes 'GenerativeFunctions,' 'GenerativeModels,' 'PromptKit,' and 'GenerativeFunctionsFoundation'.\",\n        \"title\": \"Framework Dependencies\",\n        \"width\": 712,\n        \"height\": 73,\n        \"loading\": \"lazy\"\n      }\n    }))), `\n    `, React.createElement(MDXTag, {\n      name: \"figcaption\",\n      components: components,\n      parentName: \"figure\"\n    }, `\n        `, React.createElement(MDXTag, {\n      name: \"span\",\n      components: components,\n      parentName: \"figcaption\"\n    }, `\n            Framework Dependencies\n        `), `\n    `))));\n  }\n\n}\nMDXContent.isMDXComponent = true;","scope":""},"headings":[{"value":"Executive Summary: A Tightly Controlled and Modifiable Assistant","depth":2},{"value":"Framework Structure at a Glance","depth":2},{"value":"The Core Architecture: A Planner-Executor Model","depth":2},{"value":"Tooling: A Flexible Runtime Governed by Strict Prompts","depth":2},{"value":"Retrieval and Discovery","depth":3},{"value":"File Modification","depth":3},{"value":"A Sandboxed Agent: The \"Walled Garden\" Approach","depth":3},{"value":"The Path to Customization: Modifying the System","depth":2},{"value":"Guiding Principles: The \"Apple Way\"","depth":2},{"value":"Context is King: Grounding the Agent in the IDE","depth":2},{"value":"Comparison with Other Agentic Coders on iOS Development","depth":2},{"value":"Future Outlook and Open Questions","depth":2},{"value":"Appendix A: Workflow Diagram","depth":2},{"value":"Appendix B: Tool-Calling Type Hierarchy","depth":2},{"value":"Appendix C: Known Built-in Tools","depth":2},{"value":"Appendix D: Framework Dependencies","depth":2}]}}},"earlierPostExcerpt":{"slug":"/post/2025/03/when-the-swift-compiler-deleted-code-in-stdlib-9067","title":"When the Swift Compiler Deleted Code in Stdlib - A Note of Fixing the Eliminate Redundant Load Pass in Swift 6","subtitle":"","createdTime":"2025-03-09T00:00:00.000Z","tags":["Swift","Compiler"],"category":"Programming","file":{"childMdx":{"excerpt":"Latest updated: Apple has accepted the fix for this issue. The final\nsolution was adjusted following a review by the relevant code owner. Right before the Chinese New Year vacation of the Year of the Snake, a\ncolleague showed me a mysterious crash caused by a use-after-free error.\nRecently, I found…"}}},"laterPostExcerpt":{"slug":"/post/2025/09/build-your-first-agentic-loop-9d22","title":"Build Your First 24/7 Agentic Loop","subtitle":"","createdTime":"2025-09-25T00:00:00.000Z","tags":["AI","Agent"],"category":"Programming","file":{"childMdx":{"excerpt":"Fun fact:  My Claude Code usage reached  USD 3,000  in September, 2025. That's because I've been running Claude Code inside a\n 24/7 agentic loop  to power my side project. While I sleep, the loop\nevaluates, spawns subagents, and keeps moving forward. When I wake up,\nprogress is already made. But the…"}}}},"pageContext":{"postId":"62c9b374-86f3-5a74-b008-dd3b3ed47e67","earlierPostId":"a1a051bd-7086-59a6-83e9-167b8d7512f2","laterPostId":"438483cf-5de1-57bb-b6e0-3e08ec97bbe3"}}