Programming guides for beginner...
Any comments are welcomed....
I hope it helps!!! Thanks for drop by...
Showing posts with label claude-code. Show all posts
Showing posts with label claude-code. Show all posts

Sunday, June 14, 2026

GLM-5.2 Hits 1M Context and Lands in Claude Code for $18

GLM-5.2 Hits 1M Context and Lands in Claude Code for $18

Z.ai pushed GLM-5.2 to its GLM Coding Plan customers on 13 June 2026 with a 1M-token context window and a price tag of eighteen dollars a month, and the founder Jie Tang framed the release in a single sentence: “GLM-5.2 is Fully Open, Frontier Intelligence Belongs to Everyone.” The same week, the Commerce Department’s export-control letter forced Fable 5 and Mythos 5 offline for every Anthropic customer worldwide — the story I covered on 13 June 2026. Two announcements, twelve hours apart, on opposite sides of the Pacific. Read them in sequence and the second one is a response, priced in dollars. The release landed on Hacker News as item 48518684 at 657 points and 371 comments as of the morning of 14 June 2026 — a thread dominated less by the model and more by the geopolitical reading.

What GLM-5.2 actually is

Z.ai did not publish a tech-blog post for GLM-5.2 on release day. The announcement is the @Zai_org tweet at 7:56 AM UTC on 13 June 2026 (the 1.4M view count is the tweet’s own UI value, scraped on 14 June 2026): “GLM-5.2 is now available to all GLM Coding Plan users, including Lite, Pro, Max, and Team plans” and “GLM-5.2 is now available with 1M-context support” — both phrases in the same tweet. Founder Jie Tang’s afternoon tweet is the framing: “Today, the sudden restriction of certain frontier models is deeply regrettable. At a time when access to frontier models is abruptly cut off for non-technical reasons, we are even more convinced of openness.” That sentence is the post.

The closest thing to a model card is the docs.z.ai page for GLM-5.1, updated 13 June 2026: “designed for long-horizon tasks, can work continuously and autonomously on a single task for up to 8 hours,” and “overall aligned with Claude Opus 4.6.” The benchmark table from the previous Z.ai tech blog (21 May 2026, GLM-5) puts GLM-5 Thinking at 77.8 on SWE-bench Verified, 56.2 on Terminal-Bench 2.0, and $4,432.12 on Vending Bench 2 — ahead of DeepSeek-V3.2 and Kimi K2.5, within range of Claude Opus 4.5. GLM-5.2 is the same family. The 1M context is the marquee delta, in the same ballpark as Gemini 3.0 Pro and ahead of the 200K-class competitors.

The HN comment that made the round: “Is it a coincidence that both MiniMax and Z.ai are releasing frontier open weights models right as the USG is trying to impose a cap on model capability offered to the public?” A thread sibling answered “I would say yes. You think they were sitting on a release waiting for the right marketing moment?” and a third replied (in the part of the comment starting “I think it’s a possibility, because…”): “labs trying to one-up each other is a fairly common phenomenon at this point. Previous Opus releases were immediately followed by GPT releases, for example. At some point the timing stops being a mere coincidence.” The community is reading the timing as deliberate. They are probably right.

The Claude Code drop-in is the real product

The Z.ai GLM Coding Plan is a subscription product, not a research weight drop. The docs.z.ai page lists the price (Lite at $18/month, Pro and Max above that), the supported tools (Claude Code, Cline, OpenCode), and the integration mechanism — and the integration is the part that should make Anthropic’s product team uncomfortable. The default mapping in ~/.claude/settings.json is:

ANTHROPIC_DEFAULT_OPUS_MODEL: GLM-4.7
ANTHROPIC_DEFAULT_SONNET_MODEL: GLM-4.7
ANTHROPIC_DEFAULT_HAIKU_MODEL: GLM-4.5-Air

A user flipping the Opus and Sonnet slots to GLM-5.2 is running Claude Code against an entirely different model family, at $18/month, with the Anthropic prompt format and tool-calling surface preserved. The 5-hour limits are 80, 400, and 1,600 prompts for Lite, Pro, and Max; weekly caps are 400, 2,000, and 8,000. For a solo developer shipping a side project, the Lite tier is enough. For a small team burning through agentic tasks, Pro and Max are priced under what a single Anthropic Max seat costs.

