caveman

package
v0.629.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package caveman implements an output-brevity policy that can be injected into the agent's system prompt before each turn, at three levels (lite/full/ultra) plus an off switch.

It is a Pando-owned re-implementation of the idea behind the caveman skill by Julius Brussee (https://github.com/juliusbrussee/caveman, MIT licensed): the upstream project compresses the assistant's prose to cut output tokens while keeping code, commands and errors exact. Pando does not vendor its assets, hooks or telemetry; only the output policy is reproduced here, in a neutral, safety-preserving form.

The policy constrains expression only. It never relaxes reasoning, tool use, testing or verification requirements, and it never reduces input or reasoning tokens — only the words the model writes back.

Index

Constants

View Source
const DisabledMessage = "Caveman output brevity disabled. Back to normal output."

DisabledMessage confirms /caveman-finish.

View Source
const FinishUsage = "Usage: /caveman-finish\nIt takes no level. To change level, use /caveman [lite|full|ultra]."

FinishUsage is shown when /caveman-finish is given an argument: the command takes no level, and silently ignoring one would hide the user's mistake.

View Source
const SettingDescription = "Reduces output-token usage by giving shorter explanations and removing filler. " +
	"It keeps code, commands, errors, reasoning quality, tool use, and verification intact. " +
	"Output savings vary; input and reasoning tokens are not reduced."

SettingDescription is the help text for the global default in the settings surfaces (TUI and Web UI). It must state the output-only caveat: the mode cannot reduce input or reasoning tokens, and the savings depend on the task.

View Source
const Usage = "Usage: /caveman [lite|full|ultra]\nNo argument defaults to full. Use /caveman-finish to disable."

Usage is the one-liner shown when /caveman gets an unsupported level.

Variables

This section is empty.

Functions

func ActivationMessage

func ActivationMessage(m Mode) string

ActivationMessage is the confirmation for /caveman. It states what changes (fewer words) and, just as importantly, what does not: reasoning, tool use, testing and verification are untouched, and the savings are output-only.

func Description

func Description(m Mode) string

Description returns a one-line summary of a mode for confirmation messages.

func Instructions

func Instructions(m Mode) string

Instructions returns the full caveman policy to inject for the given mode, or the empty string when the mode is off. The result is the always-on core policy plus the snippet for the active level.

func SettingOptions

func SettingOptions() []string

SettingOptions lists the selectable values for the global default, in the order the settings surfaces present them.

Types

type Mode

type Mode string

Mode is the caveman output-brevity level for a session.

const (
	// ModeOff disables caveman; nothing is injected.
	ModeOff Mode = ""
	// ModeLite trims filler but keeps normal sentences.
	ModeLite Mode = "lite"
	// ModeFull is the default: terse fragments, no unrequested prose.
	ModeFull Mode = "full"
	// ModeUltra is maximally terse: answer only, near-telegraphic.
	ModeUltra Mode = "ultra"
)

func ParseMode

func ParseMode(input string) (Mode, bool)

ParseMode normalizes user input into a Mode. It accepts the level names plus a few natural-language off synonyms ("off", "stop", "normal", "none", "disable"). The second return value is false when the input is not a recognized token.

func (Mode) IsActive

func (m Mode) IsActive() bool

IsActive reports whether the mode injects anything.

func (Mode) String

func (m Mode) String() string

String returns a human-readable label for the mode.

Jump to

Keyboard shortcuts

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