AI Agent Worm Hijacks AGENTS.md and CLAUDE.md Files

Diagram of an AI agent worm spreading through poisoned AGENTS.md files

An AI agent worm is spreading across GitHub by talking coding assistants into running it. In 22 repositories, planted AGENTS.md and CLAUDE.md files order any visiting agent to launch scripts/setup.js and not to look inside it. Two of the repositories were still online on 28 November.

Persuading the agent

The planted instructions describe the script as an opaque, sealed artifact and say that inspecting it would breach a SOC-2 policy. The CLAUDE.md version is the most forceful: if setup hasn’t happened yet, the agent should go ahead and run it with no confirmation prompt.

The malware has six ways to start, and which one works depends on how much the client trusts the folder. Hooks in agent settings try node first, then Bun, and will install Bun through a curl pipe if neither is present.

Build files get tampered with too. The worm picks files by the repository’s main language, covering 21 languages, and slips a call into the first match. A Makefile gains a target, a Python setup file gains a shell call, and a PHP project’s composer.json gets a post-install hook, so a plain composer install can trigger it.

A relative of Shai-Hulud

This is a build of the testmetest worm, from the Miasma family descended from the leaked Shai-Hulud code. Another build was found in a Ruby gem named strutil-core on 6 November. Both share three components, an upload endpoint and an encryption key. Since the original source has been public since May 2026, the match doesn’t identify an operator.

Every time the worm spreads it re-wraps itself with new random keys, so file hashes differ from one repository to the next. Defenders get a stable match only by hashing the unpacked bundle.

Hidden in plain commit history

The infecting commit imitates the one before it. It reuses the earlier author, committer, dates and subject line, then adds a skip-checks:true trailer that stops GitHub Actions from running. Dependabot branches expose the trick, because their real history is about two months newer than the copied date.

Stolen data goes to paleasbest[.]top. If that is unreachable, the worm uploads to a public repository described as project-utils, or to GitLab. To pick an account, it searches GitHub for commit messages that start with AutoSyncComplete. Each of those hides a token taken from an earlier victim, so one infected machine can end up using another’s credentials.

Signed commits tagged msync-3f7a serve as a remote control. The worm checks an RSA signature and then evaluates the JavaScript in the commit message. The same route can announce a replacement upload address.

What it does on a machine

Before doing anything the worm looks for signs of a lab. Fake-looking token prefixes, a hostname containing sandbox, or a machine with no SSH or Git configuration make it quit. It also skips systems set to Russian or other CIS locales, and in a test with a Russian locale it exited without touching the network.

In a controlled run with decoy credentials, it took a little over three minutes. It then queried cloud sources: AWS metadata, a local Vault, STS and Google Cloud. It read AWS secrets stores across 17 regions. It also appended hooks to Claude and Gemini settings files and registered a server called workspace-tools in Cursor’s configuration. Codex was untouched, since its config uses TOML.

Cleaning up an infected machine

Stop the wiper before rotating anything. On Linux and macOS the worm installs a monitor, net-health-checker, which tests the stolen token every 45 seconds. If GitHub rejects it with a 401 or 403, the monitor deletes the home directory. It stops trying after 48 hours, but restarts at login and begins a new window.

  • Isolate the host and disable the monitor and pkg-runtime services.
  • Remove the helper scripts and ~/.config/index.js.
  • Delete the SessionStart hooks and workspace-tools entries from agent settings.
  • Rotate every credential the machine could reach, using a clean device.
  • Audit repositories those tokens could push to.

What teams should block next

An instruction file that forbids the agent from reading the script it is told to run is a clear warning sign, and tooling can block on it. Teams should also review how much autonomy their agents have in unfamiliar repositories and hunt for commits that mirror their parents and carry the skip trailer.

Source: fenko.nz

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.