Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,448 changes: 1,129 additions & 319 deletions content/.metadata.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content/en/docs/claude-code/admin-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Managed settings can lock down tools, sandbox execution, restrict MCP servers an

Organizations whose members authenticate through claude.ai or the Anthropic API can also govern models without deploying settings: [organization model restrictions](/docs/en/model-config#organization-model-restrictions) disable individual models, an [organization default model](/docs/en/model-config#organization-default-model) sets which model new sessions start on, and [organization effort limits](/docs/en/model-config#organization-effort-limits) cap effort levels per role. All three controls require a Claude Enterprise plan. Model restrictions and effort limits are enforced server-side; the default model is a starting point that users can change, unless the organization enforces it. Enforcement is available to a limited set of organizations; ask your Anthropic account team about availability. None of these controls reach sessions on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or [Claude Platform on AWS](/docs/en/claude-platform-on-aws); on those providers, use `availableModels` above for restrictions and the `model` key in managed settings for a default.

[Claude Code on the web](/docs/en/claude-code-on-the-web) has its own admin surface: on the Cloud environments page in admin settings, owners and admins create [organization-shared environments](/docs/en/claude-code-on-the-web#organization-shared-environments) that set the [network access level](/docs/en/claude-code-on-the-web#network-access), environment variables, and setup script for members' cloud sessions, and choose the organization's default environment.
[Claude Code on the web](/docs/en/claude-code-on-the-web) has its own admin surface: on the Cloud environments page in admin settings, owners and admins create [organization-shared environments](/docs/en/cloud-environments#organization-shared-environments) that set the [network access level](/docs/en/cloud-environments#network-access), environment variables, and setup script for members' cloud sessions. Owners and admins choose the organization's default environment separately, at [claude.ai/admin-settings/claude-code](https://claude.ai/admin-settings/claude-code).

Permission rules and sandboxing cover different layers. Denying WebFetch blocks Claude's fetch tool, but if Bash is allowed, `curl` and `wget` can still reach any URL. Sandboxing closes that gap with a network domain allowlist enforced at the OS level.

Expand Down
153 changes: 94 additions & 59 deletions content/en/docs/claude-code/agent-sdk/modifying-system-prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,28 @@ To load CLAUDE.md, set `settingSources` to include the level your CLAUDE.md live
```

```python Python theme={null}
import asyncio

from claude_agent_sdk import query, ClaudeAgentOptions

messages = []

async for message in query(
prompt="Add a new React component for user profiles",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code", # Use Claude Code's system prompt
},
setting_sources=["project"], # Loads CLAUDE.md from project
),
):
messages.append(message)

async def main():
async for message in query(
prompt="Add a new React component for user profiles",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code", # Use Claude Code's system prompt
},
setting_sources=["project"], # Loads CLAUDE.md from project
),
):
messages.append(message)


asyncio.run(main())

# Now Claude has access to your project guidelines from CLAUDE.md
```
Expand Down Expand Up @@ -174,23 +181,30 @@ You can use the Claude Code preset with an `append` property to add your custom
```

```python Python theme={null}
import asyncio

from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage

messages = []

async for message in query(
prompt="Help me write a Python function to calculate fibonacci numbers",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": "Always include detailed docstrings and type hints in Python code.",
}
),
):
messages.append(message)
if isinstance(message, AssistantMessage):
print(message.content)

async def main():
async for message in query(
prompt="Help me write a Python function to calculate fibonacci numbers",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": "Always include detailed docstrings and type hints in Python code.",
}
),
):
messages.append(message)
if isinstance(message, AssistantMessage):
print(message.content)


asyncio.run(main())
```
</CodeGroup>

Expand Down Expand Up @@ -226,20 +240,27 @@ The following example pairs a shared `append` block with `excludeDynamicSections
```

```python Python theme={null}
import asyncio

from claude_agent_sdk import query, ClaudeAgentOptions

async for message in query(
prompt="Triage the open issues in this repo",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": "You operate Acme's internal triage workflow. Label issues by component and severity.",
"exclude_dynamic_sections": True,
},
),
):
...

async def main():
async for message in query(
prompt="Triage the open issues in this repo",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": "You operate Acme's internal triage workflow. Label issues by component and severity.",
"exclude_dynamic_sections": True,
},
),
):
...


asyncio.run(main())
```
</CodeGroup>

Expand Down Expand Up @@ -279,6 +300,8 @@ You can provide a custom string as `systemPrompt` to replace the default entirel
```

```python Python theme={null}
import asyncio

from claude_agent_sdk import query, ClaudeAgentOptions, AssistantMessage

custom_prompt = """You are a Python coding specialist.
Expand All @@ -291,13 +314,18 @@ You can provide a custom string as `systemPrompt` to replace the default entirel

messages = []

async for message in query(
prompt="Create a data processing pipeline",
options=ClaudeAgentOptions(system_prompt=custom_prompt),
):
messages.append(message)
if isinstance(message, AssistantMessage):
print(message.content)

async def main():
async for message in query(
prompt="Create a data processing pipeline",
options=ClaudeAgentOptions(system_prompt=custom_prompt),
):
messages.append(message)
if isinstance(message, AssistantMessage):
print(message.content)


asyncio.run(main())
```
</CodeGroup>

Expand Down Expand Up @@ -404,28 +432,35 @@ The example below assumes a Code Reviewer output style is already active. The `a
```

```python Python theme={null}
import asyncio

from claude_agent_sdk import query, ClaudeAgentOptions

# Assuming "Code Reviewer" output style is active (via /config or settings)
# Add session-specific focus areas
messages = []

async for message in query(
prompt="Review this authentication module",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": """
For this review, prioritize:
- OAuth 2.0 compliance
- Token storage security
- Session management
""",
}
),
):
messages.append(message)

async def main():
async for message in query(
prompt="Review this authentication module",
options=ClaudeAgentOptions(
system_prompt={
"type": "preset",
"preset": "claude_code",
"append": """
For this review, prioritize:
- OAuth 2.0 compliance
- Token storage security
- Session management
""",
}
),
):
messages.append(message)


asyncio.run(main())
```
</CodeGroup>

Expand Down
27 changes: 21 additions & 6 deletions content/en/docs/claude-code/agent-sdk/skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,13 @@ To control tool access for Skills in SDK applications, use `allowedTools` to pre
allowed_tools=["Read", "Grep", "Glob"],
)

async for message in query(prompt="Analyze the codebase structure", options=options):
print(message)

async def main():
async for message in query(prompt="Analyze the codebase structure", options=options):
print(message)


asyncio.run(main())
```

```typescript TypeScript theme={null}
Expand Down Expand Up @@ -164,8 +169,13 @@ To see which Skills are available in your SDK application, simply ask Claude:
skills="all",
)

async for message in query(prompt="What Skills are available?", options=options):
print(message)

async def main():
async for message in query(prompt="What Skills are available?", options=options):
print(message)


asyncio.run(main())
```

```typescript TypeScript theme={null}
Expand Down Expand Up @@ -196,8 +206,13 @@ Test Skills by asking questions that match their descriptions:
allowed_tools=["Read", "Bash"],
)

async for message in query(prompt="Extract text from invoice.pdf", options=options):
print(message)

async def main():
async for message in query(prompt="Extract text from invoice.pdf", options=options):
print(message)


asyncio.run(main())
```

```typescript TypeScript theme={null}
Expand Down
Loading
Loading