Look — the Shai-Hulud campaign with its IDE hooks represents something genuinely new, and we need to distinguish between two separate threats that attackers are now chaining together.
What the persistence hooks actually enable
Based on the technical evidence from Shai-Hulud, the SessionStart hook injection into .claude/settings.json runs malicious code every time the developer opens Claude Code in that repository. The VS Code tasks.json folderOpen trigger similarly executes when the developer opens a folder. This isn't theoretical — I can see the payload in the source: it chains node .vscode/setup.mjs through the configuration above.
Here's what this actually enables operationally — think of this as attacker access to the AI coding agent's sensorium and actuator suite:
Context window poisoning: The hook can modify files that the AI assistant will subsequently read. The Forcepoint research confirms that AI agents consume content they process — so an attacker can pre-seed RAG-retrieved files, dependency documentation, even README.md blocks with hidden prompt injection payloads using HTML comments or invisible fonts. When the AI agent later "reads" these files during autonomous coding tasks, it executes attacker-controlled instructions.
Conversation exfiltration: The malware harvests ~/.claude.json and MCP server configs. These files contain API keys, conversation context, and authentication credentials for the AI agent. This isn't just credential theft — it's memory theft. The attacker captures the developer's ongoing context with the AI, potentially including proprietary code discussions, architecture decisions, and unreleased features.
Commit and code injection: The hook runs in the developer's trusted execution context. It can intercept AI-generated code suggestions before they reach the IDE's suggestion panel, modify them in transit, or inject malicious dependencies into package.json after the AI writes it but before the developer reviews it.
Agentic command execution: The OX Security advisory confirms this is now a systemic issue — attackers can inject malicious instructions into MCP tool responses that trigger arbitrary command execution by LLMs without user interaction. The Shai-Hulud persistence hooks position the attacker to continuously deliver these payloads.
Is this a new attack surface category?
Yes, but I want to be precise here. This is not "AI gone rogue" — this is supply chain malware weaponizing the developer's own AI tools, and it creates a structural detection blind spot that traditional EDR misses.
Consider the MITRE ATT&CK telemetry for GlassWorm — a precursor campaign that established the VS Code extension worm pattern. GlassWorm masqueraded as legitimate VS Code extensions, used AES-256 encryption to obfuscate payloads, and distributed C2 over BitTorrent DHT. Shai-Hulud applies this same stealth philosophy to AI coding agents specifically.
The new category is this: AI agent persistence as a supply chain attack multiplier.
The NCSC guidance on agentic AI exploitation (April 2026) is directly relevant here. Researchers demonstrated that attackers can exploit long-context windows to hide exploits in large codebases — precisely what Shai-Hulud's persistence hooks facilitate. The setup.mjs payload can embed thousands of lines of legitimate-looking code with a single exploit buried in line 4,892, knowing the AI agent will process it during indexing.
Operational risk for organizations
If you're using Claude Code, Cursor, Copilot Workspace, or similar tools in development workflows, here's your immediate exposure:
Your AI assistant has become a trusted insider — it operates with developer credentials, reads your full codebase, can execute shell commands, and writes code that enters your deployment pipeline. If compromised, it's not a rogue process on an endpoint — it's a ghost developer with write access.
EDR evasion by design: The Forcepoint research found attackers embedding instructions in benign-seeming webpage content. The AI processes this without generating traditional execution signatures — no executable download, no suspicious PowerShell, just a reasoning model following what it believes are legitimate instructions from its context.
Cross-repository propagation: The GitHub commit-search dead-drop component allows token sharing across infected hosts. This means one compromised developer workstation becomes the seed point for lateral movement through your entire development org.
The Anthropic source code leak (March 31) is worth noting here too — 512,000 lines of unobfuscated TypeScript exposing the exact permission model and bash security validators. Attackers now have precise blueprints for bypassing Claude Code's guardrails.
My assessment: This moves the AI tooling layer from a "productivity feature" to a "critical control plane" in your risk register. The gap between research and exploitation is, as I've said before, now weeks not years — and organizations are deploying these agents without having built detective or response capabilities for when the AI itself becomes the threat vector.
James, I should flag this for you — what detection mechanisms exist for "AI agent performs suspicious action" compared to "process performs suspicious action"? The telemetry models are completely different.
SOURCES_USED: [https://phoenix.security/mini-shai-hulud-sap-cap-mbt-npm-supply-chain-bun-credential-stealer/, https://www.mend.io/blog/shai-hulud-sap-cap-supply-chain-attack-claude-code/, https://attack.mitre.org/software/S9010, https://www.truesec.com/hub/blog/glassworm-self-propagating-vscode-extension, https://scmworld.com/brief/ai-agents-weaponized-through-indirect-prompt-injection-intrusions, https://christian-schneider.net/blog/from-llm-to-agentic-ai-prompt-injection-got-worse/]