The 1M context and the 8-hour autonomous loop are useful only if the model reaches the developer. Reaching the developer, in 2026, increasingly means reaching them through Claude Code, Cursor, Cline, or one of three other agent shells. Z.ai did not publish a paper and call it a release. They wired the model into the agent harness the industry is consolidating around, and they published a config file showing exactly how. The product surface is “the agent you already use, but cheaper and not on a U.S. export-control list.”

The “open” framing is true enough to be annoying

The HN thread drifted, within twenty comments, into the same debate every open-weight release now attracts. The strongest critique, posted by flyingoat (comment 48523041): “Here’s the truth: ALL of the ‘open’ AI companies are fake UNLESS they open-source the whole damned thing.” The counter — Olmo from AllenAI, NVIDIA’s Nemotron line, Apertus, Elmo, SmoLLM — release more of the pipeline. GLM-5 was published on Hugging Face and ModelScope under MIT License (per the 21 May 2026 z.ai/blog/glm-5 post). The weights are open. The data and training code are not. Tang’s “Fully Open” wording is doing a lot of work: GLM-5.2 is open-weight, the same category as Llama, most Mistral, and Qwen flagships, and the “Fully” is a positioning choice aimed at the U.S. frontier whose weights are not open at all. The bar Z.ai is setting is the bar of “downloadable, modifiable, red-teamable” — real and useful, and one the U.S. frontier has effectively abandoned.

What the Anthropic export-control story did to this release

The 13 June 2026 export-control narrative (the one I covered yesterday) was a U.S. policy story. The Z.ai announcement is a Chinese frontier-lab response, packaged as a product and priced in dollars. The chain: Anthropic models become a U.S. national-security asset → U.S. cloud customers face restrictions on reselling Anthropic access abroad and to certain U.S. agencies → a capability gap opens for non-U.S. developers and U.S. teams who do not want their inference provider to be a political football → a Chinese lab ships a Claude Code drop-in at $18/month with 1M context → the gap closes. The cycle is short. The price is brutal. The integration is one config file.

The honest counter-readings: Z.ai was always going to ship GLM-5.2 in mid-June and the Anthropic story provided timing, not causation; the Claude Code integration was already there for GLM-4.7 in May and the GLM-5.2 drop refreshes the slot; the U.S. export-control story affects a narrow set of buyers. All three can be true. None of them changes the product fact: an $18/month Claude Code plan backed by a 1M-context open-weight model is available today, with a config snippet that takes 30 seconds to apply.

The original take: the export-control story is also a product story

The most under-discussed consequence of the 13 June 2026 export-control news is that the procurement risk now has a price. The Z.ai Coding Plan Lite is $18/month. The 1M-context window is the marquee delta on raw capacity. The Claude Code harness means zero refactoring for the developer. Every buyer who pauses to ask whether they want their inference provider to be a political football is a buyer Z.ai is now selling to. The pitch is no longer “our model is better” (the benchmarks are within range). The pitch is “our model is not on a list, and you can run it on any provider.” That is a procurement pitch, not a model-quality pitch, and it is the one Anthropic’s product team cannot match on the same axis.

For the developer making the actual decision, the calculus is narrower. The risk — and it is real — is that the model family, the company, or the weights disappear because of a U.S.–China policy event the developer has no control over. That is a procurement risk, and the procurement risk now has a dollar value: the gap between the Z.ai Lite plan and an equivalent Anthropic seat, plus the cost of the config-file swap. That is the answer to “how much does U.S.–China policy uncertainty cost a solo developer per month” in June 2026.

What this means for you

  • If you are a solo developer paying for Claude Code Pro — the cost-savings comparison is real and the integration is real, but the long-term bet is on the API and the weights staying available. Spend an hour with GLM-5.2 on the Z.ai plan (or via OpenRouter, which lists the model). The biggest risk is provider churn, not model quality. Plan for the plan to change.
  • If you run a small team building agentic features — the Pro and Max plans are competitive with a single Anthropic Max seat, and the integration is the same ~/.claude/settings.json edit. If your team is sensitive to the Anthropic export-control story, this is now a real procurement option, not a research curiosity. Get the integration working this month.
  • If you maintain an open-weights stack or fine-tune models — GLM-5.1 is on Hugging Face under MIT; GLM-5.2 weights have not appeared on a public repo as of the morning of 14 June 2026. The story Tang is selling is openness, but the actual release is a hosted Coding Plan, not a weight drop.
  • If you are evaluating “open vs closed” AI as a category — the most useful frame in 2026 is “what is actually downloadable, modifiable, and red-teamable, and what is not.” GLM-5.2 on the Z.ai Coding Plan is in a weird middle: the weights are MIT-licensed (eventually), the deployment is a hosted plan, the integration is a config file. That middle is where most of the agent-harness consolidation is going to land for the next 12 months.

