context_load_gate

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: 25 Imported by: 0

Documentation

Overview

Package context_load_gate implements the ctx system context-load-gate subcommand.

It auto-injects project context into the agent's context window on the first tool use per session, with subsequent calls silently skipped.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx system context-load-gate" subcommand.

Returns:

  • *cobra.Command: Configured context-load-gate subcommand

func Run

func Run(cmd *cobra.Command, stdin *os.File) error

Run executes the context-load-gate hook logic.

Injects project context files into the agent's context window on the first tool call of each session. Reads context files in priority order, extracts indexes for large files, appends a changes summary, and emits a webhook notification with token counts. Writes an oversize flag when total injected tokens exceed the configured threshold.

Parameters:

  • cmd: Cobra command for output
  • stdin: standard input for hook JSON

Returns:

  • error: Always nil (hook errors are non-fatal)

Types

This section is empty.

Jump to

Keyboard shortcuts

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