ast-deobfuscate

ast-deobfuscate is a skill for Claude Code from zhizhuodemao/ai-reverse-toolkit. It costs 33 tokens per session (6,096 once invoked), scanned A, original, MIT.

A tool-assisted process for making deliberately hard-to-read JavaScript easier to understand. It uses Babel, a JavaScript parsing and code-generation toolkit, to decode strings, simplify expressions, remove unused code, and restore control flow when applicable.

In plain words
What is it for?
Use it to inspect and gradually rewrite an obfuscated JavaScript file into a more readable version, with separate scripts and outputs for each step.
Why use it?
Obfuscated code hides its purpose by changing names, strings, and execution paths. Breaking the work into saved intermediate files makes each change reviewable and reversible.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions subagents.

Good fit Use it to inspect and gradually rewrite an obfuscated JavaScript file into a more readable version, with separate scripts and outputs for each step.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate
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 ast-deobfuscate
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 ast-deobfuscate

README.md
[![agentmods](https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate/github.svg)](https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate)
Your own site
<a href="https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate"><img src="https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate/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 ast-deobfuscate

Your own site · 80×15
<a href="https://agentmods.dev/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate"><img src="https://agentmods.dev/badge/skills/zhizhuodemao/ai-reverse-toolkit/ast-deobfuscate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 6,096 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00033 $0.06096
Opus 5 $0.00016 $0.03048
Sonnet 5 $0.00007 $0.01219
Haiku 4.5 $0.00003 $0.00610

Measured 12d ago against content hash af0453bfa27b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

ast-deobfuscate scanned grade A with 0 findings 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 12d ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ast-deobfuscate/SKILL.md · 565 lines

How it starts

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

ast-deobfuscate

$ARGUMENTS 执行 AST 解混淆,最大化还原可读代码。

工具链: @babel/parser + @babel/traverse + @babel/generator + @babel/types


工作目录约定

project/
├── source/
│   └── original/          # 原始混淆文件(只读,不修改)
│       └── target.js
├── scripts/               # 解混淆脚本(每步一个,一次性,针对目标定制)
│   ├── step1_string_decrypt.js
│   ├── step2_expr_simplify.js
│   └── ...
├── intermediate/          # 中间产物(每步输出,可回退)
│   ├── target_step0.js    # 格式化 + 去反调试
│   ├── target_step1.js    # 字符串解密后
│   ├── target_step2.js    # 表达式简化后
│   └── ...
└── source/
    └── deobfuscated/      # 最终输出
        └── target_deobf.js

原则: 每个步骤读取上一步的中间文件,输出新的中间文件。出错时可从任意中间文件重新开始。

环境初始化

解混淆脚本基于 Babel 工具链运行在 Node.js 中。首次执行前检查并安装依赖:

# 在项目根目录检查 package.json,没有则初始化
npm init -y
npm install @babel/parser @babel/traverse @babel/generator @babel/types
# 如需格式化
npm install prettier

执行策略

整体原则

本 skill 是百科全书,不是固定流水线。执行者根据实际代码灵活选择步骤:

  1. 进入计划模式: 先完成 Step 0 分析,然后进入计划模式,向用户展示分析结果和建议的步骤组合,获得确认后再执行
  2. 按需跳步: 没有字符串数组就跳过 Step 1,没有控制流平坦化就跳过 Step 4
  3. 随时调整: 任何步骤执行后发现新情况,都可以回退或插入额外步骤
  4. MCP 用于分析和验证: js-reverse MCP 用于获取源码、搜索特征、小规模验证方案可行性;大批量转换和验证通过 Node.js 脚本执行

MCP 使用时机

MCP 的定位是分析工具和验证探针,不是批量执行引擎。

阶段 MCP 用法
分析阶段 search_in_sources 搜索混淆特征;get_script_source 获取目标脚本
方案验证 evaluate_script 执行几个解密调用,确认方案可行后再写批量脚本
中间验证 evaluate_script 抽样对比解混淆前后的函数输出
控制流分析 set_breakpoint + step_over 动态跟踪 switch-case 执行顺序
最终验证 在浏览器中用解混淆后的代码替换原始代码,验证功能正常

大批量字符串解密、表达式简化、死代码移除等转换工作,全部通过 Node.js 脚本 + Babel AST 完成。

Subagent 并行策略

可并行的任务组合:

  • Step 0 中:特征识别 + 反调试代码搜索
  • Step 2 中:Proxy 函数识别 + 对象字典识别(互不依赖)
  • 验证阶段:多组测试数据可并行验证

技术手册

以下是各类解混淆技术的详细参考。根据 Step 0 的分析结果,选择需要的章节执行。


Step 0: 预分析与特征识别

目标: 了解混淆类型和程度,为后续步骤提供参考(非硬性路由)。

0.1 获取源码

本地文件: 直接读取 $ARGUMENTS
URL: 下载后保存到 source/original/
浏览器中(代码尚未下载到本地):
  - 用 MCP list_scripts → get_script_source 获取
  - 可用 search_in_sources 做关键词快速扫描:
    "_0x" → 确认混淆前缀    "debugger" → 定位反调试
    "push" + "shift" → 旋转 IIFE    "split('|')" → 控制流平坦化

Read the full file on GitHub · 565 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. 12d ago First seen · 565 lines · 0 tokens per session scan A af0453bfa27b

Subscribe to this mod's changes

ast-deobfuscate is a skill published in the GitHub repository zhizhuodemao/ai-reverse-toolkit (444 stars, last pushed 6mo ago), licensed MIT. It adds 33 tokens to every session and 6,096 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. 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

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

systematic-debugging

Use when debugging a failing test, build error, or runtime issue that isn't immediately obvious. Guides a 4-phase root cause analysis instead of random fix attempts.

open-metadata/OpenMetadata · 37 tokens

diagnose

Trace from a reproduced symptom to the source code that causes it. Pin the specific file and approximate line, rate confidence in the cause and clarity of the fix independently, and always propose a concrete fix.

emdash-cms/emdash · 43 tokens

repro-admin

Reproduce an EmDash admin UI bug. Attach a container, start the demo dev server, drive the admin with agent-browser using the dev-bypass session, and capture the reproduction as screenshots plus a replayable transcript.

emdash-cms/emdash · 48 tokens

log-error-digest

Analyze log files to troubleshoot errors, identify peak error periods, and produce error clustering, frequency statistics, and time distribution reports. Supports JSON, syslog, and Nginx formats with automatic detection. Use when a user uploads a .log file and asks to analyze errors, find patterns, debug issues, or…

zebbern/claude-code-guide · 71 tokens

byted-util-volcengine-detect-retry

An orchestration workflow for Volcengine Cloud Detect, a service that checks websites or network endpoints from test locations.

bytedance/agentkit-samples · 101 tokens