3 ファイル変更+50-0
この更新の概要
ユーザー入力の承認プロセスにおいて、特定のツール実行許可を保存して次回以降のプロンプトをスキップする「Approve and remember」機能の説明と実装例が追加されました。プラグイン機能では、ディレクトリの指定に加えてZIPアーカイブ形式の読み込みが新たにサポートされています。また、ルーチン機能におけるMCPサーバーの扱いについて、ローカル設定とclaude.ai上のコネクタ設定の使い分けに関する注意点が明記されました。
ツール実行時の許可設定を永続化するためのupdatedPermissionsプロパティと、それを利用したPythonおよびTypeScriptの実装例が追加されました。
@@ -217,6 +217,7 @@ Beyond allowing or denying, you can modify the tool's input or provide context t
- **Approve**: let the tool execute as Claude requested
- **Approve with changes**: modify the input before execution (e.g., sanitize paths, add constraints)
- **Approve and remember**: echo a suggested permission rule back so matching calls skip the prompt next time
- **Reject**: block the tool and tell Claude why
- **Suggest alternative**: block but guide Claude toward what the user wants instead
- **Redirect entirely**: use [streaming input](/en/agent-sdk/streaming-vs-single-mode) to send Claude a completely new instruction
@@ -273,6 +274,47 @@ canUseTool: async (toolName, input) => {
};
```
The user approves and doesn't want to be asked again for this kind of call. The third callback argument carries `suggestions`, an array of ready-made [`PermissionUpdate`](/en/agent-sdk/typescript#permissionupdate) entries. Echo one back in `updatedPermissions` to apply it. A suggestion with the `localSettings` destination writes the rule to `.claude/settings.local.json` so future sessions skip the prompt for matching calls.
The Python example requires `claude-agent-sdk` 0.1.80 or later.
```python Python theme={null}
async def can_use_tool(tool_name, input_data, context):
choice = await ask_user(f"Allow {tool_name}?", ["once", "always", "no"])
if choice == "always":
persist = [
s for s in context.suggestions if s.destination == "localSettings"
]
return PermissionResultAllow(
updated_input=input_data, updated_permissions=persist
)
if choice == "once":
return PermissionResultAllow(updated_input=input_data)
return PermissionResultDeny(message="User declined")
```
```typescript TypeScript theme={null}
canUseTool: async (toolName, input, { suggestions = [] }) => {
const choice = await askUser(`Allow ${toolName}?`, ["once", "always", "no"]);
if (choice === "always") {
const persist = suggestions.filter(
(s) => s.destination === "localSettings"
);
return {
behavior: "allow",
updatedInput: input,
updatedPermissions: persist
};
}
if (choice === "once") {
return { behavior: "allow", updatedInput: input };
}
return { behavior: "deny", message: "User declined" };
};
```
The user doesn't want this action to happen. Block the tool and provide a message explaining why. Claude sees this message and may try a different approach.
```python Python theme={null}
@@ -274,6 +274,12 @@ Use the `--plugin-dir` flag to test plugins during development. This loads your
claude --plugin-dir ./my-plugin
```
The flag also accepts a `.zip` archive of the plugin directory, which requires Claude Code v2.1.128 or later.
```bash
claude --plugin-dir ./my-plugin.zip
```
When a `--plugin-dir` plugin has the same name as an installed marketplace plugin, the local copy takes precedence for that session. This lets you test changes to a plugin you already have installed without uninstalling it first. Marketplace plugins force-enabled by managed settings are the only exception and cannot be overridden.
As you make changes to your plugin, run `/reload-plugins` to pick up the updates without restarting. This reloads plugins, skills, agents, hooks, plugin MCP servers, and plugin LSP servers. Test your plugin components:
@@ -265,6 +265,8 @@ By default, Claude can only push to branches prefixed with `claude/`. This preve
Routines can use your connected MCP connectors to read from and write to external services during each run. For example, a routine that triages support requests might read from a Slack channel and create issues in Linear.
Connectors are the [claude.ai integrations](/en/mcp#use-mcp-servers-from-claude-ai) on your account. MCP servers you added locally in the CLI with `claude mcp add` are stored on your machine rather than your claude.ai account, so they do not appear in the connectors list. To use one of those servers in a routine, add it as a connector at [claude.ai/customize/connectors](https://claude.ai/customize/connectors), or declare it in a committed [`.mcp.json`](/en/mcp#project-scope) so it is part of the cloned repository.
When you create a routine, all of your currently connected connectors are included by default. Remove any that aren't needed to limit which tools Claude has access to during the run. You can also add connectors directly from the routine form.
To manage or add connectors outside of the routine form, visit **Settings > Connectors** on claude.ai or use `/schedule update` in the CLI.