SigmaAlert-ready after reviewMCP servers and agent configuration
Claude Code / VS Code project persistence files from the Mini Shai-Hulud worm
The worm behind the compromised TanStack npm packages (May 2026) copied itself into .claude/router_runtime.js with an ESM loader (.claude/setup.mjs) and a Claude Code hooks entry in .claude/settings.json, plus .vscode/setup.mjs and a tasks.json that runs on folder open, so the implant re-runs whenever Claude Code or VS Code is used in the project even after `npm uninstall`. It also committed these files to repositories under a spoofed claude@users.noreply.github.com author.
- Log source
- File events (EDR file_event on Linux, macOS or Windows)
- Techniques
- AML.T0142 Event Triggered Execution · AML.T0081 Modify AI Agent Configuration · ASI04 Agentic Supply Chain Vulnerabilities · LLM03 Supply Chain
- MITRE ATT&CK
- T1546Event Triggered ExecutionT1195.002Compromise Software Supply ChainT1059.007JavaScript
- Reviewed
- 2026-11-10
Query
title: Mini Shai-Hulud Claude Code And VS Code Project Persistence Files
id: 6d1de01f-3cdc-49fd-9d71-899775210dd7
status: experimental
description: Detects creation of the self-copy and loader files the Mini Shai-Hulud worm writes into .claude and .vscode project folders to persist through Claude Code hooks and VS Code tasks.
references:
- https://socket.dev/blog/tanstack-npm-packages-compromised-mini-shai-hulud-supply-chain-attack
- https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2026/Malware/TanStack-Supply-Chain/file_event_lnx_malware_tanstack_supply_chain.yml
- https://code.claude.com/docs/en/hooks
author: ThreatDeck
date: 2026-11-09
modified: 2026-11-10
tags:
- attack.persistence
- attack.t1546
- attack.initial-access
- attack.t1195.002
- attack.execution
- attack.t1059.007
logsource:
category: file_event
detection:
selection:
TargetFilename|endswith:
- '/.claude/router_runtime.js'
- '/.claude/setup.mjs'
- '/.vscode/setup.mjs'
- '\.claude\router_runtime.js'
- '\.claude\setup.mjs'
- '\.vscode\setup.mjs'
condition: selection
falsepositives:
- Projects that legitimately ship a .vscode/setup.mjs helper (rare)
level: high Expected false positives
- Projects that legitimately keep a setup.mjs in .vscode (rare; check for a matching tasks.json runOn folderOpen)
Sources
- Socket: TanStack npm packages compromised (Mini Shai-Hulud, May 2026)
- SigmaHQ: TanStack supply-chain attack file creation indicators (Linux)
- Claude Code docs: Hooks
File indicators overlap SigmaHQ rule 2b5e4d3f-7c9a-4fab-a8d1-3e6f5a7b8c9d by Leonardo Gasparini (Detection Rule License 1.1); rule logic written independently
Reviewed against vendor documentation, not tested in your environment. Defensive use only.