threatdeck
Live 13:45 UTC ·

Detection library

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

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.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.