Agent skill
claude-workspace-trust-fix
Fix for Claude Code PreToolUse hooks being silently skipped in interactive mode. Sets hasTrustDialogAccepted: true for all project entries in ~/.claude/.claude.json. Use when: - PreToolUse hooks are not firing in interactive mode - Hooks work in `-p` mode but not interactive - User says "fix workspace trust" or "hooks not working" - Setting up Claude Code on a new machine - After adding new projects to Claude Code
Install this agent skill to your Project
npx add-skill https://github.com/i9wa4/dotfiles/tree/main/nix/home-manager/agents/skills/claude-workspace-trust-fix
SKILL.md
Claude Workspace Trust Fix
Workaround for a known bug where PreToolUse hooks in ~/.claude/settings.json
are silently skipped in interactive mode. The root cause is that
~/.claude/.claude.json defaults hasTrustDialogAccepted to false for each
project entry, and the trust dialog itself does not set the flag correctly.
-p (non-interactive) mode bypasses the workspace trust check, so hooks appear
to work there but not in interactive sessions.
Affected Versions
Confirmed on v2.1.69 (March 2026). The upstream issues were closed by stale bot without a real fix:
anthropics/claude-codeissue 12100anthropics/claude-codeissue 13288
Fix Procedure
- Back up the current file
- Set
hasTrustDialogAccepted: truefor every project entry - Verify the result
- Instruct user to restart Claude Code sessions
# 1. Backup
cp ~/.claude/.claude.json ~/.claude/.claude.json.bak
# 2. Apply fix
python3 -c "
import json, pathlib
p = pathlib.Path.home() / '.claude' / '.claude.json'
data = json.loads(p.read_text())
count = 0
for key in data.get('projects', {}):
if not data['projects'][key].get('hasTrustDialogAccepted', False):
data['projects'][key]['hasTrustDialogAccepted'] = True
count += 1
p.write_text(json.dumps(data, indent=2) + '\n')
print(f'Fixed {count} project entries')
"
# 3. Verify
python3 -c "
import json, pathlib
p = pathlib.Path.home() / '.claude' / '.claude.json'
data = json.loads(p.read_text())
projects = data.get('projects', {})
false_count = sum(1 for v in projects.values() if not v.get('hasTrustDialogAccepted', False))
true_count = sum(1 for v in projects.values() if v.get('hasTrustDialogAccepted', False))
print(f'Total: {len(projects)} | true: {true_count} | false: {false_count}')
"
Important Notes
- This file (
~/.claude/.claude.json) is local to each machine -- it is not managed by dotfiles or Nix - New projects added later will also default to
false, so rerun the fix periodically or after adding new projects - Running Claude Code sessions must be restarted to pick up the change
Diagnosis
If hooks still do not fire after applying the fix:
- Clear
/tmp/deny-debug.logand attempt an Edit in interactive mode - If the debug log remains empty, hooks are not being invoked at all
- Test with
-pmode:claude -p 'Edit README.md add <!-- test -->' - If
-pfires hooks but interactive does not, re-checkhasTrustDialogAccepted
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
subagent-review
Argument-driven code/design review wrapper. Invokes reviewer sub-skills for each specified engine+tier label. Defaults to 'cc cx' (10 reviewers) if no arguments given. Argument format: space-separated labels from {cc, cc-deep, cx, cx-deep} Examples: 'cc cx' (default), 'cc-deep cx-deep', 'cc', 'cx-deep' Use when: - Running code reviews on PRs, commits, or branches - Running design reviews on issues or documents - Need multi-perspective review (security, architecture, code, QA, historian)
brainstorming
Ambiguity-reduction workflow for requests that are not yet plan-ready or implementation-ready. Use when there are multiple plausible approaches, the task is user-facing or design-shaping, requirements are fuzzy, or Codex needs to compare 2-3 options with trade-offs before choosing a direction.
databricks-local
Databricks local additions - Queries API, VARIANT/JSON, Dashboard API, dbt integration, Jupyter kernel Supplements the official `databricks` skill with project-specific patterns. Use when: - Working with Databricks Queries API (saved queries) - Handling VARIANT type or JSON operations - Working with Lakeview Dashboard API - Integrating dbt with Databricks JSON/VARIANT columns - Running Jupyter notebooks with Databricks kernel
codex-prompting-local
Portable Codex prompt, review-contract, and resume-handoff guidance adapted from codex-plugin-cc for this repo's Nix-managed Codex CLI and Claude Code setup. Use when: - Composing prompts for Codex or GPT-5.4-based subagents - Designing structured review or adversarial-review prompt contracts - Writing resumable task prompts or result handoffs - Re-expressing useful old slash-command workflows on the skills side instead of reviving slash commands
nix
Nix commands and package management guide. Use when: - Using nurl for hash acquisition
bigquery-local
BigQuery local additions - cost-aware query patterns and project conventions. Supplements general BigQuery knowledge with guardrails. Use when: - Running bq commands - Writing GoogleSQL queries - Designing partitioned/clustered tables
Didn't find tool you were looking for?