Part of the AI Coding Harness Guide — environment design for coding agents in production.

"Your own Claude Code hooks aren't running in this session": Why Claude Code Hooks Are Not Running#

Published by

"Your own Claude Code hooks aren't running in this session" means the program that started Claude Code left the hooks in your ~/.claude/settings.json out of the session, and told Claude Code so with CLAUDE_CODE_PERSONAL_HOOKS_OFF. Your settings file is not broken. To get your hooks back, start a new session, or run claude yourself without CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG and CLAUDE_CODE_PERSONAL_HOOKS_OFF set (v2.1.317 or later).

The full notice text#

The notice has three forms. The value of CLAUDE_CODE_PERSONAL_HOOKS_OFF picks one. In v2.1.317 the text is:

ValueNotice you see
any value not listed below, for example 1, true, yes or host"Your own Claude Code hooks aren't running in this session: the program that started Claude Code kept them out. If a new session doesn't bring them back, ask whoever runs these sessions."
retry"Your own Claude Code hooks aren't running in this session: setting them up did not finish. Start a new session to try again."
launch"Your own Claude Code hooks aren't running in this session: it was started in a mode that leaves out your own settings and hooks. Start a new session without that mode to use them." In bare or safe mode the last sentence names the fix instead, for example "To use them, restart without --bare." or "To use them, unset CLAUDE_CODE_SAFE_MODE."
fixNo text of its own. Claude Code shows its own hooks notice for the session if it has one, and the program that started the session is expected to show what to change.
empty, none, 0, false, no, offNo notice.

The values are not case-sensitive and surrounding spaces are ignored. CLAUDE_CODE_PERSONAL_HOOKS_OFF=1 gives the first form, because 1 is not one of the named values.

The notice appears once per session, when you send the first prompt, as a message from Claude Code. For the host, retry and fix forms, Claude Code also adds a note for the model: it says the note comes from Claude Code and not from you, and asks Claude to tell you in one short sentence in its next reply. That is why Claude may mention your hooks when you did not ask about them.

Why Claude Code hooks are not running#

"Your own" hooks are the hooks in your user settings file, ~/.claude/settings.json. Project hooks (.claude/settings.json), plugin hooks and your organization's managed hooks are separate.

An IDE extension, a desktop app, an SDK host or an automation that starts Claude Code can set CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG. With it on, Claude Code checks your user settings before each prompt: a file with errors, hooks of a type other than command or http, or hooks that other settings turn off each get a notice or block the session. CLAUDE_CODE_PERSONAL_HOOKS_OFF adds one more reason: the launching program itself kept your hooks out, or setting them up failed.

CLAUDE_CODE_PERSONAL_HOOKS_OFF only explains. It does not turn hooks off on its own. Claude Code shows the notice because the launcher says the hooks are out. If you set the variable yourself, you get the notice and your hooks still run.

How to get your hooks back#

  1. Start a new session. With retry, that is the fix the notice gives.
  2. Start Claude Code yourself from a terminal, without the two variables:
env -u CLAUDE_CODE_PERSONAL_HOOKS_OFF -u CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG claude
  1. If the notice says the session was started in a mode, leave that mode: restart without --bare or --safe-mode, or unset CLAUDE_CODE_SIMPLE or CLAUDE_CODE_SAFE_MODE.
  2. If the notice comes back in every session the same program starts, ask whoever runs that program. The value comes from its launch settings, not from your files.

You cannot set or clear the variable from settings.json. Claude Code drops these entries from the env block of every settings file:

{
  "env": {
    "CLAUDE_CODE_PERSONAL_HOOKS_OFF": "off",
    "CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG": "0"
  }
}

Only the environment that Claude Code starts with counts.

To turn your hooks off on purpose#

CLAUDE_CODE_PERSONAL_HOOKS_OFF is the wrong switch for that. Use disableAllHooks in a settings file:

{
  "disableAllHooks": true
}

When the notice shows#

Every condition in this table must hold.

ConditionDefaultWhat changes it
CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG onOff1, true, yes or on in the launch environment
CLAUDE_CODE_PERSONAL_HOOKS_OFF set to a value that is not empty, none, 0, false, no or offUnsetThe launch environment only; settings.json entries are dropped
Nothing in your user settings blocks the sessionn/aA user settings file with errors, or hooks of a type that is not command or http, block every prompt and tool call instead, and that message replaces this notice
First prompt of the sessionn/aThe notice is shown once per session

