shim

package
v0.182.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package shim is the hook shim logic shared by the caprock-hook binary and the hidden `caprock hook` fallback command. It reads a hook payload from stdin, POSTs it to the local daemon, and never fails: every error path is silent and the caller exits 0. See .ai/03-contracts.md § Hook shim.

Index

Constants

View Source
const CursorArg = "cursor"

CursorArg is the argument that makes the shim answer Cursor rather than Claude Code: hooks.json registers `"<shim>" cursor` (ADR-095).

View Source
const (

	// DebugEnv, when set, appends diagnostics to <data_dir>/hook-debug.log.
	DebugEnv = "CAPROCK_HOOK_DEBUG"
)

Variables

This section is empty.

Functions

func Run

func Run(stdin io.Reader, stdout io.Writer)

Run executes one shim invocation. It returns nothing: callers always exit 0.

func RunCursor added in v0.177.0

func RunCursor(stdin io.Reader, stdout io.Writer)

RunCursor is one Cursor hook invocation. Its first act is to print the neutral reply, so Cursor has its answer whatever happens next; then it forwards the payload to the daemon within the same budget as a Claude Code hook, and every failure is silent (rule 3).

Types

This section is empty.

Jump to

Keyboard shortcuts

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