[Feature] Allow configuring /goal evaluator timeout and show timeout errors clearly

Open 💬 3 comments Opened Jun 9, 2026 by DCDYSMRZ

Summary

/goal is implemented as a session-scoped prompt-based Stop hook, but its evaluator appears to use a hard 30s timeout and there is no documented way to override it. This makes /goal unreliable for abstract or long-context goals, where deciding whether the condition is satisfied may legitimately take more than 30 seconds.

Why this matters

For concrete goals like "all tests pass", 30s may be enough. For abstract goals such as reviewing/revising a long document until multiple quality criteria are met, the evaluator needs to read conversation context and reason about completion. In practice, the Stop hook can time out around 30s and surface as:

Ran 1 stop hook
Stop hook error: JSON validation failed

Session transcript evidence shows the failing Stop hook summary at about 30 seconds:

{
  "hookCount": 1,
  "durationMs": 30003,
  "hookErrors": ["JSON validation failed"]
}

The hook command/prompt recorded in the transcript is the /goal condition itself, so this is not a user-configured command hook producing invalid JSON.

Expected behavior

Users should be able to configure the /goal evaluator timeout through structured configuration, globally or per project. For example, Claude Code settings could support a documented key such as:

{
  "goal": {
    "evaluatorTimeout": 120,
    "evaluatorModel": "..."
  }
}

or an equivalent documented setting under hooks if /goal is internally implemented as a prompt-based Stop hook.

The important part is that evaluator behavior should be configured out-of-band from the natural-language goal condition. /goal takes a natural-language completion condition, so timeout/model controls should not be mixed into that same text channel.

At minimum, if the evaluator times out, the displayed error should say that clearly instead of reporting JSON validation failed.

Actual behavior

The evaluator appears to fail around 30 seconds and the UI reports Stop hook error: JSON validation failed. This is confusing because the root cause is likely timeout/API evaluation failure, not malformed output from a local Stop hook.

Documentation context

The docs say /goal is a wrapper around a session-scoped prompt-based Stop hook. Prompt-based hooks support a timeout field with default 30 seconds, but /goal itself does not appear to expose a way to override that timeout.

Version

Claude Code 2.1.168

Related issues

This may be related to other /goal reliability reports, but the specific request here is for a documented timeout override and clearer timeout error reporting.

Suggested fix

Expose timeout/model configuration for the /goal evaluator in global/project settings, or document the intended configuration path. For abstract goals, a 30s fixed evaluator timeout is too short and makes /goal fail even though the main model turn completed normally.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