Expand description
Gate-evaluation logging.
When the CTX_GATE_LOG environment variable is set, ctx score appends
one JSON line per gate evaluation to a local log file (default
.ctx/gate-log.jsonl). Opt-in, local-only; ctx ships no telemetry.
CTX_GATE_LOG values:
- unset, empty, or
0– logging disabled 1ortrue– log toDEFAULT_GATE_LOG_PATHunder the repo root- anything else – treated as the log path (joined to the repo root when relative)
Structs§
- Gate
Record - One gate evaluation, serialized as a single JSONL line.
Constants§
- DEFAULT_
GATE_ LOG_ PATH - Default log location (relative to the repo root) for
CTX_GATE_LOG=1. - GATE_
LOG_ SCHEMA_ VERSION - Version of the
GateRecordline format.
Functions§
- append
- Append one record to the log at
pathas a single JSONL line. - blocking_
enabled - Whether blocking mode is requested (
CTX_GATE_BLOCKING=1, exactly). - gate_
log_ target - The gate log path selected by
CTX_GATE_LOG, orNonewhen logging is disabled. - now_
rfc3339 - Current UTC time as an RFC3339 string.
- session_
id - The Claude Code session id (
CLAUDE_SESSION_ID), if present.