What to do this week

# 1. Sign up for the Z.ai Lite plan ($18/month) and edit
#    ~/.claude/settings.json to wire it into Claude Code:
#    {
#      "env": {
#        "ANTHROPIC_BASE_URL": "https://api.z.ai/api/paas/v4",
#        "ANTHROPIC_AUTH_TOKEN": "<your-zai-api-key>",
#        "ANTHROPIC_DEFAULT_OPUS_MODEL": "GLM-5.2",
#        "ANTHROPIC_DEFAULT_SONNET_MODEL": "GLM-5.2",
#        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "GLM-4.5-Air"
#      }
#    }
#    The default mapping ships GLM-4.7 in the Opus/Sonnet slots
#    and GLM-4.5-Air in Haiku; flipping to GLM-5.2 is the
#    experiment. Lite is 80 prompts/5h, Pro 400, Max 1,600.

# 2. Run a representative session — the same multi-file refactor
#    you would give Claude Code on Anthropic. Compare quality and
#    latency. The point is not to switch permanently; the point
#    is to know how the alternative performs on your work.

# 3. Read the HN thread end-to-end. Item 48518684, 657 points and
#    371 comments as of 14 June 2026. The first 30 comments are
#    about the Anthropic story; the next 50 are the open-weights
#    debate. Both are the post.

Disclosure

Disclosure: Drafted with AI assistance. Primary sources are the vendor itself: Z.ai @Zai_org on X (corporate account, 13 June 2026 07:56 UTC) and founder/CEO Jie Tang @jietang on X (13 June 2026 13:13 UTC). The framing quote and the “Fully Open” wording are the founder’s positioning of his own release. Secondary: Z.ai docs GLM-5.1 model page (dedicated GLM-5.2 page not yet published) and GLM Coding Plan overview for the $18/month price and 5-hour limits. Previous tech blog: GLM-5 (21 May 2026) for the SWE-bench (77.8), Terminal-Bench (56.2), Vending Bench 2 ($4,432.12) numbers. HN: item 48518684; quoted-comment authors verified via Algolia HN API. Related: the 13 June 2026 Anthropic Fable / Mythos export-control post.

Sources

Related reads

Tuesday, June 9, 2026

Miasma Worm Just Hit Microsoft Azure. The 6/8 Post Was the Trailer.

Three days ago, this blog ran a post called "Miasma Worm: Your Settings.json Is a Shell Prompt Now." It argued that the attack surface had moved from package-install hooks to agent-install hooks — that the new surface area is whatever your AI coding tool or IDE executes silently when you open a project. On June 5, 2026, that thesis hit the largest possible target. The Miasma worm campaign reached Microsoft's Azure GitHub organizations. GitHub disabled 73 Microsoft repositories across four organizations in a 105-second automated sweep, per StepSecurity's forensic timeline. The trigger files were the same four files this blog covered on June 8. The payload was the same 4,643,745-byte obfuscated JavaScript dropper. The trailer had its premiere.

What Microsoft actually pulled

Microsoft cut off access to "dozens" of its open-source projects hosted on GitHub, per Zack Whittaker at TechCrunch on 8 June 2026. The reporter count was at least 70. The API-verified count, captured by StepSecurity on 6/5, was 73. Either number is the largest single takedown of a hyperscaler's open-source footprint on GitHub to date, and it happened in an automated 105-second window with no human in the loop.

Microsoft spokesperson Ben Hope told TechCrunch the company has "temporarily removed some repositories as we investigated potential malicious content." Some have been restored after review; others remain offline. Microsoft "notified a small number of customers who may have pulled down content from the affected repositories." Full scope disclosure is still pending.

