Agent skill

Trae Native Debug

by BiFangKNT in BiFangKNT/mtga

Maintain, debug, and recover MTGA's Trae native custom-model route.

AGPL-3.0Auto-check passedDevelopment

Install Trae Native Debug

skills CLI
$ npx skills add BiFangKNT/mtga --skill trae-native-debug -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install BiFangKNT/mtga trae-native-debug --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/BiFangKNT/mtga.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.codex/skills/trae-native-debug .claude/skills/trae-native-debug && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
trae-native-debug
GitHub stars
1.2k
Token cost
~920 tokens
SKILL.md length
416 words
Files
4 (incl. references)
Skills in repo
6
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Maintain, debug, and recover MTGA's Trae native custom-model route.

  • Works in 5 steps: Classify the failure before changing code. → Confirm which path is under test. → Reproduce with the smallest useful… → …
  • Trae native integration fails
  • SKILL.md covers Operating Rules, Workflow, Known Stable Facts and Resources
  • Calls uv

What it does

Trae Native Debug is an agent skill from BiFangKNT/mtga. Maintain, debug, and recover MTGA's Trae native custom-model route. Use when Trae native integration fails, Trae updates shift aiagent.dll hook offsets, errors such as 4028/4054/429 appear, native rewriter or SseOpenPayload URL rewriting needs diagnosis, or Codex needs to avoid repeating prior renderer-JS/private-protocol dead ends.

Its SKILL.md is about 920 tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `agents/openai.yaml`, `references/native-route-map.md` and `references/update-recovery.md`).

It sits in Development, covering Debugging. It works with Python. The repository describes itself as: 基于本地代理的方式,绕过 IDE 的固定模型服务商限制. The licence is AGPL-3.0.

When your agent uses it

  • Trae native integration fails
  • Trae updates shift aiagent.dll hook offsets
  • Errors such as 4028/4054/429 appear
  • Native rewriter

Example prompts

  • “/trae-native-debug”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Classify the failure before changing code.
  2. Confirm which path is under test.
  3. Reproduce with the smallest useful surface.
  4. If Trae updated or offsets moved, read references/update-recovery.md.
  5. If unsure why a prior approach is rejected, read references/native-route-map.md before creating new probes.

What it can do on your machine

Read from SKILL.md and the folder at commit 72669fb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Trae Native Debug loads about 920 tokens when it runs, and up to ~2.4k if it reads all its reference files. Until then it costs about 88 tokens; SKILL.md has 416 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~88
When it runs · the whole SKILL.md, loaded when a task matches
~920
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from BiFangKNT/mtga at commit 72669fb, republished under its AGPL-3.0 licence (© BiFangKNT). 416 words, ~920 tokens.

Download SKILL.mdSave it as .claude/skills/trae-native-debug/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
trae-native-debug
description
Maintain, debug, and recover MTGA's Trae native custom-model route. Use when Trae native integration fails, Trae updates shift ai_agent.dll hook offsets, errors such as 4028/4054/429 appear, native rewriter or SseOpenPayload URL rewriting needs diagnosis, or Codex needs to avoid repeating prior renderer-JS/private-protocol dead ends.

Trae Native Debug

Operating Rules

  • Treat the active integration point as native Rust-side URL rewriting in ai_agent.dll, not renderer JS.
  • Prefer the existing runtime path in python-src/modules/trae_patch/ and service glue in python-src/modules/services/trae_native_route.py.
  • Keep python-src/scripts/trae_patch/ for repro, CDP triggering, and maintenance probes only. Do not move runtime-required code back into scripts.
  • Do not hand-roll Trae private SSE/WebSocket events unless the user explicitly asks to compare alternatives. The current goal is to reuse Trae's native parser by rewriting the outgoing request URL before reqwest.
  • Avoid noisy foreground probes. Capture long output to files or existing JSONL logs, summarize only the relevant events, and stop background processes when done.
  • Do not stage changes unless the user explicitly asks. This project has a history of large touched sets during Trae debugging.

