Before submitting
Area
apps/server
Problem or use case
I want to have information about current thread in environment variables: both for terminal and running agent sessions.
Proposed solution
Provide environment variables along project and thread scoped child processes (terminal and harness):
T3CODE_PROJECT_ROOT (currently available only in terminal - make available everywhere)
T3CODE_WORKTREE_PATH (currently available only in terminal, if worktree is used - make available everywhere)
T3CODE_PROJECT_ID (add new)
T3CODE_THREAD_ID (add new)
T3CODE_HOME - always provide resolved path - canonical value
Cool ideas for future, but out of scope:
T3CODE_ORIGIN - accessible server host
T3CODE_TOKEN - short living scoped token that allows controlling only threads in current project or something like this
Why this matters
Cool automation opportunities - like using custom CLI (see references) that allows agent to create threads in t3code, control them.
Smallest useful scope
Adding those two:
T3CODE_PROJECT_ID
T3CODE_THREAD_ID
Alternatives considered
Using cwd as context, but can't detect thread reliable this way.
Risks or tradeoffs
Claude relying on T3* env variables presence to detect it's running under t3code?
Examples or references
Currently t3code provides two environment variables in terminal: T3CODE_PROJECT_ROOT, T3CODE_WORKTREE_PATH.
#2921
https://github.com/kcosr/t3code-threads
https://github.com/tarik02/t3code-cli
Contribution
Before submitting
Area
apps/server
Problem or use case
I want to have information about current thread in environment variables: both for terminal and running agent sessions.
Proposed solution
Provide environment variables along project and thread scoped child processes (terminal and harness):
T3CODE_PROJECT_ROOT(currently available only in terminal - make available everywhere)T3CODE_WORKTREE_PATH(currently available only in terminal, if worktree is used - make available everywhere)T3CODE_PROJECT_ID(add new)T3CODE_THREAD_ID(add new)T3CODE_HOME- always provide resolved path - canonical valueCool ideas for future, but out of scope:
T3CODE_ORIGIN- accessible server hostT3CODE_TOKEN- short living scoped token that allows controlling only threads in current project or something like thisWhy this matters
Cool automation opportunities - like using custom CLI (see references) that allows agent to create threads in t3code, control them.
Smallest useful scope
Adding those two:
T3CODE_PROJECT_IDT3CODE_THREAD_IDAlternatives considered
Using cwd as context, but can't detect thread reliable this way.
Risks or tradeoffs
Claude relying on
T3*env variables presence to detect it's running under t3code?Examples or references
Currently t3code provides two environment variables in terminal:
T3CODE_PROJECT_ROOT,T3CODE_WORKTREE_PATH.#2921
https://github.com/kcosr/t3code-threads
https://github.com/tarik02/t3code-cli
Contribution