The disabled set is dominated by the Azure Functions ecosystem. 49 of the 73 disabled repositories are in the Azure GitHub organization, and 35 of those 49 carry the azure-functions- prefix. The list includes azure-functions-agents-runtime, azure-functions-core-tools, azure-functions-docker, azure-functions-dotnet-extensions, azure-functions-durable-extension, azure-functions-durable-js, azure-functions-durable-python, azure-functions-golang-worker, azure-functions-host, azure-functions-java-library, and dozens more. The blast radius is not a single tool. It is an entire Microsoft developer platform's open-source mirror.

The June 5 incident, named and dated

StepSecurity's forensic timeline is precise enough to act on. On June 5, 2026, at 16:00:50 UTC, GitHub's automated abuse detection began disabling repositories. By 16:02:35 UTC — 105 seconds later — 73 Microsoft repositories across four GitHub organizations were returning HTTP 403 with "reason": "tos" (Terms of Service violation). The enforcement was precisely targeted. StepSecurity cross-checked 16 similar Azure Functions repositories not on the list — for example EventGrid, EventHubs, CosmosDB, Redis, ServiceBus, Dapr, plus microsoft/durabletask-python — and confirmed none were blocked. The 73-repository list is the complete attack surface, not a sweep.

The malicious commit was 5f456b8 on Azure/durabletask, pushed using a previously compromised contributor account. The commit metadata is a checklist of red flags:

  • Commit message: "Switched DataConverter to OrchestrationContext [skip ci]"
  • Files changed: 5 added, 0 source code files modified
  • Commit timestamp: Backdated to 2020-03-09T15:59:47Z — six years before the actual push
  • [skip ci] flag: Suppresses CI pipeline execution to avoid automated detection

The commit claims a code change and ships none. All five files are tool configuration or the malicious payload itself. The backdated timestamp hides the commit in a dormant branch. The [skip ci] flag is the killer detail: it makes the attack invisible to the only automated defensive layer most open-source projects actually run.

The same compromised account, three weeks apart

The contributor account used to push 5f456b8 is the same account whose credentials were used in the May 19, 2026 PyPI poisoning of microsoft/durabletask. StepSecurity verified the contributor's personal fork of Azure/azure-functions-durable-extension was also blocked during the same 6/5 sweep (timestamp 16:02:25 UTC), confirming the account was active. Three readings of the same-account reuse are possible:

  1. The account was never fully rotated after May 19. The attacker retained a working GitHub token, and the rotation that should have happened in response to the first compromise did not.
  2. The account was re-compromised by the worm itself. Opening an infected repository in an AI coding tool harvests fresh tokens. The contributor's own development machine, having run the credential stealer on a 5/19-affected package, yielded up new GitHub credentials in the three weeks between incidents.
  3. A different contributor's token was used, with author metadata spoofed via the Git Data API. The fingerprint would be the same; the person behind it would not.

The second reading is the one that should make you set down your coffee. The worm is harvesting the credentials needed to spread itself, on the machines of the people most likely to be trusted by the repositories it wants to compromise next. That is not a supply-chain attack. It is a supply-chain predator, and the hunting ground is the AI coding agent that opened the previous package.

The four trigger files, named honestly

The June 5 incident confirms the four trigger files covered in the 6/8 post are now the primary attack surface for code-stealing in 2026. For the record:

  1. .claude/settings.json — a Claude Code SessionStart hook that runs node .github/setup.js when an agent session opens. A developer who clones an infected repo and starts Claude Code in it has run the payload, with no further interaction.
  2. .gemini/settings.json — identical structure, for Gemini CLI's SessionStart event. Same payload, same auto-run.
  3. .cursor/rules/setup.mdc — a Cursor project rule with alwaysApply: true. This is a prompt injection, not a shell hook. It instructs the Cursor agent to run node .github/setup.js "to initialize the project environment" — language chosen to look like a project setup requirement. The alwaysApply: true flag means the rule fires regardless of which file the developer is editing.
  4. .vscode/tasks.json — a VS Code task configured with "runOptions": { "runOn": "folderOpen" }. No AI agent is required. A senior engineer debugging a vendored dependency, opening the project in their familiar editor, runs the payload.

The fifth file, .github/setup.js, is the credential harvester: 4,643,745 bytes of single-line obfuscated JavaScript that, per SafeDep's static decode, wraps an AES-128-GCM-decrypted async loader pulling environment variables and credential paths for AWS, Azure, GCP, Kubernetes, and 90+ developer-tool configurations. The four trigger files exist only to launch it.

