-
Notifications
You must be signed in to change notification settings - Fork 520
Open
Labels
enhancementNew feature or requestNew feature or request
Description
When we craft very long files as system prompts (ones that can easily fit in context), claude's python SDK breaks down with an error like
Traceback (most recent call last):
File "/opt/outerbounds/fb/lib/python3.12/asyncio/runners.py", line 194, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/outerbounds/fb/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/outerbounds/fb/lib/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/metaflow/claude_utils.py", line 232, in _query_async
async with ClaudeSDKClient(options=self.options) as client:
File "/opt/outerbounds/fb/lib/python/site-packages/claude_agent_sdk/client.py", line 329, in __aenter__
await self.connect()
File "/opt/outerbounds/fb/lib/python/site-packages/claude_agent_sdk/client.py", line 132, in connect
await self._transport.connect()
File "/opt/outerbounds/fb/lib/python/site-packages/claude_agent_sdk/_internal/transport/subprocess_cli.py", line 276, in connect
raise error from e
claude_agent_sdk._errors.CLIConnectionError: Failed to start Claude Code: [Errno 7] Argument list too long: '/usr/local/share/npm-global/bin/claude'
This is happening because the entire system prompt is passed to the claude's NPM package via CLI. If we can pass system prompts via files, this would easily circumvent the issue.
People also recommend telling claude to read a specific file in the system prompt. But this is not what I want. I want that I can add as much as I can to the system prompt.
loemraw and anujhydrabadi
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request