Current behavior
first-tree context enable requires --provider claude-code|codex. Each provider is a native driver under apps/cli/src/core/context-integration/providers/ (Claude Code: user-scope plugin lifecycle; Codex: hooks plus the /hooks trust flow). The BYO setup prompt therefore has to carry two provider-specific commands and ask the agent to pick one.
Goals
- Auto-detect the calling coding agent. When the CLI is invoked from inside a coding-agent session, detect the agent type from environment markers (e.g. Claude Code sets
CLAUDECODE=1; identify the equivalent for Codex and others) and make --provider an optional override. The setup prompt then collapses to a single enable command.
- Support more BYO agent types. Broaden beyond Claude Code and Codex (candidates: OpenCode, Cursor, Gemini CLI, …), auto-adapting the plugin/hook install mechanics per provider via new drivers.
- Degraded mode for hook-less agents. Agents without a SessionStart-hook surface cannot get automatic activation; design an explicit manual-activation path for them.
Constraints (from system/context-management/external-byo-context.md)
- Provider-native consent/trust stays provider-owned (First Tree never grants or bypasses it).
- The payload integrity contract (release digests) must hold for every provider projection.
- Provider projections must not grow separate product or authority rules.
Related: #2077 adds an OpenCode runtime provider on the managed side; BYO drivers are a separate surface but may share detection groundwork.
Current behavior
first-tree context enablerequires--provider claude-code|codex. Each provider is a native driver underapps/cli/src/core/context-integration/providers/(Claude Code: user-scope plugin lifecycle; Codex: hooks plus the/hookstrust flow). The BYO setup prompt therefore has to carry two provider-specific commands and ask the agent to pick one.Goals
CLAUDECODE=1; identify the equivalent for Codex and others) and make--provideran optional override. The setup prompt then collapses to a single enable command.Constraints (from
system/context-management/external-byo-context.md)Related: #2077 adds an OpenCode runtime provider on the managed side; BYO drivers are a separate surface but may share detection groundwork.