[BUG] ConfigChange hook emitting blocking decision is not respected by claude code CLI

Status Fixed / completed
Reported on v2.1.117
Maintainer reply None cached
Activity 2 comments · opened Jul 20, 2026 · closed Aug 17, 2026

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)
  • [ ] I am using the latest version of Claude Code

What's Wrong?

I've created a ConfigChange hook that checks if the settings.json files are valid JSON (common pitfall: editing the settings mid-session) and the hook is supposed to block if it isn't.

Through the hook script's logging utility I can see that it does fire and does report broken JSON. Testing the hook from the command line shows the same behavior.

Both emitting a JSON decision to STDOUT, and exiting with code 2 fails to interrupt the session in the face of a broken settings.json

The hook is part of a suite of hooks that are also used on PreToolUse and elsewhere, using the same library code, and all of those work correctly. This seems to be a clear problem in how the CLI handles the return from the ConfigChange hook.

What Should Happen?

The session should immediately interrupt upon a ConfigChange hook outputting a blocking JSON decision or exiting with code 2.

Error Messages/Logs

Steps to Reproduce

  1. Add a ConfigChange hook to the project settings .claude/settings.json with the command "exit 2" to output a blocking exit code
  2. Run a claude code session (use a dummy first prompt like 'Hi claude')
  3. Edit the .claude/settings.json in some way

and

  1. Add a ConfigChange hook to the project settings .claude/settings.json with the command "echo '{\"decision\":\"block\",\"reason\":\"none\"}'" to output a blocking decision to STDOUT
  2. Run a claude code session (use a dummy first prompt like 'Hi claude')
  3. Edit the .claude/settings.json in some way

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.117

Claude Code Version

2.1.196

Platform

Other

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

This is a pretty critical security flaw.

View original on GitHub ↗

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