-
Notifications
You must be signed in to change notification settings - Fork 264
feat: add agents and setting sources support #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add support for custom agent definitions and setting sources control, matching the TypeScript SDK implementation. - Add AgentDefinition type with description, prompt, tools, and model - Add SettingSource type for controlling which settings to load - Update ClaudeCodeOptions with agents and setting_sources fields - Pass --agents and --setting-sources flags to CLI subprocess - Add agents.py example demonstrating custom agent usage 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add example demonstrating how setting_sources controls which settings are loaded (user, project, local) and affects available slash commands. - Add setting_sources.py example with three scenarios - Fix subprocess_cli to handle empty setting_sources array (pass empty string) - Example shows how project commands are excluded/included based on sources 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add end-to-end tests verifying agents and setting_sources functionality with real CLI interactions. - Test custom agent definitions are passed through - Test setting_sources=["user"] excludes project settings - Test setting_sources=["user", "project"] includes project settings - Use temporary directories for isolated testing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Change default behavior to match TypeScript SDK - when setting_sources is not provided, pass empty string to disable all settings loading. - Always pass --setting-sources flag (empty string when None) - Update examples to show default behavior (no settings) - Update e2e tests to verify default behavior and use output_style checking 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
dicksontsai
previously approved these changes
Sep 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea to leave an example like /commit in this repo.
dicksontsai
approved these changes
Sep 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
agents
optionsetting_sources
option/commit
slash command to projectChanges
Core Implementation
AgentDefinition
andSettingSource
types totypes.py
agents
andsetting_sources
fields toClaudeCodeOptions
--agents
and--setting-sources
flagssetting_sources
is not provided, pass empty string (no settings loaded)setting_sources
array correctly (pass empty string to CLI)Examples
examples/agents.py
: Demonstrates custom agent definitions with different tools and modelsexamples/setting_sources.py
: Shows how setting sources control which settings are loadedTests
output_style
checking to verify settings loaded/not loadedProject Config
.claude/commands/commit.md
slash command for git commitsTest Plan
🤖 Generated with Claude Code