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

Stars 9
Forks 0

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-code issue 12100
  • anthropics/claude-code issue 13288

Fix Procedure

  1. Back up the current file
  2. Set hasTrustDialogAccepted: true for every project entry
  3. Verify the result
  4. Instruct user to restart Claude Code sessions
sh
# 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:

  1. Clear /tmp/deny-debug.log and attempt an Edit in interactive mode
  2. If the debug log remains empty, hooks are not being invoked at all
  3. Test with -p mode: claude -p 'Edit README.md add <!-- test -->'
  4. If -p fires hooks but interactive does not, re-check hasTrustDialogAccepted

Expand your agent's capabilities with these related and highly-rated skills.

i9wa4/dotfiles

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)

9 0
Explore
i9wa4/dotfiles

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.

9 0
Explore
i9wa4/dotfiles

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

9 0
Explore
i9wa4/dotfiles

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

9 0
Explore
i9wa4/dotfiles

nix

Nix commands and package management guide. Use when: - Using nurl for hash acquisition

9 0
Explore
i9wa4/dotfiles

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

9 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results