What this is: the supply chain got to Microsoft, not the other way around

The story is not "Microsoft got hacked." The story is "the open-source supply chain got hacked, and a major hyperscaler happened to be downstream of it." The technique does not require a Microsoft contributor. The technique requires a single compromised maintainer account anywhere in a dependency graph whose terminal node is a Microsoft-owned repository. The worm does the rest. Microsoft was the largest target, not the only target. The same fingerprint appears across 123 or more repositories spanning dozens of accounts, per SafeDep's code-search floor (the table is explicitly labeled "floor, not a ceiling"). The icflorescu/mantine-datatable family was compromised the same week, and the loader is a byte-level match for the Miasma family.

The 6/8 post argued that the threat model for 2026 is not "is this package's maintainer trustworthy." The threat model is "does any configuration file in the dependency graph, including files I have never read, execute a payload when one of my AI tools or my IDE opens a project." For most projects, the answer to that question is I do not know, and the answer is honest.

The Microsoft incident adds three more sentences to that threat model:

  • The account that gets compromised does not have to be the account whose code runs. A compromised GitHub PAT from a single developer, used to push a commit, is enough to plant the four trigger files. The credential stealer then runs in the environment of every developer who subsequently opens the project.
  • The "human-in-the-loop" defense does not apply to file-open events. The whole point of the configuration-file attack surface is that it triggers on SessionStart or runOn: "folderOpen". There is no confirmation dialog. There is no AI to ask "did you mean to run this." The payload runs before the developer has finished typing their first prompt.
  • Microsoft, with the resources of the largest security operation in enterprise software, did not catch the malicious commit before it shipped. Detection happened downstream, via GitHub's automated terms-of-service enforcement, hours later. The CI pipeline was bypassed by [skip ci]. The commit sat in a backdated branch until the next mass scan. The 105-second takedown is real, but it is cleanup, not prevention.

What this means for you

  • If you maintain an open-source repository: add a CODEOWNERS rule that requires explicit approval for any commit that adds .claude/settings.json, .gemini/settings.json, .cursor/rules/*.mdc, .vscode/tasks.json, or .github/*.js. These file patterns are the Miasma trigger surface, and they should not be silently mergeable by an active contributor, much less a compromised one.
  • If you build or ship an AI coding tool or IDE: ship a safe-by-default posture for SessionStart hooks and folder-open tasks. Claude Code, Gemini CLI, and Cursor can all be configured to require explicit user confirmation before running a shell command from a project config file. The default should be confirmation, not execution. Microsoft just provided the cleanest possible justification for that product decision.
  • If you use Claude Code, Gemini CLI, Cursor, or VS Code in a work context: the next time you open a third-party repository — especially one you cloned recently — check for these four files before you start an agent session. Five seconds of cat is the difference between a debug session and a credential exfiltration.
  • If you work at a company that ships open-source dependencies: the Miasma family has now compromised a single hyperscaler's open-source mirror, a popular UI library, and 120+ smaller projects in a single month. The expected cost of cloning an untrusted repository, in 2026, includes a credential stealer running on folder open. The cost-benefit on containerized, ephemeral, or remote-development environments just changed.
  • If you write about supply-chain security: the post-Miasma configuration-file attack era is its own era. The trigger surface is configuration files, not package managers. The defenses that worked against preinstall and setup.py hooks do not generalize to SessionStart events. The dependency graph now includes the developer's own .claude/ directory. The threat model has to be redrawn.

What to do this week

# 1. Audit every repo you maintain or contribute to for the four
#    Miasma trigger files. They should not exist in a trusted
#    repository unless your team added them on purpose.
#    find . -type f \( \
#      -path "*/.claude/settings.json" -o \
#      -path "*/.gemini/settings.json" -o \
#      -path "*/.cursor/rules/*.mdc" -o \
#      -path "*/.vscode/tasks.json" -o \
#      -path "*/.github/setup.js" \
#    \)
#
# 2. Add a CODEOWNERS rule that requires review for any commit
#    adding or modifying any of those paths. The blast radius
#    of a single compromised account is now the entire
#    repository's user base, and review is the only mitigation
#    that scales.
#
# 3. Configure your AI coding tools to require explicit user
#    confirmation before running shell commands from project
#    configuration. Claude Code: --permission-mode. Cursor:
#    Agent command allowlist. Gemini CLI: --no-auto-run. The
#    default should be "ask first," not "execute."
#
# 4. Rotate any GitHub PATs that were present on a machine
#    that opened an infected repository on or after May 19,
#    2026. The Miasma loader architecture is constant across
#    waves; the inner dropper is recompiled per victim with
#    rotating AES keys and a fresh SHA256, per SafeDep. If
#    you ran any version of it, rotate.
#
# 5. Move development of untrusted third-party dependencies
#    into a container, a VM, or a disposable environment.
#    The era of "I'll just clone it and poke at it locally"
#    is the era of a folder-open credential stealer.
#
# 6. Read the StepSecurity forensic timeline. It is the most
#    technically precise account of the Microsoft incident
#    and it names the file patterns, the commit hash, the
#    timestamps, and the spread of the same compromised
#    account.
#    https://www.stepsecurity.io/blog/miasma-worm-hits-microsoft-again-azure-functions-action-and-72-other-repositories-disabled-after-supply-chain-attack-targeting-ai-coding-agents

