[BUG] `--dangerously-skip-permissions` skips trust dialog without persisting `hasTrustDialogAccepted=true`, silently disabling project-level `statusLine` / hooks'

Resolved 💬 3 comments Opened May 11, 2026 by luphaz Closed May 15, 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)
  • [X] I am using the latest version of Claude Code

What's Wrong?

--dangerously-skip-permissions bypasses the workspace trust dialog but does not set hasTrustDialogAccepted: true in ~/.claude.json for the current project. The trust state stays undefined, and any component gated on it — most visibly the project-level statusLine declared in .claude/settings.json — silently fails to load. There is no UI signal that this is happening; the custom status badge / hooks just don't appear, and Claude falls back to whatever is defined in the user-level ~/.claude/settings.json.

This is particularly painful in combination with --worktree, which auto-creates a fresh directory on every launch, so the trust state is always undefined for a brand-new path. Without the dialog firing, the user has no way to bring it back without either (a) launching once without --dangerously-skip-permissions, or (b) manually editing ~/.claude.json.

What Should Happen?

--dangerously-skip-permissions semantically means "I take full responsibility, skip every safety prompt." It should imply trust for the active workspace and write hasTrustDialogAccepted: true accordingly, so components gated on trust (statusLine, hooks) behave consistently with the non-YOLO path.

Alternative fix: --worktree should inherit the parent repo's hasTrustDialogAccepted value when it auto-creates the new directory entry in ~/.claude.json.

Steps to Reproduce

  1. Pick a repo (e.g. ~/my-repo) and add a project-level statusLine in ~/my-repo/.claude/settings.json:

``json
{
"statusLine": {
"type": "command",
"command": "bash -c 'printf \"\\033[1;32m[MY-BADGE]\\033[0m\"'"
}
}
``

  1. Launch Claude in YOLO mode with a fresh worktree:

``bash
cd ~/my-repo && claude --worktree --dangerously-skip-permissions
``

  1. Observe: the [MY-BADGE] status line is not rendered. Claude falls back to the user-level statusLine (or none).
  2. Inspect ~/.claude.json — the auto-created worktree path under projects.<worktree-path> has no hasTrustDialogAccepted key (or it is false).
  3. Manually edit ~/.claude.json and set hasTrustDialogAccepted: true for that exact worktree path, then /exit and relaunch with the same flags. The [MY-BADGE] badge now appears.

Is this a regression?

I don't know

Claude Code Version

2.1.138 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

  • The same silent-disable behaviour also affects project-level hooks declared under .claude/settings.json for the same reason.
  • Related: #23109 — broader feature request for trusted-workspace patterns / parent-cascade for worktrees. This issue is a narrower bug specifically about the --dangerously-skip-permissions semantic gap, not about the prompt friction.
  • Related: #52501 (closed) — similar shape: bypassPermissions confirmation dialog has no pre-accept flag.
  • Workaround in the meantime (from a comment on #23109): trust $HOME (or any common parent dir) so worktrees inherit by parent-cascade — but this only works if parent-cascade is actually applied, and is a broad-strokes trust grant.
  • Terminal in my repro is Ghostty inside tmux; selected "Other" in the dropdown.

View original on GitHub ↗

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