system

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package system provides hidden subcommands that implement Claude Code hook logic as native Go binaries, replacing the shell scripts previously deployed to .claude/hooks/.

All subcommands read JSON from stdin (Claude Code hook contract), perform their logic, and exit 0. Block commands output JSON with a "decision" field.

Subcommands:

  • check-context-size: Adaptive prompt counter with checkpoint messages
  • check-persistence: Context file mtime watcher with persistence nudges
  • check-journal: Unexported sessions + unenriched entries reminder
  • block-non-path-ctx: Blocks non-PATH ctx invocations
  • post-commit: Post-commit context capture nudge
  • cleanup-tmp: Removes stale temp files on session end

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the hidden "ctx system" parent command.

All subcommands implement Claude Code hook logic as native Go binaries. They are not intended for direct user invocation.

Returns:

  • *cobra.Command: Hidden parent command with all hook subcommands registered

Types

type HookInput

type HookInput struct {
	SessionID string    `json:"session_id"`
	ToolInput ToolInput `json:"tool_input"`
}

HookInput represents the JSON payload that Claude Code sends to hook commands via stdin.

type ToolInput

type ToolInput struct {
	Command string `json:"command"`
}

ToolInput contains the tool-specific fields from a Claude Code hook invocation. For Bash hooks, Command holds the shell command.

Jump to

Keyboard shortcuts

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