Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
An Anthropic Claude Agent SDK for PHP and Laravel: AI agents with tool use, sandboxing, MCP servers, subagents, hooks and structured output through the Claude Code CLI.
翻訳待ち
開発ツールGitHub @mohamed-ashraf-elsaedオンライン所有者未確認
Have you tried it? One tap is enough. No sign-in needed.
リポジトリ情報はまだ収集していません。
No updates detected yet. GitHub releases will appear here.
Anthropic Claude Agent SDK for PHP & Laravel — build AI agents with tool use, sandboxing, MCP servers, subagents, hooks, and structured output via the Claude Code CLI
翻訳待ち
Loading the full README.
Read the full README ↗Build AI agents with Claude Code as a library in your Laravel applications. This SDK wraps the Claude Code CLI to give your app access to file operations, bash commands, code editing, web search, subagents, and more.
npm install -g @anthropic-ai/claude-code)composer require mohamed-ashraf-elsaed/claude-agent-sdk-laravel
Publish the config:
php artisan vendor:publish --tag=claude-agent-config
Add your API key to .env:
ANTHROPIC_API_KEY=your-api-key
use ClaudeAgentSDK\Facades\ClaudeAgent;
$result = ClaudeAgent::query('What files are in this directory?');
echo $result->text(); // Final text result
echo $result->costUsd(); // Cost in USD
echo $result->sessionId; // Session ID for resuming
use ClaudeAgentSDK\Options\ClaudeAgentOptions;
$options = ClaudeAgentOptions::make()
->tools(['Read', 'Edit', 'Bash', 'Grep', 'Glob'])
->permission('acceptEdits')
->maxTurns(10)
->maxBudgetUsd(5.00)
->cwd('/path/to/project');
$result = ClaudeAgent::query('Find and fix the bug in auth.php', $options);
if ($result->isSuccess()) {
echo $result->text();
}
use ClaudeAgentSDK\Messages\AssistantMessage;
use ClaudeAgentSDK\Messages\ResultMessage;
foreach (ClaudeAgent::stream('Refactor the User model') as $message) {
if ($message instanceof AssistantMessage) {
echo $message->text();
}
if ($message instanceof ResultMessage) {
echo "\nDone! Cost: $" . $message->totalCostUsd;
}
}
$result = ClaudeAgent::streamCollect(
prompt: 'Create a REST API for products',
onMessage: function ($message) {
if ($message instanceof AssistantMessage) {
Log::info($message->text());
}
},
options: ClaudeAgentOptions::make()->tools(['Read', 'Write', 'Bash']),
);
echo $result->text();
$options = ClaudeAgentOptions::make()
->tools(['Read', 'Write', 'Edit', 'Bash', 'Grep', 'Glob'])
->disallow(['WebFetch'])
->model('claude-sonnet-4-5-20250929')
->permission('acceptEdits')
->maxTurns(15)
->maxBudgetUsd(10.00)
->maxThinkingTokens(8000)
->fallbackModel('claude-haiku-4-5')
->cwd('/path/to/project')
->env('MY_VAR', 'value')
->settingSources(['project'])
->useClaudeCodePrompt('Also follow PSR-12.')
->betas(['context-1m-2025-08-07'])
->permissionPromptToolName('my_custom_tool')
->resumeSessionAt('2025-01-15T10:30:00Z')
->allowDangerouslySkipPermissions();
$options = ClaudeAgentOptions::fromArray([
'allowed_tools' => ['Read', 'Bash'],
'permission_mode' => 'bypassPermissions',
'max_turns' => 5,
'max_budget_usd' => 5.00,
'max_thinking_tokens' => 10000,
]);
// Custom string
$options->systemPrompt('You are a Laravel expert. Always use Eloquent.');
// Claude Code preset (includes default agent behavior)
$options->useClaudeCodePrompt();
// Claude Code preset with additions
$options->useClaudeCodePrompt('Follow PSR-12 and use strict types.');
| Mode | Behavior |
|---|---|
default | Ask for permission on each tool use |
acceptEdits | Auto-accept file edits, ask for others |
dontAsk | Don't ask but log decisions |
bypassPermissions | Skip all permission checks |
plan | Create a plan but don't execute |
For fine-grained control over tool permissions, use canUseTool() to register a callback that approves, denies, or modifies each tool invocation:
use ClaudeAgentSDK\Permissions\PermissionResultAllow;
use ClaudeAgentSDK\Permissions\PermissionResultDeny;
$options = ClaudeAgentOptions::make()
->canUseTool(function (string $toolName, array $input) {
if ($toolName === 'Bash' && str_contains($input['command'] ?? '', 'rm -rf')) {
return new PermissionResultDeny('Destructive commands not allowed');
}
if ($toolName === 'Write') {
return new PermissionResultAllow(
updatedInput: array_merge($input, ['file_path' => '/sandbox' . $input['file_path']])
);
}
return new PermissionResultAllow();
});
Return PermissionResultAllow to approve (optionally with modified input), or PermissionResultDeny with a reason to block the tool call.
Run shell commands before or after Claude uses tools. The SDK supports all 12 hook events:
This is the beginning of the README. Read the rest at the original. Read the full README ↗