claude

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 32 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	SubagentModelEnv      = "CLAUDE_CODE_SUBAGENT_MODEL"
	ToolUseConcurrencyEnv = "CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY"
	ToolSearchEnv         = "ENABLE_TOOL_SEARCH"
	// DefaultOutputStyle sets Claude Code's output style for every ccl-launched
	// session. "Concise" favors terse, direct responses over extra explanation.
	DefaultOutputStyle = "Concise"
)

Variables

This section is empty.

Functions

func AdvertisedContextWindows added in v1.3.16

func AdvertisedContextWindows(endpoint, apiKey string) (map[string]int, string)

AdvertisedContextWindows reads the context window of every model a runtime exposes, keyed by lowercased model id, plus the catalog it came from.

Subscription runtimes only reveal windows through the Codex client catalog; the plain OpenAI list is trimmed to id/object/created/owned_by. Both shapes are tried so API-key gateways still work. The values are advisory: they may be a client-side catalog cap rather than what the server enforces.

func AgentProcessEnv added in v1.5.22

func AgentProcessEnv(options json.RawMessage) ([]string, error)

AgentProcessEnv supplies initial authentication for the adapter's auth probe. All other provider settings belong to SDK options, so a long-lived adapter cannot pass its initial provider's custom env to sessions using another one.

func ConfigureSignOn added in v1.6.6

func ConfigureSignOn(enabled bool)

ConfigureSignOn records the persisted switch. It must be called once a command has loaded its config, before any Claude Code launch.

func ContextClassLabel added in v1.3.16

func ContextClassLabel(window int) string

ContextClassLabel names the sizing Claude Code will use for an advertised window, for diagnostics.

func MappedContextClassesDiffer added in v1.3.16

func MappedContextClassesDiffer(p provider.Provider, windows map[string]int) bool

MappedContextClassesDiffer reports whether the provider's mapped models fall into more than one context class, which is when no session-wide context value could be correct for all of them.

func PreviewSettings

func PreviewSettings(p provider.Provider) (string, error)

PreviewSettings returns the JSON that would be written to the settings temp file.

func Run

func Run(p provider.Provider, args []string) error

Run launches the Claude CLI with settings derived from p, forwarding extra args.

func SigningEnabled added in v1.6.6

func SigningEnabled() bool

SigningEnabled reports whether ccl leaves Claude Code's attribution alone.

func UserSettingsPath added in v1.5.21

func UserSettingsPath() string

func WriteGlobalSigning added in v1.6.6

func WriteGlobalSigning(enabled bool) (changed bool, err error)

WriteGlobalSigning merges Claude Code's attribution setting into the user's settings file, keeping every other key.

Turning signing off writes ccl's empty attribution. Turning it back on only removes the value ccl wrote: a custom attribution text the user chose is left in place, and changed reports false.

Types

type AgentLaunch added in v1.5.22

type AgentLaunch struct {
	// contains filtered or unexported fields
}

AgentLaunch owns only CCL's provider runtime. The ACP adapter owns the SDK and its Claude executable, so preparing this launch needs no installed CLI and writes no temporary Claude settings file.

func PrepareAgentContext added in v1.5.22

func PrepareAgentContext(ctx context.Context, p provider.Provider) (*AgentLaunch, error)

func (*AgentLaunch) Close added in v1.5.22

func (l *AgentLaunch) Close()

func (*AgentLaunch) Options added in v1.5.22

func (l *AgentLaunch) Options(cwd string) (json.RawMessage, error)

Options is the upstream adapter's documented _meta.claudeCode.options object. Resolve preferences for the client's cwd, not CCL's startup cwd.

type ClaudeAccountAgentLaunch added in v1.7.11

type ClaudeAccountAgentLaunch struct {
	ConfigDir string
	Provider  provider.Provider
}

ClaudeAccountAgentLaunch uses Claude's native subscription inside the selected profile; protocol and token refresh stay with the upstream SDK.

func (ClaudeAccountAgentLaunch) Close added in v1.7.11

func (ClaudeAccountAgentLaunch) Close()

func (ClaudeAccountAgentLaunch) Options added in v1.7.11

type DefaultAgentLaunch added in v1.6.2

type DefaultAgentLaunch struct{}

DefaultAgentLaunch runs ACP sessions on Claude Code's own configuration (the "default" selector) exactly as it stands, including a running ccl proxy's overlay: no provider runtime, no settings, and every routing key the adapter's long-lived process may hold from another provider is put back to ccl's own environment, as a plain Claude Code launch would see it.

func (DefaultAgentLaunch) Close added in v1.6.2

func (DefaultAgentLaunch) Close()

func (DefaultAgentLaunch) Options added in v1.6.2

func (DefaultAgentLaunch) Options(cwd string) (json.RawMessage, error)

type GlobalSigning added in v1.6.6

type GlobalSigning int

GlobalSigning describes what ~/.claude/settings.json says about attribution.

const (
	// GlobalSigningDefault means no attribution is configured, so Claude Code
	// signs.
	GlobalSigningDefault GlobalSigning = iota
	// GlobalSigningDisabled means the user's settings hide the signature.
	GlobalSigningDisabled
	// GlobalSigningCustom means the user configured their own attribution text.
	GlobalSigningCustom
)

func ReadGlobalSigning added in v1.6.6

func ReadGlobalSigning() GlobalSigning

ReadGlobalSigning inspects the user's own Claude Code settings.

type Launch added in v1.5.13

type Launch struct {
	Path         string
	SettingsPath string
	Env          []string
	Session      *providersession.Session
	// DroppedContextOverride reports that the provider's context env was not a
	// supported preset and was left out of this session.
	DroppedContextOverride bool
	// contains filtered or unexported fields
}

Launch is a prepared Claude Code process spec: settings file, env, and the optional embedded proxy. The caller must Close it.

func Prepare added in v1.5.13

func Prepare(p provider.Provider) (*Launch, error)

Prepare resolves the provider runtime and writes a settings file without attaching stdio or printing. The caller must Close the result.

func PrepareContext added in v1.5.13

func PrepareContext(ctx context.Context, p provider.Provider) (*Launch, error)

PrepareContext is Prepare with caller-controlled cancellation for provider discovery and embedded runtime startup.

func (*Launch) Close added in v1.5.13

func (l *Launch) Close()

Close removes the settings file and stops the embedded proxy. It is safe to call more than once.

func (*Launch) Command added in v1.5.13

func (l *Launch) Command(args ...string) *exec.Cmd

Command returns a Claude Code process using this launch's path, settings, and env. Extra args are appended after --settings. Stdio is left unset.

type RuntimeSettings added in v1.3.1

type RuntimeSettings struct {
	SubagentModel string
}

RuntimeSettings are ccl's Claude Code process defaults. Provider Env values override these defaults so advanced users retain an escape hatch.

func ResolveRuntimeSettings added in v1.3.1

func ResolveRuntimeSettings(p provider.Provider) RuntimeSettings

Jump to

Keyboard shortcuts

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