Skip to main content

Module telemetry_features

Module telemetry_features 

Source
Expand description

The closed registry of feature codes for telemetry (3.11.1+).

A code names what LeanCTX did, never with what: cli.pack.export, index.graph. CLI arguments are matched against the fixed lists below and only the matching literal is counted, so a path, file name, query or any other user input can never become a code. Commands on the hot path of every shell command or editor event are not counted at all; the daily usage record already covers that work.

Enums§

Feature
Background features with a fixed code.

Constants§

APP_CODE_DETECTED
A lean-ctx doctor run that found LeanCTX Code’s presence marker (docs/contracts/app-presence-v1.md). Only that the marker was there is counted, never its content.
APP_CODE_HINT_SHOWN
The one hint about LeanCTX Code was shown after lean-ctx doctor.

Functions§

cli_code
The feature code for a CLI invocation, or None when it is not counted. A --dry-run promises to write nothing, the usage counter included.
record
Counts one run of a background feature and whether it succeeded.
record_app_detected
Counts a run that found LeanCTX Code managing this machine.
record_app_hint_shown
Counts one shown LeanCTX Code hint.
record_cli
Counts a CLI invocation. Never fails the command.
record_hook_call
Counts one tool call a host hook handled in the host session session_id (the hook payload’s session_id). Called by the governor’s PostToolUse hook; never fails the hook, and writes nothing while telemetry is off.
record_mcp_session_end
Counts how an MCP session ended. Every exit path (transport closed, parent gone, idle exit) calls this before its final send; only the first call of a process counts.
record_mcp_session_start
Counts an MCP server start after the handshake.