Workflow

  1. Classify the failure before changing code.

    • 4028: generic Trae custom-model failure. It can mean auth, unreachable local service, wrong URL, 4xx, or malformed response.
    • 4054: usually means Trae's native/custom-model tunnel path rejected or could not consume the stream; prior private protocol hand-roll attempts hit this.
    • 429: usually caused by repeated live upstream probes or duplicate requests; throttle and inspect request counts before blaming auth.
  2. Confirm which path is under test.

    • Native route should launch Trae with CDP, start local loopback on 127.0.0.1:18083, and run the native rewriter.
    • Legacy reverse-hosts route is separate. Shared proxy behavior such as config hot update should flow through ProxyApp.apply_runtime_config().
    • If debugging a route choice or UI config, inspect settings/state first; otherwise stay native.
  3. Reproduce with the smallest useful surface.

    • For module availability: uv run python -m modules.trae_patch.trae_native_sse_open_url_rewriter --help
    • For byte-pattern drift: run scripts/trae_patch/trae_native_byte_pattern.py with the known URL-copy pattern.
    • For a real custom-model session: use scripts/trae_patch/trae_native_custom_model_session.py.
    • For UI-triggered repro without manual clicking: use scripts/trae_patch/trae_cdp_send_chat.py.
  4. If Trae updated or offsets moved, read references/update-recovery.md.

  5. If unsure why a prior approach is rejected, read references/native-route-map.md before creating new probes.

Show full SKILL.md (103 more words)Show less

Known Stable Facts

  • The useful native chain is: CustomModelProxyManager -> official custom-model WebSocket tunnel -> SSE instruction -> reqwest -> user base_url.
  • The current patch avoids Trae's private tunnel protocol by rewriting the final URL used for the outgoing OpenAI-compatible request.
  • Renderer/global scans for BootConfig, MNI channel interception, and hand-built JS/internal events were negative or higher-maintenance routes.
  • The known URL-copy byte pattern is 48 8b 52 08 4d 8b 46 10 48 8d 8d 20 01 00 00; the call offset used by the rewriter is 0x0F.

Resources

  • references/native-route-map.md: architecture, file map, and prior dead ends.
  • references/update-recovery.md: procedure for recovering after Trae version changes or breakpoint drift.

© BiFangKNT, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in .codex/skills/trae-native-debug of BiFangKNT/mtga.

  • SKILL.md
  • agents/openai.yaml
  • references/native-route-map.md
  • references/update-recovery.md

Open the folder on GitHubat commit 72669fb

Compare with similar skills

Trae Native Debug next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Trae Native Debug compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Trae Native Debug this skillBiFangKNT/mtga1.2k—~920Automated safety check: PassAGPL-3.0
LangBot Plugin Developmentlangbot-app/LangBot18k—~3.9kAutomated safety check: PassApache-2.0
Python Performance Optimizationwshobson/agents40k13 repos~814Automated safety check: PassMIT
Git History Bug Auditben-manes/caffeine18k—~3.3kAutomated safety check: PassApache-2.0
Keybase RPC Log Analysiskeybase/client9.3k—~3kAutomated safety check: PassBSD-3-Clause
The Art of Debuggingstas00/the-art-of-debugging1.7k—~6.1kAutomated safety check: NotesCC-BY-SA-4.0

Similar skills

  • LangBot Plugin Development

    langbot-app/LangBot

    Guides building, debugging and testing LangBot plugins: components, SDK calls, README and locale rules, SDK pitfalls and WebSocket-based testing.

    18k GitHub stars~3.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Profiles slow Python code with cProfile and memory profilers, then applies targeted fixes for CPU, memory, I/O and query bottlenecks.

    40k GitHub starsUsed in 13 repos~814 tokens
    DevelopmentAuto-check passed
  • Git History Bug Audit

    ben-manes/caffeine

    Audits a module by walking its git history commit by commit, tracking unresolved issues forward, and reporting the ones that survive to HEAD as findings.

    18k GitHub stars~3.3k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Captures a clean Keybase service log and analyzes it for redundant, duplicated or looping RPCs, then checks whether a caching fix reduced the calls.

    9.3k GitHub stars~3k tokensUpdated today
    DevelopmentAuto-check passed
  • The Art of Debugging

    stas00/the-art-of-debugging

    Condensed debugging method and tool recipes for Unix, Python and PyTorch programs: crashes, hangs, segfaults, wrong output, CUDA OOM, NaN values and slowness.

    1.7k GitHub stars~6.1k tokensUpdated 2 days ago
    DevelopmentAuto-check: notes
  • Adk Setup

    google/adk-python

    Official

    Sets up a local ADK Python development environment in a git clone of the open-source adk-python repository: a uv virtual environment, all dependency extras, pre-commit hooks, and a first unit-test…

    22k GitHub stars~993 tokensUpdated today
    DevelopmentAuto-check: notes

