Skip to content

claude-code

The .claude directory creates an attack surface in Claude Code

Claude News

When Claude Code runs in a newly cloned repository, it asks for trust but fails to warn about the presence of a .claude directory included in the project. The default response to this prompt is trust, making it easy to bypass security checks with a quick Enter key press.

Granting trust enables all hooks in the repository without individual permission requests. For example, a SessionStart hook can execute a curl command to download and run an external script. This trust is persistent: a malicious hook added in a future commit will execute without a new prompt.

Local skill files within the repository can also execute arbitrary code. To mitigate this, the author recommends declining the trust prompt, setting disableAllHooks to true in ~/.claude/settings.json, or running the tool within a sandbox environment like nono.

Related stories

  1. Claude Code's deny rules don't stop grep
  2. Vanta releases GrantGuard for auditing Claude Code permissions
  3. Vulnerabilities in Claude Code plugin marketplace
  4. Agentjacking vulnerability exposes Claude Code and Cursor to hijacking via fake error reports
  5. tcrf.net is serving Claude agents a prompt injection that wipes files
  6. Claude Code 2.1.282 ignores telemetry set by project files

Comments

No comments yet. Be the first.

Join the conversation

Sign in with Google to leave a comment. Your name and avatar come from your Google profile, and the comment appears after moderation.

We only use your name and avatar from Google. We never store your email address.