system

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package system provides the "ctx system" command for resource monitoring and hidden subcommands that implement Claude Code hook logic as native Go binaries, replacing the shell scripts previously deployed to .claude/hooks/.

Visible subcommands:

  • backup: Create timestamped tar.gz archives of context/Claude data
  • resources: Display system resource usage with threshold alerts
  • bootstrap: Print context location for AI agents
  • message: Manage hook message templates

Plumbing subcommands (hidden, used by skills and automation):

  • mark-journal: Update journal processing state (.state.json)

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

Hook subcommands (hidden):

  • 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
  • check-version: Version update nudge
  • check-resources: Resource pressure monitor (DANGER-only VERBATIM relay)
  • check-knowledge: Knowledge file growth nudge (daily throttle)
  • check-map-staleness: Architecture map staleness nudge (daily throttle)
  • block-non-path-ctx: Blocks non-PATH ctx invocations
  • block-dangerous-commands: Blocks dangerous command patterns (project-local)
  • check-backup-age: Backup staleness check (project-local)
  • post-commit: Post-commit context capture nudge
  • qa-reminder: Reminds agent to lint/test full project before declaring done

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx system" parent command.

Visible subcommands:

  • resources: Display system resource usage with threshold alerts
  • message: Manage hook message templates (list/show/edit/reset)

Hidden plumbing subcommands (used by skills and automation):

  • mark-journal: Update journal processing state
  • mark-wrapped-up: Suppress checkpoint nudges after wrap-up

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

Returns:

  • *cobra.Command: Parent command with resource display, plumbing, and hook subcommands

Types

This section is empty.

Directories