Claude Code reads CLAUDE_CODE_PERSONAL_HOOKS_OFF once at start, then removes it from its own environment, so your hooks, tools and the commands they run do not see it. A background session started by the Claude Code background service drops it too, unless the request that starts the session sets it.

With CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG on, v2.1.317 can show these messages about your hooks as well:

  • "The hooks in ~/.claude/settings.json aren't running in this session because ..." followed by the reason: your organization's managed settings set "disableAllHooks", allow only managed hooks, or allow hooks only from plugins; the session runs in bare mode, safe mode or restricted mode; the session's settings sources leave out user settings; managed settings have not been read yet; or this file or the --settings file sets "disableAllHooks".
  • "Some hooks in ~/.claude/settings.json have errors and won't run in this session. Your other hooks and settings still apply."
  • "Claude Code is blocking every prompt and tool call in this session because ..." ending with "(This check is on because the session was started with CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG set.)"

CLAUDE_CODE_PERSONAL_CONFIG_FIX (v2.1.304) lets the launching program replace the generic fix line in these messages, "Fix the file, then start a new session.", with its own text of up to 300 characters.

Timeline#

VersionPublishedChange
v2.1.2952026-10-08CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG arrives, with the "Claude Code is blocking every prompt and tool call" and "Some hooks in ... have errors" messages.
v2.1.2962026-10-09"The hooks in ... aren't running in this session because ..." notice added.
v2.1.3042026-10-19CLAUDE_CODE_PERSONAL_CONFIG_FIX arrives.
v2.1.3172026-11-02CLAUDE_CODE_PERSONAL_HOOKS_OFF and the "Your own Claude Code hooks aren't running in this session" notices arrive together, with the note that asks Claude to tell you.

The release notes do not mention CLAUDE_CODE_PERSONAL_HOOKS_OFF, CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG or any of these notices as of v2.1.317.[1]

Should you set CLAUDE_CODE_PERSONAL_HOOKS_OFF?#

Not as a user. It turns nothing off and only adds a notice. If you build a tool that starts Claude Code and leaves the user's own settings out, set it together with CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG=1, so users see why their hooks did not run: host when your tool kept them out, retry when setting them up failed, launch when the session runs in a mode that skips user settings, and fix when your tool shows its own message about what to change.


FAQ#

Q: Why are my Claude Code hooks not running?

A: If Claude Code says "Your own Claude Code hooks aren't running in this session", the program that started it left your ~/.claude/settings.json hooks out. Start a new session, or run claude from a terminal without CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG and CLAUDE_CODE_PERSONAL_HOOKS_OFF set.

Q: What does CLAUDE_CODE_PERSONAL_HOOKS_OFF do?

A: It tells Claude Code why your own hooks are not in the session, so it can show a notice. retry, fix and launch pick a reason, any other value means the launching program kept them out, and empty, none, 0, false, no or off show nothing. It works only with CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG on.

Q: Does CLAUDE_CODE_PERSONAL_HOOKS_OFF=1 turn my hooks off?

A: No. It shows the notice, and hooks from your user settings still run if the launching program loaded them. Use "disableAllHooks": true to turn hooks off.

Q: Can I clear it in settings.json?

A: No. Claude Code drops CLAUDE_CODE_PERSONAL_HOOKS_OFF and CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG from the env block of settings files. Only the launch environment counts.

Q: Why did Claude tell me my hooks aren't running when I didn't ask?

A: With the host, retry or fix value, Claude Code adds a note that asks Claude to tell you in one short sentence in its next reply.

Q: Which version added it?

A: v2.1.317, published November 2, 2026. The notice and the variable arrived in the same release. The release notes do not mention it.

Q: Are project and plugin hooks affected?

A: The notice is about your own hooks, from ~/.claude/settings.json. Project hooks, plugin hooks and managed hooks are not part of it.


Sources: [1] Claude Code changelog

Related: CLAUDE_CODE_PERSONAL_HOOKS_OFF in the env-var glossary | CLAUDE_CODE_RESTRICT_PERSONAL_CONFIG in the env-var glossary | Claude Code v2.1.295 analysis | Claude Code v2.1.317 analysis | Debugging Claude Code Issues