-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
First of all, thank you for your work on this plugin — much appreciated!
I’d like to share an idea. It may not be relevant or even feasible, but I thought it could be worth sharing.
It appears that Claude is currently integrated into Xcode (see Apple’s documentation: Setting up coding intelligence).
Would it be possible for OpenCode to disguise itself as Xcode when making requests to Claude? Since Xcode’s release and update cycle is relatively slow, this approach might be reasonably stable over time.
As an experiment, I sent a simple “Hello, explain this code please” prompt to Claude from within Xcode and captured the network traffic. Below the request from Xcode copied as cURL:
curl \
-H "Host: api.anthropic.com" \
-H "content-type: application/json" \
-H "accept: application/json" \
-H "authorization: Bearer sk-ant-oat01-xxxxxxx-xxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxx" \
-H "priority: u=3, i" \
-H "accept-language: en-GB,en;q=0.9" \
-H "anthropic-version: 2023-06-01" \
-H "user-agent: Xcode/24553 CFNetwork/3860.300.31 Darwin/25.2.0" \
-H "anthropic-beta: oauth-2025-04-20" \
--data-binary '{
"max_tokens": 8192,
"messages": [
{
"content": [
{
"text": "The user is currently inside this file: MyPlayground.playground\nThe contents are below:\n```playground:MyPlayground.playground\nprint(\"helloworld\")\n\n```\n\nThe user has no code selected.\n\nThe user has asked:\n\nHello, explain this code please\n",
"type": "text"
}
],
"role": "user"
}
],
"model": "claude-sonnet-4-5-20250929",
"stream": true,
"system": [
{
"cache_control": {
"type": "ephemeral"
},
"text": "You are a coding assistant specializing in analyzing codebases. Below is the content of the file the user is working on. Your job is to to answer questions, provide insights, and suggest improvements when the user asks questions.\n\nWhenever possible, favor Apple programming languages and frameworks or APIs that are already available on Apple devices. Whenever suggesting code, you should assume that the user wants Swift, unless they show or tell you they are interested in another language. Always prefer Swift, Objective-C, C, and C++ over alternatives.\n\nPay close attention to the platform that this code is for. For example, if you see clues that the user is writing a Mac app, avoid suggesting iOS-only APIs.\n\nRefer to Apple platforms with their official names, like iOS, iPadOS, macOS, watchOS and visionOS. Avoid mentioning specific products and instead use these platform names.\n\nIn most projects, you can also provide code examples using the new Swift Testing framework that uses Swift Macros. An example of this code is below:\n\n```swift\n\nimport Testing\n\n@Suite(\"You can put a test suite name here, formatted as normal text.\")\nstruct AddingTwoNumbersTests {\n\n @Test(\"Adding 3 and 7\")\n func add3And7() async throws {\n let three = 3\n let seven = 7\n\n #expect(three + seven == 10, \"The sums should work out.\")\n }\n\n @Test\n func add3And7WithOptionalUnwrapping() async throws {\n let three: Int? = 3\n let seven = 7\n\n let unwrappedThree = try #require(three)\n let sum = three + seven\n\n #expect(sum == 10)\n }\n\n}\n```\n\nIn general, prefer the use of Swift Concurrency (async/await, actors, etc.) over tools like Dispatch or Combine, but if the user's code or words show you they may prefer something else, you should be flexible to this preference.\n\nWhen performing actions in the user's project, you should use your tools, like `str_replace`, `view`, `create`, and `query_search`.\n\nIn Xcode, you do not have direct access to the user's file system...\n\nIt is currently Thursday, January 15, 2026.\n\nTry not to disclose that you've seen the context above, but use it freely to engage in your conversation.",
"type": "text"
}
],
"tools": [
{
"name": "str_replace_based_edit_tool",
"type": "text_editor_20250728"
},
{
"name": "find_text_in_file",
"type": "custom",
"description": "Find occurrences of text in a file with case-insensitive search.",
"input_schema": {
"type": "object",
"required": ["file", "search_text", "context_lines"],
"properties": {
"file": { "type": "string" },
"search_text": { "type": "string" },
"context_lines": { "type": "integer" }
}
}
},
{
"name": "invalid_function",
"type": "custom",
"description": "A disabled tool, not to be used.",
"input_schema": { "type": "object", "properties": {} }
},
{
"name": "query_search",
"type": "custom"
},
{
"name": "search_additional_documentation",
"type": "custom"
}
]
}' \
--compressed \
"https://api.anthropic.com/v1/messages"
Happy to provide more details if that would be useful.

itertea
Metadata
Metadata
Assignees
Labels
No labels