Path Synopsis
cmd
backup
Package backup implements the ctx system backup subcommand.
Package backup implements the ctx system backup subcommand.
block_dangerous_command
Package block_dangerous_commands implements the ctx system block-dangerous-commands subcommand.
Package block_dangerous_commands implements the ctx system block-dangerous-commands subcommand.
block_non_path_ctx
Package block_non_path_ctx implements the ctx system block-non-path-ctx subcommand.
Package block_non_path_ctx implements the ctx system block-non-path-ctx subcommand.
bootstrap
Package bootstrap implements the ctx system bootstrap subcommand.
Package bootstrap implements the ctx system bootstrap subcommand.
check_backup_age
Package check_backup_age implements the ctx system check-backup-age subcommand.
Package check_backup_age implements the ctx system check-backup-age subcommand.
check_ceremony
Package check_ceremonies implements the ctx system check-ceremonies subcommand.
Package check_ceremonies implements the ctx system check-ceremonies subcommand.
check_context_size
Package check_context_size implements the ctx system check-context-size subcommand.
Package check_context_size implements the ctx system check-context-size subcommand.
check_freshness
Package check_freshness implements the ctx system check-freshness subcommand.
Package check_freshness implements the ctx system check-freshness subcommand.
check_journal
Package check_journal implements the ctx system check-journal subcommand.
Package check_journal implements the ctx system check-journal subcommand.
check_knowledge
Package check_knowledge implements the ctx system check-knowledge subcommand.
Package check_knowledge implements the ctx system check-knowledge subcommand.
check_map_staleness
Package check_map_staleness implements the ctx system check-map-staleness subcommand.
Package check_map_staleness implements the ctx system check-map-staleness subcommand.
check_memory_drift
Package check_memory_drift implements the ctx system check-memory-drift subcommand.
Package check_memory_drift implements the ctx system check-memory-drift subcommand.
check_persistence
Package check_persistence implements the ctx system check-persistence subcommand.
Package check_persistence implements the ctx system check-persistence subcommand.
check_reminder
Package check_reminders implements the ctx system check-reminders subcommand.
Package check_reminders implements the ctx system check-reminders subcommand.
check_resources
Package check_resources implements the ctx system check-resources subcommand.
Package check_resources implements the ctx system check-resources subcommand.
check_task_completion
Package check_task_completion implements the ctx system check-task-completion subcommand.
Package check_task_completion implements the ctx system check-task-completion subcommand.
check_version
Package check_version implements the ctx system check-version subcommand.
Package check_version implements the ctx system check-version subcommand.
context_load_gate
Package context_load_gate implements the ctx system context-load-gate subcommand.
Package context_load_gate implements the ctx system context-load-gate subcommand.
events
Package events implements the ctx system events subcommand.
Package events implements the ctx system events subcommand.
heartbeat
Package heartbeat implements the ctx system heartbeat subcommand.
Package heartbeat implements the ctx system heartbeat subcommand.
mark_journal
Package mark_journal implements the ctx system mark-journal subcommand.
Package mark_journal implements the ctx system mark-journal subcommand.
mark_wrapped_up
Package mark_wrapped_up implements the ctx system mark-wrapped-up subcommand.
Package mark_wrapped_up implements the ctx system mark-wrapped-up subcommand.
message
Package message provides the parent command for ctx system message.
Package message provides the parent command for ctx system message.
message/cmd/edit
Package edit provides the ctx system message edit subcommand for customizing hook templates.
Package edit provides the ctx system message edit subcommand for customizing hook templates.
message/cmd/list
Package list provides the ctx system message list subcommand for displaying available hook messages.
Package list provides the ctx system message list subcommand for displaying available hook messages.
message/cmd/reset
Package reset provides the ctx system message reset subcommand for restoring default hook templates.
Package reset provides the ctx system message reset subcommand for restoring default hook templates.
message/cmd/root
Package root provides the parent command for ctx system message.
Package root provides the parent command for ctx system message.
message/cmd/show
Package show provides the ctx system message show subcommand for viewing hook template content.
Package show provides the ctx system message show subcommand for viewing hook template content.
pause
Package pause implements the ctx system pause subcommand.
Package pause implements the ctx system pause subcommand.
post_commit
Package post_commit implements the ctx system post-commit subcommand.
Package post_commit implements the ctx system post-commit subcommand.
prune
Package prune implements the ctx system prune subcommand.
Package prune implements the ctx system prune subcommand.
qa_reminder
Package qa_reminder implements the ctx system qa-reminder subcommand.
Package qa_reminder implements the ctx system qa-reminder subcommand.
resources
Package resources implements the ctx system resources subcommand.
Package resources implements the ctx system resources subcommand.
resume
Package resume implements the ctx system resume subcommand.
Package resume implements the ctx system resume subcommand.
specs_nudge
Package specs_nudge implements the ctx system specs-nudge subcommand.
Package specs_nudge implements the ctx system specs-nudge subcommand.
stats
Package stats implements the ctx system stats subcommand.
Package stats implements the ctx system stats subcommand.
Package core provides shared helpers used by all system subcommand packages.
Package core provides shared helpers used by all system subcommand packages.
archive
Package archive creates compressed tar archives of context data with optional SMB backup.
Package archive creates compressed tar archives of context data with optional SMB backup.
bootstrap
Package bootstrap checks plugin installation status and emits warnings during context bootstrap.
Package bootstrap checks plugin installation status and emits warnings during context bootstrap.
ceremony
Package ceremony assembles hook ceremony output from recent journal files and message templates.
Package ceremony assembles hook ceremony output from recent journal files and message templates.
check
Package check provides shared preamble logic and throttling for hook input processing.
Package check provides shared preamble logic and throttling for hook input processing.
counter
Package counter reads and writes integer counters persisted in state files.
Package counter reads and writes integer counters persisted in state files.
drift
Package drift detects version drift across VERSION, plugin, and marketplace files and reports stale context entries.
Package drift detects version drift across VERSION, plugin, and marketplace files and reports stale context entries.
event
Package event formats and renders event log timestamps and entries.
Package event formats and renders event log timestamps and entries.
health
Package health monitors context health by detecting stale architecture maps and pruning expired state files.
Package health monitors context health by detecting stale architecture maps and pruning expired state files.
heartbeat
Package heartbeat reads and writes mtime values for session heartbeat tracking.
Package heartbeat reads and writes mtime values for session heartbeat tracking.
journal
Package journal scans journal directories for the newest file modification time and manages journal state.
Package journal scans journal directories for the newest file modification time and manages journal state.
knowledge
Package knowledge scans knowledge files against configured thresholds and emits warnings when limits are exceeded.
Package knowledge scans knowledge files against configured thresholds and emits warnings when limits are exceeded.
load
Package load extracts index content from context files and handles load-gate logic during session startup.
Package load extracts index content from context files and handles load-gate logic during session startup.
log
Package log appends timestamped messages to hook log files with automatic rotation.
Package log appends timestamped messages to hook log files with automatic rotation.
message
Package message loads and renders hook message templates with priority resolution between user overrides and defaults.
Package message loads and renders hook message templates with priority resolution between user overrides and defaults.
nudge
Package nudge emits checkpoint, pause, and oversize nudge notifications during sessions.
Package nudge emits checkpoint, pause, and oversize nudge notifications during sessions.
persistence
Package persistence tracks edit counter state for persistence nudge timing.
Package persistence tracks edit counter state for persistence nudge timing.
session
Package session builds hook JSON responses and manages session token tracking.
Package session builds hook JSON responses and manages session token tracking.
state
Package state provides the project-scoped runtime state directory and initialization checks.
Package state provides the project-scoped runtime state directory and initialization checks.
stats
Package stats provides session token usage statistics reading and formatting.
Package stats provides session token usage statistics reading and formatting.
time
Package time returns the most recent modification time across context files.
Package time returns the most recent modification time across context files.
version
Package version parses semantic versions and checks for update availability.
Package version parses semantic versions and checks for update availability.

Jump to

Keyboard shortcuts

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