Skip to content

serena-hooks remind --client=codex misses grep/read workflows inside exec_command #1394

@TyceHerrman

Description

@TyceHerrman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions