env-patch

env-patch is a skill for Claude Code from zhizhuodemao/ai-reverse-toolkit. It costs 141 tokens per session (2,280 once invoked), scanned A, original, MIT.

A process for running browser-dependent encrypted JavaScript in Node.js, a JavaScript runtime outside a web browser, by supplying the browser objects and functions the code expects.

In plain words
What is it for?
Use it after finding an encryption entry point to extract or run a browser-based module independently in Node.js, including some Webpack modules and virtual-machine code.
Why use it?
Code copied from a browser may fail in Node.js because objects such as document, navigator, or location do not exist there. This process helps identify those missing pieces and add them in a separate runner file.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Good fit Use it after finding an encryption entry point to extract or run a browser-based module independently in Node.js, including some Webpack modules and virtual-machine code.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhizhuodemao/ai-reverse-toolkit/env-patch
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zhizhuodemao/ai-reverse-toolkit --skill env-patch
Clone the repo
git clone --depth 1 https://github.com/zhizhuodemao/ai-reverse-toolkit

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for env-patch

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/env-patch/github.svg)](https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/env-patch)
Your own site
<a href="https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/env-patch"><img src="https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/env-patch/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for env-patch

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/env-patch"><img src="https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/env-patch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,280 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00141 $0.02280
Opus 5.5 $0.00056 $0.00912
Sonnet 5.5 $0.00028 $0.00456
Haiku 4.5 $0.00014 $0.00228

Measured 1mo ago against content hash d98bf5f1f0f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

env-patch scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/env_core.js, scripts/webpack_runtime.js), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| 运行时动态加载 | curl 下载到 `source/`,复制到 `env/` | `references/dynamic-loading.md` |
skills/env-patch/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

env-patch

对 $ARGUMENTS 执行补环境方案。

前置条件:已知加密入口(模块 ID、函数名、所在脚本)。如未定位,先用 /find-crypto-entry。

核心概念

  • env_core.js 是引擎:提供工具函数(setFuncNative / setObjNative / getNativeProto / wrapFunc / monitor / createProxy)和诊断报告。引擎不含任何环境存根,复制后不再修改。
  • run.js 是策略:所有环境存根、补丁、加载逻辑都写在 run.js 中。每轮诊断后只改 run.js。
  • browser-stubs.md 是参考目录:按诊断报告中出现的 UNDEFINED/ERRORS 按需取用存根代码。

铁律

  1. 禁止修改原始 JS — source/ 下文件只读。env/ 下的 JS 副本(main.js / sdk.js / bytecode.js)一旦生成即为定稿,不再修改。所有补丁写在 run.js / sign.js 中。
  2. 必须 require env_core.js — 禁止在 run.js 中重写 setFuncNative / setObjNative / createProxy 等工具函数。所有工具通过 const env = require('./env_core') 引入,然后调用 env.setFuncNative() / env.createProxy() 等。env_core.js 复制后不再修改。如果需要额外 helper,写在 run.js 顶部,但不得重复实现 env_core 已有的功能。
  3. 先分析 VMP 入口参数 — VMP 入口的依赖数组决定补环境边界。typeof chrome !== "undefined" ? chrome : undefined 检查的是 globalThis,不是 window。必须用 Object.defineProperty(global, name, ...) 同步。
  4. 加载顺序是致命的 — VMP 在 require() 的瞬间初始化并读取环境,之后不可更改。run.js 中的代码必须严格按以下顺序:
    1. const env = require('./env_core') — 获取工具(第一行)
    2. 构建存根对象(document / navigator / location 等)
    3. env.init({ window, document, navigator, location }) — 阻断 Node 泄露 + 挂载全局
    4. 额外环境补齐 — performance、chrome 等全局同步
    5. require('./main.js') — 加载目标 JS
    6. 测试签名
  5. 格式验证优先于请求验证 — 签名长度/前缀与浏览器不一致 = 降级,即使 HTTP 200 也是假阳性。

模板

文件 用途
${CLAUDE_SKILL_DIR}/scripts/env_core.js 工具集 + Proxy 引擎 + 诊断报告
${CLAUDE_SKILL_DIR}/scripts/webpack_runtime.js 最小 webpack runtime

复制到项目 env/ 后,env_core.js 不再修改。

执行流程

Step 1: 搭建项目结构

<project>/
├── source/     # 原始 JS(下载,不修改)
├── env/        # 运行环境
│   ├── env_core.js      # 从模板复制,不改
│   ├── main.js          # 目标 JS 副本(或 sdk.js + bytecode.js)
│   ├── run.js           # 加载器 + 环境存根 + 测试
│   └── sign.js          # 签名接口(最后封装)
├── python/     # 验证脚本
└── docs/progress.md

判断场景(按需读取 reference):

场景 JS 文件 参考文档
单文件 SDK 复制到 env/main.js —
SDK + 字节码分离 env/sdk.js + env/bytecode.js references/multi-file.md
webpack bundle 提取模块到 env/main.js references/webpack.md
运行时动态加载 curl 下载到 source/,复制到 env/ references/dynamic-loading.md

Read the full file on GitHub · 185 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 185 lines · 141 tokens per session scan A d98bf5f1f0f5

Subscribe to this mod's changes

env-patch is a skill published in the GitHub repository zhizhuodemao/ai-reverse-toolkit (471 stars, last pushed 7mo ago), licensed MIT. It adds 141 tokens to every session and 2,280 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

x402

Set up Browser Use Cloud payments with x402 — pay per request from a crypto wallet (USDC on Base mainnet), no signup or API key. Two setups it works out up front — "just use it" (set up a wallet so you or Claude Code can run cloud browser tasks paid from the wallet — Claude writes and runs throwaway scripts, nothing…

browser-use/browser-use · 175 tokens

derive-client

Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for ", "reverse engineer this site's API", "record…

vercel-labs/agent-browser · 100 tokens

har-derived-api-client

Record a site's XHR into a HAR, derive an HTTP client.

NousResearch/hermes-agent · 19 tokens

cloud

Documentation reference for using Browser Use Cloud — the hosted API and SDK for browser automation. Use this skill whenever the user needs help with the Cloud REST API (v2, v3, or v4), browser-use-sdk (Python or TypeScript), X-Browser-Use-API-Key authentication, cloud sessions, browser profiles, profile sync, CDP…

browser-use/browser-use · 177 tokens

sync-new-data-type

Adds scaffolding for a new Sync data type in Chromium across protocol buffers, DataType definitions, feature flags, controller builders, unit tests, and metrics.

chromium/chromium · 36 tokens

browserwing-executor

Control browser automation through HTTP API. Supports page navigation, element interaction (click, type, select), data extraction, accessibility snapshot analysis, screenshot, JavaScript execution, and batch operations.

MemTensor/MemOS · 42 tokens