[BUG] Prompt-based Stop hooks receive only metadata, not conversation content (regression confirmed in v2.0.42)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Prompt-based Stop hooks are unable to access conversation content for evaluation. The hook receives session metadata but the LLM cannot read the actual transcript, making content-aware evaluation impossible.
What Should Happen?
Related Issue: This appears to be the same regression reported in GitHub issue for v2.0.37
(teren-papercutlabs)
Configuration (in ~/.claude/settings.json):
```
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "You are analyzing a Claude Code conversation... Context: $ARGUMENTS...
[evaluation criteria]",
"timeout": 60
}
]
}
]
}
}
Expected Behavior:
Based on documentation example ("Analyze the conversation and determine if..."), $ARGUMENTS
should contain conversation content that the LLM can evaluate.
Actual Behavior:
- Hook receives only metadata: session_id, transcript_path, cwd, permission_mode,
hook_event_name, stop_hook_active
- LLM correctly identifies: "Cannot evaluate - transcript file is not accessible to this
evaluation context"
- The transcript_path is provided but the LLM cannot read files
Error Output:
Prompt hook condition was not met: Cannot evaluate criteria - transcript file is not
accessible to this evaluation context. The hook receives only session metadata... but cannot
read the actual transcript file at the provided path.
Impact:
All prompt-based Stop hooks requiring conversation analysis are non-functional. This blocks
use cases like learning pattern detection, quality control, and style enforcement.
Documentation Inconsistency:
The official example implies conversation is accessible ("Analyze the conversation"), but
implementation only provides file path without content.
### Error Messages/Logs
```shell
Prompt hook condition was not met: Cannot evaluate criteria - transcript file is not accessible to this evaluation context. The hook receives only session metadata... but cannot read the actual transcript file at the provided path.
Steps to Reproduce
- Add Stop hook to ~/.claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "prompt",
"prompt": "Analyze the conversation context: $ARGUMENTS\n\nCheck if all tasks are\n complete.\n\nRespond with JSON: {\"decision\": \"approve\" or \"block\", \"reason\": \"explanation\"}",
"timeout": 30
}
]
}
]
}
}
- Start a new Claude Code session: claude
- Send a message that triggers a response (e.g., “Hello” or a simple task).
- Observe the error output when the Stop hook fires.
- Error appears: “Prompt hook condition was not met: Cannot evaluate - transcript file is not accessible to this evaluation context…”
What the LLM receives{
"session_id": "...",
"transcript_path": "/path/to/transcript.jsonl",
"cwd": "...",
"hook_event_name": "Stop",
"stop_hook_active": true
}
The model receives only metadata, not the actual conversation content required for evaluation.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.42
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 11 comments on GitHub. Read the full discussion on GitHub ↗