Skip to main content

Module detection

Module detection 

Source
Expand description

Agent environment detection for output mode selection.

This module provides heuristics to detect whether the current process is running under an AI coding agent (Claude Code, Codex, Cursor, etc.) or in a human-interactive terminal.

Structs§

DetectionResult
Detection result with diagnostics.

Enums§

OutputPreference
Output preference based on detection.
OverrideMode
Override modes for forcing specific detection results.

Functions§

detect_environment
Full detection with diagnostics for debugging.
detected_preference
Return user preference based on detection.
detection_diagnostics
Get detailed diagnostics as a formatted string (for debugging).
is_agent_environment
Check if running under an AI coding agent.