NAME

Claude::Agent::Permission::Context - Context passed to the can_use_tool callback

DESCRIPTION

The third argument of a can_use_tool callback: what the CLI said when it asked whether the tool may run.

ATTRIBUTES

tool_name

The tool being asked about. Required.

tool_input

The tool's input. Required; an empty hashref when the tool takes none.

session_id

The session the request belongs to.

cwd

The working directory of the session.

tool_use_id

The id of the tool use, matching the assistant message's tool_use block.

agent_id

The subagent asking, when it is not the main conversation.

suggestions

ArrayRef of the permission rule updates the CLI would offer in its own prompt, each in the CLI's PermissionUpdate shape. Pass any of them back in an allow result's updated_permissions to make the decision stick.

blocked_path

The path a file tool was refused for, when that is why the CLI asked.

decision_reason

The CLI's reason for asking.

title, display_name, description

Text the CLI would show in its own prompt.

query

The Claude::Agent::Query the request arrived on.

METHODS

new

Takes a flat list of name/value pairs. Unknown names are ignored.

AUTHOR

LNATION, <email at lnation.org>

LICENSE

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under The Artistic License 2.0 (GPL Compatible).