hints

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package hints provides a system for showing helpful suggestions to users, particularly for multi-agent workflows where Claude sessions need to understand inter-session communication protocols.

Index

Constants

View Source
const (
	// PrimeInterval is how often to suggest running prime for multi-agent workflows.
	PrimeInterval = 7 * 24 * time.Hour // 1 week

	// FirstRunGracePeriod is how long before showing prime hint to new users.
	FirstRunGracePeriod = 1 * time.Hour
)

Variables

This section is empty.

Functions

func CheckAndShowHints

func CheckAndShowHints() bool

CheckAndShowHints checks if any hints should be shown and prints them. Returns true if any hints were shown.

func GetCurrentPrimeVersion

func GetCurrentPrimeVersion() string

GetCurrentPrimeVersion returns the current prime content version.

func GetVersionHash

func GetVersionHash() string

GetVersionHash returns a hash of the current binary's build info. This changes when the binary is rebuilt/updated.

func IsSuppressed

func IsSuppressed() bool

IsSuppressed returns true if hints are suppressed.

func PrimeHintMessage

func PrimeHintMessage(versionChanged, primeContentChanged bool) string

PrimeHintMessage returns the hint message for running prime.

func SetPrimeVersionFunc

func SetPrimeVersionFunc(f func() string)

SetPrimeVersionFunc sets the function to get the current prime version. Call this from main to wire up the prime package.

func Suppress

func Suppress()

Suppress prevents hints from being shown.

Types

type HintState

type HintState struct {
	PrimeShownAt     *time.Time `json:"prime_shown_at,omitempty"`
	QuickstartShown  *time.Time `json:"quickstart_shown_at,omitempty"`
	LastCommandRunAt *time.Time `json:"last_command_run_at,omitempty"`
	LastVersionHash  string     `json:"last_version_hash,omitempty"`  // Hash of binary version info
	LastPrimeVersion string     `json:"last_prime_version,omitempty"` // Hash of prime message content
}

HintState tracks when hints were last shown.

func LoadState

func LoadState() (*HintState, error)

LoadState loads the hint state from disk.

func (*HintState) MarkCommandRun

func (s *HintState) MarkCommandRun()

MarkCommandRun records that a command was run.

func (*HintState) MarkPrimeShown

func (s *HintState) MarkPrimeShown()

MarkPrimeShown records that prime was shown.

func (*HintState) MarkQuickstartShown

func (s *HintState) MarkQuickstartShown()

MarkQuickstartShown records that quickstart was shown.

func (*HintState) PrimeContentChanged

func (s *HintState) PrimeContentChanged() bool

PrimeContentChanged returns true if the prime message content has changed.

func (*HintState) Save

func (s *HintState) Save() error

Save persists the hint state to disk.

func (*HintState) ShouldShowPrimeHint

func (s *HintState) ShouldShowPrimeHint() bool

ShouldShowPrimeHint returns true if the prime hint should be shown. This happens when: - Prime has never been shown, OR - It's been more than PrimeInterval since prime was last shown - The binary version has changed since last prime - The prime content has changed since last seen AND the user has been using it2 for at least FirstRunGracePeriod

func (*HintState) VersionChanged

func (s *HintState) VersionChanged() bool

VersionChanged returns true if the binary version has changed since last run.

Jump to

Keyboard shortcuts

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