cc-plugin-sec-default: every plugin $.fs.write logs [ERROR] hooks chain failed for missing protected-path stats
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- security
Research direction
Start in the cc-plugin-sec-default security plugin, where its $.fs.stat checks for protected paths feed the hooks chain; follow the path that turns a missing .claude or settings file into an error-level log. Reproduce with a small mod calling $.fs.write and the --debug-file command, then change missing protected-path stats to debug level or no output. Done when the same repro yields no hooks chain failed lines for absent protected paths.
Written by the indexing model from the issue text.
Description
Version: Claude Code 2.1.329 (macOS)
What happens
With debug logging on (--debug or --debug-file), every $.fs.write made by a user mod makes the bundled cc-plugin-sec-default stat several protected paths:
<cwd>/.claude<cwd>/.claude/settings.json<cwd>/.claude/settings.local.json~/.claude/cowork_settings.json- the write target itself, when it does not exist yet
Each stat that hits a missing path is logged at error level, for example:
[DEBUG] $.fs.stat (cc-plugin-sec-default): <path> failed: ENOENT: no such file or directory
[ERROR] hooks chain failed: errorKind=HooksError
The write itself succeeds and nothing else fails. A mod that writes about 15 files during one run produces about 90 of these ERROR lines from a folder with no .claude setup, and about 40 from a project folder that has only .claude/settings.local.json.
Expected
A missing protected path is the normal case (it simply means the target is not a protected file), so it should not be logged at error level; debug level at most, or no line.
Repro
- A minimal mod whose
tool.callhook calls$.fs.writeon a new file a few times. - From a folder without
.claude/settings.json, runclaude -p "Run the Bash command echo hi" --plugin-dir <mod folder> --debug-file <log>. grep -c 'hooks chain failed' <log>shows about five per write.
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 25k
- Avg merge
- 16h 19m
- Merged PRs (30d)
- 5
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anthropics/claude-code
-
area:docs bug documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anthropics/claude-code#111658 ·
-
area:core bug platform:linux platform:wsl regression
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anthropics/claude-code#111548 ·
-
area:vscode bug has repro platform:vscode platform:windows
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
anthropics/claude-code#111416 ·
-
area:plugins area:tui bug platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
anthropics/claude-code#111195 ·
-
area:docs area:security documentation enhancement platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anthropics/claude-code#111180 ·
All issues in anthropics/claude-code
Similar issues
-
chore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
drydocs/meridian#1503 · 1 comment ·
Maintainers usually reply within 2 days
-
refactor review: high
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
1lck/Lithe-IDEA#2376 ·
Maintainers usually reply within 1 day
-
bug extension mcp
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
primer/primitives#1426 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
danielmiessler/LifeOS#2941 ·
Maintainers usually reply within 4 days