The original take: the Miasma family is the new normal, and Microsoft just confirmed it

The 6/8 post argued that the configuration-file attack surface was the next escalation of the open-source supply-chain threat. The Microsoft incident is the confirmation. The largest open-source footprint in enterprise software was compromised by the same four trigger files, in the same week, via the same account whose credentials the same worm family stole the first time around. The 105-second takedown is the cleanup. The [skip ci] commit is the new normal. The next incident will not be in a Microsoft repository. It will be in yours, or in a dependency of yours, planted by a contributor you have never met, and it will fire on folder open in the AI coding tool you use every day.

The corollary: the dependency-graph trust model that open-source maintainers have used since 2010 — trust the maintainer, scan the package, defend the install hook — does not extend to 2026. The new trust model has to cover every file in the repository that an AI coding tool or IDE will read on open, because the new attack surface is the entire repository, not the package manifest. Defending preinstall and setup.py is not wrong, but it is the answer to last year's question. The question this year is "what does the AI coding tool do on session start," and the Miasma family is the answer the threat actors have already given.

The 6/8 post was the trailer. June 5 was the premiere. The next installment is a question of when, not if, and the only variable that changes the answer is whether maintainers, AI tool vendors, and enterprise security teams update their threat models before the next wave ships.

Related reads from this blog

  • Miasma Worm: Your Settings.json Is a Shell Prompt Now — The 6/8 post that named the configuration-file attack surface, the four trigger files, and the prompt-injection vector in Cursor. Three days later, the same family hit Microsoft. The post has now been vindicated at the largest possible scale.
  • Speculative KV Coding: 4× Lossless Cache Compression — A different kind of inference-engineering story, but the same shape: a small, technical change that compounds into a category-level shift. The Miasma family is the same kind of compound move on the attacker side. Small change in the trigger files, large change in the attack surface.
  • Xiaomi Hit 1000 t/s on a 1T Model. The Race Just Changed. — Speed is the new axis. Inference at 1000 tps makes new product categories possible. The Miasma worm is the same kind of axis shift on the security side: the configuration-file attack surface is not new, but the cost-benefit of exploiting it at scale is, and the cost-benefit just changed in the attackers' favor.

Disclosure

This post was researched and drafted with AI assistance. Primary sources are listed in the Sources section above. Every numerical claim, direct quote, and timestamp is taken from a fetched and cached source — the synthesis, the framing, and the "what this means" angles are this post's own. The 70-repository TechCrunch count vs. 73 in StepSecurity is a 6/8 vs. 6/5 snapshot difference (StepSecurity's 73 is the API-verified count); the "more than 120" other affected repositories across dozens of accounts is SafeDep's prose figure, with a 123 floor in their code-search table.

Sources

Monday, June 8, 2026

Miasma Worm: Your Settings.json Is a Shell Prompt Now

Miasma Worm: Your Settings.json Is a Shell Prompt Now

