serena-hooks remind --client=codex misses grep/read workflows inside exec_command
serena-hooks remind --client=codex classifies pre-tool calls by tool_name / toolName. In Codex, shell work arrives as the generic tool name exec_command, with the actual command under tool_input.cmd.
That means common Codex exploration like this is invisible to the remind counter:
{
"session_id": "demo",
"tool_name": "exec_command",
"tool_input": { "cmd": "rg \"SomeSymbol\" packages/server" }
}
Same for file-read style shell commands:
{
"session_id": "demo",
"tool_name": "exec_command",
"tool_input": { "cmd": "sed -n '1,220p' packages/server/foo.ts" }
}
Current relevant matcher behavior:
is_grep_tool(): for non-Claude clients, checks whether "grep" in tool_name
is_read_file_tool(): for non-Claude clients, checks whether "file" in tool_name and one of read/view/open/show is also in tool_name
Since the tool name is only exec_command, neither path fires.
I am not sure Serena should parse arbitrary shell commands. This may be better solved by Codex exposing richer structured tool-call metadata to hooks, for example a shell command category or parsed command segments. But as-is, the Codex remind hook can run successfully before every tool call while missing the main grep/read behavior it is meant to detect.
Environment:
- Serena:
serena-agent 1.1.2
- Client: Codex
- Hook:
serena-hooks remind --client=codex
Written with assistance from Codex.
serena-hooks remind --client=codexmisses grep/read workflows insideexec_commandserena-hooks remind --client=codexclassifies pre-tool calls bytool_name/toolName. In Codex, shell work arrives as the generic tool nameexec_command, with the actual command undertool_input.cmd.That means common Codex exploration like this is invisible to the
remindcounter:{ "session_id": "demo", "tool_name": "exec_command", "tool_input": { "cmd": "rg \"SomeSymbol\" packages/server" } }Same for file-read style shell commands:
{ "session_id": "demo", "tool_name": "exec_command", "tool_input": { "cmd": "sed -n '1,220p' packages/server/foo.ts" } }Current relevant matcher behavior:
is_grep_tool(): for non-Claude clients, checks whether"grep" in tool_nameis_read_file_tool(): for non-Claude clients, checks whether"file" in tool_nameand one ofread/view/open/showis also intool_nameSince the tool name is only
exec_command, neither path fires.I am not sure Serena should parse arbitrary shell commands. This may be better solved by Codex exposing richer structured tool-call metadata to hooks, for example a shell command category or parsed command segments. But as-is, the Codex
remindhook can run successfully before every tool call while missing the main grep/read behavior it is meant to detect.Environment:
serena-agent 1.1.2serena-hooks remind --client=codexWritten with assistance from Codex.