claude

package
v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package claude builds and runs the sandboxed `claude` command: it parses the launcher's arguments, constructs the `nono wrap … claude …` invocation (including the hook settings injected in hook mode), and executes it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildArgs

func BuildArgs(cfg *config.Config, opts Options) (string, []string, error)

BuildArgs constructs the nono executable path and the argv used to launch Claude under the sandbox for cfg. In hook mode it injects the PreToolUse hook via `claude --settings`; otherwise it disables the Bash and Monitor tools.

func Run

func Run(cfg *config.Config, opts Options) error

Run builds the launch command for cfg and replaces the current process with it via syscall.Exec. It returns only on failure.

func ValidatePassthrough

func ValidatePassthrough(claudeOpts []string) error

ValidatePassthrough rejects claude passthrough options that agent-sandbox reserves for itself (currently --settings, used to inject the hook config).

Types

type Options

type Options struct {
	NonoOpts   []string
	ClaudeOpts []string
}

Options is the split invocation for the claude launcher: options passed through to `nono wrap` and options passed through to `claude`.

func ParseArgs

func ParseArgs(args []string, defaultConfig string) (configFile string, opts Options)

ParseArgs splits the raw args passed to the claude/debug command into the config-file path and the nono/claude passthrough options. The first standalone "--" separates nono options (before) from claude options (after); with no "--", every token is a nono option. A "--config <val>" or "--config=<val>" appearing in the nono region sets the config path and is removed from the nono options. defaultConfig is used when no "--config" is given. This is needed because the command disables cobra flag parsing to pass options verbatim.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL