claude-code - 💡(How to fix) Fix [DOCS] Agent SDK user-input guide omits persistent localSettings Bash approval flow [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56155Fetched 2026-05-05 05:56:45
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Code Example

return {
behavior: "allow",
updatedInput: input,
updatedPermissions: options.suggestions
};

---

return PermissionResultAllow(
updated_input=input_data,
updated_permissions=context.get("suggestions")
)
RAW_BUFFERClick to expand / collapse

Documentation Type

Incorrect/outdated documentation

Documentation Location

https://code.claude.com/docs/en/agent-sdk/user-input

Section/Topic

"Handle tool approval requests" and "Respond to tool requests"

Current Documentation

The user-input guide currently says:

options (TS) / context (Python) | Additional context including optional suggestions (proposed PermissionUpdate entries to avoid re-prompting) and a cancellation signal.

And the response table immediately below says:

| Allow | PermissionResultAllow(updated_input=...) | { behavior: "allow", updatedInput } | | Deny | PermissionResultDeny(message=...) | { behavior: "deny", message } |

Meanwhile, the SDK references document the missing persistence details:

type PermissionResult = | { behavior: "allow"; updatedInput?: Record<string, unknown>; updatedPermissions?: PermissionUpdate[]; }

type PermissionUpdateDestination = | "userSettings" | "projectSettings" | "localSettings" // Gitignored local settings | "session"

And the hooks reference shows the concrete "Always allow" destination for permission suggestions:

permission_suggestions array contains the "always allow" options the user would normally see in the permission dialog.

"permission_suggestions": [ { "type": "addRules", "rules": [{ "toolName": "Bash", "ruleContent": "rm -rf node_modules" }], "behavior": "allow", "destination": "localSettings" } ]

What's Wrong or Missing?

A. The guide understates what SDK hosts receive for Bash permission prompts

As of v2.1.128, SDK hosts can receive a persistent localSettings suggestion for Bash permission prompts, but the user-input guide describes suggestions only as a generic way to "avoid re-prompting." It does not explain that this suggestion can correspond to the UI's "Always allow" action and persist to .claude/settings.local.json.

B. The guide's allow-response examples omit the persistence path entirely

The page documents only updated_input / updatedInput in approval responses, even though the SDK types also support updated_permissions / updatedPermissions. That leaves SDK integrators without a clear documented path for honoring a user's persistent Bash approval choice.

Suggested Improvement

Update the user-input guide to explain that:

  1. suggestions / permission_suggestions may include a persistent Bash approval entry with destination: "localSettings".
  2. Surfacing that option to the user is equivalent to offering "Always allow."
  3. Returning that entry via updatedPermissions / updated_permissions writes the rule to .claude/settings.local.json.

Add a short TypeScript and Python example after the current approval examples, for example:

TypeScript:

return {
behavior: "allow",
updatedInput: input,
updatedPermissions: options.suggestions
};

Python:

return PermissionResultAllow(
updated_input=input_data,
updated_permissions=context.get("suggestions")
)

If the exact Python context access pattern differs, the guide should still show the supported way to echo the persistent suggestion back so hosts can implement "Always allow" correctly for Bash prompts.

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageLine(s)Context
https://code.claude.com/docs/en/agent-sdk/user-input35, 60, 206-225Mentions generic suggestions, but approval responses only show updatedInput
https://code.claude.com/docs/en/agent-sdk/typescript644, 671, 2258-2262Reference documents suggestions, updatedPermissions, and localSettings destination
https://code.claude.com/docs/en/hooks1244-1245, 1258-1264, 1314-1319, 1321Shows that permission suggestions map to "always allow" behavior and can target .claude/settings.local.json
https://platform.claude.com/docs/en/agent-sdk/user-input31, 56, 204-223Platform mirror has the same omission in the SDK host guidance
https://platform.claude.com/docs/en/agent-sdk/typescript1113-1117, 2088-2092Platform reference also documents permission_suggestions and localSettings

Total scope: 5 pages affected

This gap appears after the v2.1.128 change that SDK hosts now receive a persistent localSettings suggestion for Bash permission prompts.

extent analysis

TL;DR

Update the user-input guide to explain the persistence path for Bash permission prompts, including the use of updatedPermissions and localSettings destination.

Guidance

  • Review the current documentation for options (TS) / context (Python) and the response table to ensure consistency with the SDK references.
  • Add examples in TypeScript and Python to demonstrate how to return updatedPermissions with a persistent Bash approval entry.
  • Verify that the updated guide clearly explains the relationship between suggestions, updatedPermissions, and the "Always allow" action.
  • Check the affected pages (listed in the Additional Context section) to ensure the updated guidance is reflected consistently across all relevant documentation.

Example

return {
  behavior: "allow",
  updatedInput: input,
  updatedPermissions: options.suggestions
};

Notes

The suggested improvement should be applied to all affected pages, including the user-input guide, TypeScript reference, and platform mirror documentation.

Recommendation

Apply the suggested improvement to update the user-input guide and ensure consistency across all affected pages, as this will provide a clear and accurate path for SDK integrators to honor a user's persistent Bash approval choice.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [DOCS] Agent SDK user-input guide omits persistent localSettings Bash approval flow [1 participants]