JSON passed to `notify` app should include `cwd` or full `environment_context`
Resolved 💬 2 comments Opened Sep 21, 2025 by twardoch Closed Dec 18, 2025
What feature would you like to see?
https://github.com/openai/codex/blob/main/docs/config.md says:
## notify
Specify a program that will be executed to get notified about events generated by Codex. Note that the program will receive the notification argument as a string of JSON, e.g.:
{
"type": "agent-turn-complete",
"turn-id": "12345",
"input-messages": ["Rename `foo` to `bar` and update the callsites."],
"last-assistant-message": "Rename complete and verified `cargo build` succeeds."
}
Wish:
The JSON should also include the cwd entry with the current working directory of the session. This is extremely important. Without it, it’s really hard to perform any meaningful post-processing of a session that issued the notification, especially if multiple codex sessions are running in different folders.
Claude Code has the equivalent functionality in its hooks (it sets an environment variable).
$HOME/.codex/sessions/2025/09/21/rollout-2025-09-21T15-56-36-01996c8f-f08c-7f22-8b0c-73d372453090.jsonl
has this type of record:
{"timestamp":"2025-09-21T13:56:40.873Z","type":"response_item","payload":{"type":"message","role":"user","content":[{"type":"input_text","text":"<environment_context>\n <cwd>/Users/user/Developer/test</cwd>\n <approval_policy>never</approval_policy>\n <sandbox_mode>danger-full-access</sandbox_mode>\n <network_access>enabled</network_access>\n <shell>bash</shell>\n</environment_context>"}]}}
So it would be useful if the JSON passed via notification would include the full environment_context, that is:
{
"approval_policy": "never",
"cwd": "/Users/user/Developer/test",
"input-messages": ["Rename `foo` to `bar` and update the callsites."],
"last-assistant-message": "Rename complete and verified `cargo build` succeeds."
"network_access": "enabled",
"sandbox_mode": "danger-full-access",
"shell": "bash",
"turn-id": "12345",
"type": "agent-turn-complete",
}This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