Todd Mercer

Claude Code Hooks Missing in Demo Mode? Restore Workspace Trust
If Claude Code hooks, the status line, project permissions, and plugins all stop working in a new repository while IS_DEMO is enabled, check workspace trust before editing every hook. A current Claude Code bug can skip the trust prompt without granting trust. Remove IS_DEMO temporarily, start one interactive session in the repository, review and accept the trust prompt only if you trust the codebase, then verify the hooks through Claude Code's own dispatch path.
This guide is for developers who use demo mode to hide account details while streaming or recording. It applies when debug output says workspace trust not accepted. It does not cover a hook that launches and exits with an error, a bad matcher, or a malformed settings file.
Match the exact failure
The failure requires this combination:
IS_DEMOis set in the shell or theenvblock of Claude Code settings.The current repository has not been trusted yet.
The expected trust prompt never appears.
Hooks and other trust-dependent configuration are skipped.
The current Claude Code environment-variable reference describes IS_DEMO as a way to hide the email and organization name and skip onboarding. Anthropic's security documentation separately says first-time codebases and new MCP servers require trust verification. The bug is the gap between those behaviors: demo mode can suppress the prompt while the workspace remains untrusted.
Use the symptom table to keep nearby failures separate:
What you observe | Likely boundary | Next check |
|---|---|---|
Debug log says | Trust prompt was skipped or declined | Follow this guide |
| Settings source, schema, or matcher | Use Claude Code's configuration diagnostics |
Hook launches and exits 127 | Command path or runtime dependency | Use the hook exit 127 guide |
Project MCP server says | MCP server approval | Review the server from |
Do not assume that a healthy-looking /doctor result proves hooks ran in this repository. The current issue report reproduced skipped hooks while the diagnostic summarized executions from other projects.
Capture a non-destructive baseline
From the affected repository, record the version and whether demo mode is present without printing secrets:
Then start a separate diagnostic session with a log file you control:
Send one harmless prompt, exit the session, and inspect only the relevant lines:
Expected result on the affected path: the log ties skipped hook events, the status line, or plugin installation to unaccepted workspace trust. Redact repository paths, prompt text, tokens, and customer data before sharing the log.
If those lines are absent, stop. Run /hooks and follow Anthropic's configuration debugging guide instead of changing trust state without evidence.
Restore the missing trust decision
First locate the source that sets IS_DEMO. It may be exported by your shell or defined in a user, project, or managed settings file. Do not dump the entire environment or settings file into an issue.
For a user settings entry, make a private backup and remove only the IS_DEMO key from the env object. Do not replace it with the strings 0 or false as a workaround. The reproduced bug treats a non-empty value as enabled.
For a shell export, unset it in the terminal that will launch the recovery session:
Now launch Claude Code interactively from the exact repository:
Read the trust prompt. Accept it only when you recognize and trust the repository, its project settings, hooks, MCP configuration, and added directories. If the repository is unfamiliar or its configuration has changed unexpectedly, choose No, exit and review the files outside Claude Code first.
Do not edit ~/.claude.json to manufacture a trust record. The supported recovery is to restore the prompt and make the decision interactively. Anthropic's worktree documentation uses the same boundary: accept workspace trust in the original directory before starting a worktree session.
Prove the hooks actually dispatch
After accepting trust, start another diagnostic session:
Use /hooks to confirm the expected event and matcher are registered. Trigger one safe fixture that should be allowed and one harmless fixture that your guardrail should block. Inspect the log for matching hook evaluation and its exit status.
The verification is complete only when:
the new log has no
workspace trust not acceptedskip for the tested event;/hooksshows the definition from the expected settings source;the allowed fixture completes;
the blocked fixture is denied for the reason your hook returns; and
unrelated tools are unaffected.
Testing the hook script directly is not enough. A script can pass its own unit tests while Claude Code never dispatches it.
Decide how to use demo mode afterward
Once the repository has a valid trust decision, you may restore IS_DEMO for a recording session and repeat the two fixtures. Current reports indicate that an already trusted repository keeps working, but a newly initialized repository can enter the silent skip path again.
Until Anthropic ships and documents a fix:
prefer a session-scoped
IS_DEMO=1 claudelaunch after trust is established;avoid a permanent global
IS_DEMOsetting if you frequently create repositories;repeat the trust and hook canary for every new Git root;
keep destructive-action protection in CI, branch rules, or managed policy as well as local hooks; and
never treat demo mode as a security control.
The current issue 92911 reproduced the behavior on Claude Code 2.1.260 through 2.1.263 and cites earlier reports. The older issue 37780 contains the same debug signature and recovery on 2.1.81. Issue 37780 was closed as stale, not as a verified product fix. No fixed release was established when this article was prepared.
Keep external-action checks independent
A local Claude Code hook and an integration execution boundary solve different problems. The hook can stop or annotate a tool call inside the client. Aident Loadout can expose the current Action schema, connected-account boundary, and cost estimate before a provider call. Neither replaces workspace trust, and neither proves the other one ran.
After restoring hooks, use a read-only issue lookup to verify the two boundaries separately:
Expected result: the Action is discovered instead of guessed, its required inputs are visible, the connected GitHub account is explicit, and preflight validates the exact input before execution. The preflight checked for this guide reported an exact zero-credit estimate. Stop before execute if you only need to review the boundary.
Continue with Agent Skills vs MCP vs CLI when you need to decide which agent extension surface should own an integration job. If your trust log is clean but the hook command cannot launch, switch to Claude Code Hook Exit 127 rather than repeating the trust flow.
Inspect a managed Action safely with Aident Loadout.
Verification checklist
Before relying on the guardrail again, confirm:
Did the debug log identify unaccepted workspace trust as the skip reason?
Did you remove or unset
IS_DEMOinstead of assigning another non-empty value?Did you review and accept trust interactively in the exact repository?
Does
/hooksshow the expected source, event, and matcher?Did an allowed fixture pass and a blocked fixture stop through Claude Code?
Did you keep secrets and sensitive repository data out of logs?
Do CI or managed controls still protect actions that must never depend on one local hook?
Will you repeat the canary for the next new Git root?
Sources and refresh trigger
Claude Code environment variables, Anthropic, reviewed September 9, 2026.
Claude Code security and trust verification, Anthropic, reviewed September 9, 2026.
Debug Claude Code configuration, Anthropic, reviewed September 9, 2026.
Claude Code worktrees and workspace trust, Anthropic, reviewed September 9, 2026.
Issue 92911:
IS_DEMOsuppresses workspace trust, opened September 8, 2026 and reviewed September 9, 2026.Issue 37780: demo mode breaks status line and hooks, opened March 23, 2026 and reviewed September 9, 2026.
Refresh this guide when Anthropic closes issue 92911 with a verified release, changes the IS_DEMO contract, adds workspace trust to /doctor, or changes which settings and extension surfaces require trust.
About the author

Todd Mercer
Todd Mercer is an editorial pen name used by Aident's developer-tools team. This column covers agent CLI configuration, MCP connectivity, authentication, permissions, and troubleshooting. Guides focus on observable symptoms, documented fixes, reproducible checks where available, and the limits of each workaround.



The one tool
for every tool
your agent needs.
Give any AI agent real capabilities in seconds. Connect 27,000+ tools once, skip the setup headache, and let your agents execute.