More from BiFangKNT/mtga

  • Ast Grep

    BiFangKNT/mtga

    Write and debug ast-grep rules for structural code search and rewrite.

    1.2k GitHub stars~802 tokensUpdated 3 mo ago
    Auto-check passed
  • Gh CLI

    BiFangKNT/mtga

    使用 GitHub CLI (gh) 执行非交互式 GitHub 协作与自动化任务(PR、Issue、Actions、Release、API 查询/修改)。当用户要求“用 gh 命令完成任务”、需要结构化 JSON 输出(--json/--jq)、批量处理 PR/Issue(如“批量 review 多个 PR”)、按策略合并(如“检查通过后自动 squash 合并”)时使用此 skill。

    1.2k GitHub stars~599 tokensUpdated 3 mo ago
    Auto-check passed
  • Tauri

    BiFangKNT/mtga

    构建、调试与发布 Tauri v2 应用的工程化工作流。覆盖项目初始化(create-tauri-app)、前端与 Rust 命令通信([tauri::command] + invoke)、状态管理、Capabilities 权限建模、插件接入、跨平台构建与问题排查。当用户需求涉及“创建 Tauri 项目”“把 Web 前端接到 Rust…

    1.2k GitHub stars~466 tokensUpdated 3 mo ago
    Auto-check passed
  • Uv

    BiFangKNT/mtga

    在 Windows/macOS/Linux 上使用 uv 执行 Python 运行、依赖同步、锁文件管理、Python 版本管理与工具命令(uv run、uv sync、uv lock、uv python、uv tool)。当任务涉及“用 uv 运行脚本/命令”“临时依赖(--with)”“锁文件一致性(--locked/--frozen)”“跨平台…

    1.2k GitHub stars~541 tokensUpdated 3 mo ago
    Auto-check passed
  • Pwsh

    BiFangKNT/mtga

    在 Windows PowerShell 5.1 与 PowerShell 7 中编写和执行稳定命令,重点处理引号、管道符、原生命令参数传递与跨版本兼容。遇到 --jq/过滤表达式被 PowerShell 误解析、同一命令在 pwsh5 与 pwsh7 行为不一致、或需要为 pwsh7.3+ 增加参数传递适配时使用此 skill。

    1.2k GitHub stars~338 tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Trae Native Debug

What does Trae Native Debug do?

Maintain, debug, and recover MTGA's Trae native custom-model route. Trae Native Debug is an agent skill from BiFangKNT/mtga. Maintain, debug, and recover MTGA's Trae native custom-model route.

When should I use Trae Native Debug?

Trae Native Debug fits situations like: trae native integration fails; trae updates shift aiagent.dll hook offsets; errors such as 4028/4054/429 appear; native rewriter.

How do I install Trae Native Debug in Claude Code?

Run `npx skills add BiFangKNT/mtga --skill trae-native-debug -a claude-code`. Or copy the skill folder (.codex/skills/trae-native-debug in BiFangKNT/mtga) into .claude/skills/trae-native-debug in your project. Claude Code loads it when a task matches its description.

How do I install Trae Native Debug in Codex?

Run `npx skills add BiFangKNT/mtga --skill trae-native-debug -a codex`. Or copy the skill folder (.codex/skills/trae-native-debug in BiFangKNT/mtga) into .agents/skills/trae-native-debug in your project. Codex loads it when a task matches its description.

Can I use Trae Native Debug in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add BiFangKNT/mtga --skill trae-native-debug -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/trae-native-debug, .gemini/skills/trae-native-debug, .github/skills/trae-native-debug and .opencode/skills/trae-native-debug in your project.

What does Trae Native Debug need to run?

Going by SKILL.md and its folder, Trae Native Debug needs the command-line tools its instructions call (uv). Our summary lists: Python 3.

Does Trae Native Debug access the network?

SKILL.md contains no URLs. Its commands use uv, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Trae Native Debug safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Trae Native Debug use?

Trae Native Debug is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Trae Native Debug use?

About 920 tokens (SKILL.md is roughly 3.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.5k tokens, read only when the agent opens those files.

What are the alternatives to Trae Native Debug?

Skills that share tags, products or a category with Trae Native Debug: LangBot Plugin Development (langbot-app/LangBot, 18k stars), Python Performance Optimization (wshobson/agents, 40k stars), Git History Bug Audit (ben-manes/caffeine, 18k stars) and Keybase RPC Log Analysis (keybase/client, 9.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Trae Native Debug?

BiFangKNT (a GitHub user) maintains it in BiFangKNT/mtga, which has 1,169 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on June 18, 2026.

Source: BiFangKNT/mtga on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.