# Practical ways to use the Claude Agent SDK
๐ Customize system prompts flexibly with three levels: preset, append, and full replacement.
System Prompt Modification offers three levels of customization via `systemPrompt`: Claude Code preset, append, and custom string replacement.
๐ Title: Modifying System Prompts
๐ URL:
๐งฉ Overview
Use `preset: "claude_code"` for the full Claude Code prompt, `append` to add to the preset, or a custom string for complete replacement. Output style files enable cross-CLI/SDK persona reuse.
๐ How to use it
`system_prompt` accepts three forms: preset with `{"type": "preset", "preset": "claude_code"}`, append with `"append": "extra instructions"`, or a custom string for full replacement. Use `excludeDynamicSections: true` for cross-session prompt cache sharing.
๐ Practical usage
- For coding agents, use `preset: "claude_code"` for the full prompt with tool guidance and safety rules.
- Append team conventions like "Always add docstrings and type hints to Python" โ the safest customization that removes nothing.
- For support bots or data analysis assistants with unique personas, use a custom string for complete replacement.
- Use `excludeDynamicSections: true` to share prompt cache across users/machines and reduce fleet costs.
๐ก Use cases
๐ค Claude Code-compatible coding agents
๐ Automatic team convention enforcement
๐ญ Custom persona agents
โ ๏ธ Watch out
When using custom string replacement, you must provide your own tool guidance and safety instructions. `excludeDynamicSections` requires TS v0.2.98+ / Python v0.1.58+.
#
ClaudeAgentSDK# #
AI#