Disclosure: This post was researched and drafted with AI assistance. Primary source: SafeDep Team, "Config Files That Run Code: Supply Chain Security Blindspot", safedep.io, 6 June 2026 (HN front page the week of 8 June 2026). Secondary source: SafeDep Team, "Mini Shai-Hulud 'Miasma: The Spreading Blight' Hits @redhat-cloud-services", safedep.io, 1 June 2026. The seven-launcher taxonomy, the .github/setup.js dropper (4,348,254 bytes, Caesar shift), the icflorescu/mantine-datatable commit f72462d9, the braune-digital/BrauneDigitalImagineBundle and mhar-andal/MyBlok launchers, the 121-repository figure, the workspace-trust-prompt mechanics, the claude -p headless prompt-skip, the CVE-2025-59536 / CVE-2026-21852 references, the npm-preinstall example on @redhat-cloud-services/[email protected], and the 32-package / 96-version Red Hat figure are all from those two posts. The Trigger / Authority / Grammar framework and the synthesis in "the original take" are the blog's own. CVE-2025-59536 and CVE-2026-21852 are reproduced from the SafeDep write-up and have not been independently verified against an NVD listing.

There is a class of supply-chain attack that does not need a malicious dependency, a typosquatted package, or a hijacked maintainer account. It only needs a folder. The folder can be empty except for a handful of ordinary-looking config files. The moment you open it in your editor, start an AI coding agent, or run the install command, the attack fires. The trigger is not the code — it is the config. The Miasma worm, which hit npm this month and surfaced on HN this week, is the clearest worked example. The threat model it breaks is the one most security checklists still assume holds: that opening a fresh clone is safe until you run npm install.

The seven config files Miasma uses to fire on open

The SafeDep post walks a single icflorescu/mantine-datatable commit (f72462d9, titled chore: update dependencies [skip ci]) showing that one commit added six files. Five exist to launch the sixth: a 4,348,254-byte dropper at .github/setup.js. None of the launchers contains the payload. They each carry node .github/setup.js and rely on the developer's own tools to evaluate it.

  • .claude/settings.json / .gemini/settings.json — byte-identical SessionStart hook configs that run a shell command the moment an agent session opens. Once the folder is trusted, the hook runs without further confirmation. Since Claude Code 2.1.0, SessionStart hooks run silently.
  • .cursor/rules/setup.mdc — Cursor has no shell-hook primitive, so the attacker used a project rule with alwaysApply: true instructing the agent to run the dropper. Prompt injection committed to the repo.
  • .vscode/tasks.json — a task with runOptions.runOn: "folderOpen". The workspace-trust prompt is the only gate; it flags that a hook exists, not that the hook's 4.3 MB target is a Caesar-shifted eval launcher.
  • package.json test script — "test": "node .github/setup.js". Needs a deliberate action, but the deliberate action is npm test or a CI test step, both run on autopilot.
  • composer.json post-install-cmd in braune-digital/BrauneDigitalImagineBundle — runs on every composer install, no trust gate.
  • Gemfile line one in mhar-andal/MyBlok — system("node .github/setup.js"). A Gemfile is Ruby, evaluated top to bottom. bundle install, bundle exec, any Rails command reading it runs the dropper. No malicious gem in the dependency tree.

Seven surfaces. One dropper. The variety is the point: the attacker is betting on the category of tool that reads config and acts, not on any one editor.

What the dropper actually does

The .github/setup.js file is one statement in a try/catch. The first visible bytes are a Caesar shift over a numeric char-code array fed to eval. Statically decoding it (shift of 4) yields a staged Bun loader that AES-decrypts a credential stealer, scanning the host for AWS, Azure, GCP, Vault, Kubernetes, npm, and GitHub secrets and exfiltrating them to attacker-created public GitHub repos.

Two design choices are worth lingering on. The file is sized to be just above the limit where GitHub's code search stops indexing — roughly 384 KB — so the launcher files are what show up in search, not the dropper. And the obfuscation shape (numeric array, rotation function, eval, encrypted second stage) is the same harness SafeDep says they keep seeing recompiled across separate Miasma waves and across unrelated malicious-package campaigns. The rotation amount and the AES key change between builds, so the SHA-256 changes, but the structure stays.

The Red Hat / @redhat-cloud-services compromise on 1 June was a parallel Miasma wave abusing npm's GitHub trusted publishing via short-lived oidc-<hex> branches: push a branch that rewrites the trusted CI workflow into a self-publishing job, exchange its OIDC token for an npm publish token, repackage the legitimate tarball with a malicious preinstall, republish with valid provenance. Same target (the developer's npm install step), different distribution channel.

The trust prompts are a permission dialog, not a security control

