NAME

Acme::Claude::Shell::Query - Single-shot query mode for Acme::Claude::Shell

SYNOPSIS

use Acme::Claude::Shell::Query;
use IO::Async::Loop;

my $loop = IO::Async::Loop->new;

my $query = Acme::Claude::Shell::Query->new(
    loop      => $loop,
    dry_run   => 0,
    safe_mode => 1,
);

my $result = $query->run("find all large log files")->get;

DESCRIPTION

Executes a single natural language command through Claude::Agent's query(). Each run is independent: no context is kept between calls. This suits scripting, or a one-shot command without starting an interactive session.

ATTRIBUTES

loop

The IO::Async::Loop to run on. Required.

dry_run

Preview mode. Default 0.

safe_mode

Ask for extra confirmation before dangerous commands. Default 1.

working_dir

Starting directory for commands. Default ..

colorful

Use colored output and spinners. Default 1.

verbose

Log every tool call and notification through the hooks. Default 0.

audit_log

Record every tool call in _audit_log. Default 0.

model

Claude model to use. Optional.

effort

Effort level: low, medium, high, xhigh or max. Optional.

_history, _spinner, _session_start, _tool_count, _tool_errors, _audit_log

State the tools and hooks read and write.

METHODS

new

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

options

The Claude::Agent::Options for the query. The CLI's built-in tools are turned off, so every command goes through execute_command and its approval menu.

run

my $result = $query->run($prompt)->get;

Execute one prompt. Returns a Future of the Claude::Agent::Message::Result.

AUTHOR

LNATION, <email at lnation.org>

LICENSE AND COPYRIGHT

This software is Copyright (c) 2026 by LNATION.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)