You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Pass sessionID and callID to shell.env hook input #13661
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
The shell.env hook currently receives only { cwd: string } as input. Unlike tool.execute.before and tool.execute.after, which both receive sessionID and callID, shell.env has no way to identify which tool invocation triggered it.
Proposed change: Add optional sessionID and callID fields to the shell.env input:
The fields are optional because the PTY call site (pty/index.ts) has no session context. The two tool-related call sites (bash.ts, prompt.ts) already have both values in scope.
This is the same pattern used when sessionID was added to chat.system.transform (#7718) and args was added to tool.execute.after (56ad2db). Additive, non-breaking, backward-compatible.
Thanks @smola – I think this is more symmetric and consistent with how it's done in other events/hooks, and with this change you can easily make your own plugin to get the functionality in #9292 if it takes a while to decide on whether #9292 should land and you want to experiment a bit without having to work opencode.
Activity
smola commentedon Feb 15, 2026
Not exactly a duplicate, but see this related issue: #9292
tesdal commentedon Feb 15, 2026
Thanks @smola – I think this is more symmetric and consistent with how it's done in other events/hooks, and with this change you can easily make your own plugin to get the functionality in #9292 if it takes a while to decide on whether #9292 should land and you want to experiment a bit without having to work opencode.