{"version":"2.1.324","anchor":"hooks-same-thread-selector-helper","canonical_anchor":"hooks-same-thread-selector-helper","heading":"CLAUDE_CODE_HOOKS_SAME_THREAD runs plugin hooks on the same thread","tier":"use","area":"Hooks","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324\/e\/hooks-same-thread-selector-helper","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.324","markdown":"### `CLAUDE_CODE_HOOKS_SAME_THREAD` runs plugin hooks on the same thread\n\nSetting `CLAUDE_CODE_HOOKS_SAME_THREAD` runs plugin function hooks on the same thread, otherwise they run in a separate worker\n\n**What**\n\nPlugin function hooks are pieces of code from plugins (add-on packages) that Claude Code runs at set moments. Claude Code now decides how to run them from a single check:\n\n- with the environment variable `CLAUDE_CODE_HOOKS_SAME_THREAD` set, they run on the same thread as Claude Code itself\n\n- otherwise, they run in a separate worker, a background helper kept apart from the main program\n\nAn environment variable is a named value you set in your shell before starting Claude Code.\n\n**Why**\n\nIt gives an opt-in way to run plugin hooks outside the worker.\n\n- Area: Hooks\n- Names: `CLAUDE_CODE_HOOKS_SAME_THREAD`\n- Tier: Use it now\n- Useful: 3\/5\n- Signal: 2\/5\n- Scope: individual\n- Heads-up: no"}