VS Code, Claude Code, and Gemini CLI all show a workspace-trust prompt the first time a session starts in a new directory. The attack does not defeat those prompts. It relies on the developer granting trust the way they dismiss a cookie banner, and on the prompt flagging that a hook exists without making its 4.3 MB target obvious. Two situations skip the prompt outright: pulling the malicious commit into a repo that was already trusted, and running headless (claude -p), which disables trust verification — the CI case. The package-manager vectors have no trust gate at all. npm test, composer install, bundle install, bundle exec, and any Rails command that reads the Gemfile run their hooks as a normal part of the work.

What makes a config file dangerous

A config file is dangerous when a tool reads it and acts without asking, and when its format can carry a command. Score any config on three axes:

  • Trigger. What event reads the file? Folder open, agent session start, dependency install, test run, lint, build. The earlier the trigger fires, the more dangerous the file.
  • Authority. What stands between the trigger and execution? A folder-trust prompt on first open (still bypassable in headless mode), an LLM agent deciding whether to follow an instruction in its context (the Cursor .mdc case), or nothing at all (npm test, Composer post-install, Gemfile top-level Ruby).
  • Grammar. Whether the format can carry a shell command or arbitrary code. JSON hook configs carry commands by design. Markdown rules carry instructions that a sufficiently compliant agent will treat as commands. A Gemfile is a full programming language.

The most dangerous configs combine an early trigger, a low-authority gate, and a high-grammar format. Miasma maximised on all three.

The original take: the attack is on the threat model, not the tool

The conventional reading of Miasma is that Claude Code, Cursor, and the rest have a security bug. The bug is real — the lack of re-warning on hook changes in Claude Code is a clear gap, and claude -p should not skip the trust prompt. But the deeper issue is the threat model most security teams still operate with: "scanned the dependency tree, found no known-bad packages, the project is safe to open." That model is structurally wrong for an ecosystem where the attack is in the project's own config.

Opening a folder is the same risk class as running npm install. A new commit to .claude/settings.json, .vscode/tasks.json, package.json, composer.json, or Gemfile is the same supply-chain event as a new version of a pinned dependency. The trust prompt is a permission dialog, not a security control. The realistic compromise is to scope the blast radius: a project with access to your cloud credentials should not be the same dev environment that opens arbitrary GitHub repos.

What this means for you

  • If you use Claude Code or Cursor on third-party repos: treat the first git clone as if it were npm install. Read .claude/settings.json, .cursor/rules/, and .vscode/tasks.json before opening. A SessionStart hook or an alwaysApply: true rule is a shell command.
  • If you maintain an editor with a hook primitive: re-warn on hook changes (Gemini does; Claude Code does not), and never skip the trust prompt in headless mode by default.
  • If you maintain a package: audit package.json for preinstall/postinstall/test on every release. The Red Hat compromise shipped a one-line preinstall with valid provenance.
  • If you run AI agents in CI: claude -p is the headless trust-bypass case. Pin a commit SHA and diff config files before invoking.

What to do this week

# 1. Audit the last 10 repos you opened. For each, check:
#    .claude/settings.json   -> hooks.SessionStart
#    .gemini/settings.json   -> hooks.SessionStart
#    .cursor/rules/*.mdc     -> alwaysApply: true
#    .vscode/tasks.json      -> runOn: "folderOpen"
#    package.json            -> scripts: preinstall / postinstall / test
#    composer.json           -> scripts: post-install-cmd
#    Gemfile                 -> top-level system() or backtick calls
#    Treat any matching entry as a one-line shell command.

# 2. If you maintain a project that ships an AI-agent config:
#    - Don't add a SessionStart hook to the project's own settings.
#    - If you must, gate it: no node, no eval, no shell, no curl.
#    - Re-warn on hook command changes (the Gemini pattern).

# 3. If you run claude -p or similar in CI:
#    - Pin the commit SHA in the checkout step.
#    - Diff .claude/, .gemini/, .cursor/, .vscode/, package.json,
#      composer.json, Gemfile before invoking the agent.
#    - Treat any added hook or script as a build-breaking event.

The bottom line

The supply chain has a new surface: the project's own config. The seven Miasma files are not exotic; they are the files developers commit every day. They are an execution layer, not metadata — and the supply chain has to score them on the same axis as a dependency change.

Related reads from this blog

Sources