Repository navigation
Document a stable way for agents and hooks to detect a T3 Code session #32870
Slava-code
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
Many people keep global agent instructions (
~/.claude/CLAUDE.md,~/.codex/AGENTS.md) that apply to every session: terminal, IDE, and T3 Code. Some guidance only makes sense inside T3. For example:preview_*tools for localhost;delegate_task, because Claude Code's own computer use isn't available in Agent SDK sessions.There's no documented signal an agent, hook, or script can check to know it's running under T3 Code, so these instructions have to rely on something unofficial.
What works today, and why it's fragile
t3-codeMCP tools appear in the tool list. The model can see that, but scripts and hooks can't.T3CODE_THREAD_IDis set in Claude sessions, Codex shells and ACP sessions. But it exists for preview port discovery (PortScanner.AGENT_THREAD_ENV) and isn't in the user docs, so it could be renamed or scoped down at any time.Proposal
Document one stable signal, either:
T3CODE_THREAD_IDas supported in the user docs, orT3CODE=1.A one-line note on detecting a T3 Code session from instructions or hooks would be enough. I'm happy to send the docs change if the direction is OK.
All reactions