22 malicious repositories use AGENTS.md, CLAUDE.md and hooks to make the agent run code
TL;DR When opened with a coding assistant, instruction files and hooks lead the agent to run a setup.js that steals secrets and infects other repositories.
In plain words: coding assistants read special files in a project (like
AGENTS.mdorCLAUDE.md) to learn how to work there, and some can run startup scripts automatically. Attackers plant instructions in those files so that simply opening the project with an AI assistant makes it run their program.
What happened
Bitdefender identified 22 malicious GitHub links that abuse agent instruction files (AGENTS.md, CLAUDE.md), session-start hooks, MCP configurations and editor tasks. When a developer opens the repository with a coding assistant, the agent runs a hidden setup.js that steals development and CI secrets and spreads to other repositories.
Who is affected
Developers who clone and open third-party repositories with a coding agent, especially with auto-approve or trust prompts turned off.
Why it matters
It is the same family as the case in Google’s GTIG report, where a group altered .claude/settings.json in internal repositories to pull a backdoor on every session. Agent configuration is now an attack surface.
What to do
- Treat agent configuration as code: read
AGENTS.md,CLAUDE.md,.claude/settings.json, hooks,.mcp.jsonand editor tasks before opening a third-party repo with the agent. - Keep the assistant’s trust dialog on and the agent up to date.