| 2157 | } |
| 2158 | |
| 2159 | static int cbm_remove_session_hooks(const char *settings_path) { |
| 2160 | static const char *matchers[] = {"startup", "resume", "clear", "compact"}; |
| 2161 | int rc = 0; |
| 2162 | for (int i = 0; i < NUM_DIRS; i++) { |
| 2163 | if (remove_hooks_json((hooks_remove_args_t){.settings_path = settings_path, |
| 2164 | .hook_event = "SessionStart", |
| 2165 | .matcher_str = matchers[i]}) != 0) { |
| 2166 | rc = CLI_ERR; |
| 2167 | } |
| 2168 | } |
| 2169 | return rc; |
| 2170 | } |
| 2171 | |
| 2172 | /* SubagentStart hook: subagents spawned via the Agent tool do NOT fire |
| 2173 | * SessionStart, so the SessionStart reminder above never reaches them. This |
no test coverage detected