code-mode

Execute sandboxed scripts against large API responses to reduce context size.

21|5|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/chenhunghan/code-mode-skill --skill code-mode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-mode
Source: https://github.com/chenhunghan/code-mode-skill/tree/main
Command: npx skills add https://github.com/chenhunghan/code-mode-skill --skill code-mode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces context size by enabling a code-mode workflow where LLMs generate small processing scripts that run against large API responses in a sandboxed runtime, ensuring only the script's output enters the context.

Core Features & Use Cases

  • Interactive planning to understand the MCP server and data shapes.
  • Sandbox-selected code execution tool to process raw API responses.
  • Benchmarking to verify context-size reductions before/after.
  • Language-agnostic: supports TypeScript/JavaScript, Python, Go, Rust and more.

Quick Start

Ask your agent to add code mode to an MCP server to start reducing context by executing sandboxed scripts.

Frequently Asked Questions about code-mode

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce context size when processing large API responses in an MCP server?

Sandboxed script execution reduces context size by running code-mode scripts against large API responses and returning only the processed output to the MCP server context window.

What is the code-mode workflow for LLMs and when should I use it?

Code-mode is a workflow where LLMs generate processing scripts that run against large API responses in a sandboxed runtime. Use it when raw API payloads threaten to exhaust your context window.

Can I execute sandboxed scripts in languages other than Python or JavaScript?

Yes, the sandboxed code execution supports TypeScript, JavaScript, Python, Go, and Rust, allowing language-agnostic script execution across various MCP server implementations.

How do I add code mode to an MCP server?

Ask your agent to add code mode to an MCP server. Setup requires a SKILL.md frontmatter with name and description, a sandboxed executor to run scripts, and optional references or assets.

Is there a way to benchmark context-size reductions before and after script execution?

Yes, benchmarking verifies context-size reductions before and after executing sandboxed scripts, ensuring the code-mode workflow effectively minimizes the payload entering the MCP server context.

Do I need specific dependencies to run sandboxed scripts against API responses?

No specific dependencies are required to run sandboxed scripts. You need a SKILL.md frontmatter with name and description, a sandboxed executor, and optional references to guide usage.