gabe4coding/claude-code-mode

Code mode for MCP tools in Claude Code: one sandboxed JavaScript program instead of many tool calls

TypeScript

2

40 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

Show HN: Claude Code Mode

1

Oct 11, 2026

README

code-mode: many MCP calls, one program, one small result

A Claude Code plugin: the model writes one JavaScript program that calls your MCP tools in a sandbox. Only the return value goes back into the context.

License: MIT Node.js 22.13+ No dependencies Claude Code plugin Tests

Quick start · Usage · Hints · Functions · Permissions · Config


https://github.com/user-attachments/assets/468c412f-ecae-4e04-a53b-8a291561a052

Without code-mode, the model calls MCP tools one by one, and each full result goes into the context. With code-mode, the model writes one program. The program calls the tools, then filters and joins the results in a sandbox. Only the answer goes into the context.

  • Fewer tokens: the intermediate data stays out of the context. The model uses the context for the task.
  • Sandbox: the program runs in its own Node process, with no file system and a CPU limit. On macOS, and on Linux where unshare -rn works, it also has no network.
  • Hints: short notes for each MCP server tell the model about result formats, required arguments and limits. The model can propose a new hint or the removal of a wrong hint, and you approve it.
  • Saved functions: the model can propose a program part that works as a function for later sessions. You read the code and approve it.
  • Your permission rules apply: each MCP call in the program gets the normal permission check.

Quick start

You need Claude Code and Node.js 22.13 or later.

Type these commands at the prompt of a Claude Code session:

/plugin marketplace add gabe4coding/claude-code-mode
/plugin install code-mode@claude-code-mode

Start a new session. Then ask for a task that needs several MCP calls.

If you use auto mode, add allow rules for your MCP tools first. Read Permissions.

Example

You ask: "Which of my open Jira issues have no update in the last 14 days?" The model writes one program, for example:

const issues = await call("mcp__claude_ai_Jira__searchJiraIssuesUsingJql", {
  cloudId: "example.atlassian.net",
  jql: "assignee = currentUser() AND statusCategory != Done",
})
const cutoff = Date.now() - 14 * 24 * 3600 * 1000
return issues.issues
  .filter(i => Date.parse(i.fields.updated) < cutoff)
  .map(i => ({ key: i.key, title: i.fields.summary }))

The model gets only the short list, not each full issue.

Documentation

Page
InstallationRequirements, install, local folder, update
UsageThe three tools, how to write a program, the result
HintsWrite hints, approve proposals, the safety rules
Saved functionsApprove or write functions that programs use again
PermissionsManual and auto mode, allow rules
ConfigurationEvery option and its default
How it worksOne run from start to end, the four sandbox layers
TroubleshootingCommon errors and known limits
DevelopmentLayout, tests, releases

License

MIT. See LICENSE.

ai-agents
claude-code
claude-code-plugin
code-mode
mcp
model-context-protocol

gabe4coding/claude-code-mode

Code mode for MCP tools in Claude Code: one sandboxed JavaScript program instead of many tool calls

TypeScript

2

40 commits

updated Oct 12, 2026

See the code

See what people are saying

SourceMessageScoreDate

Show HN: Claude Code Mode

1

Oct 11, 2026

README

code-mode: many MCP calls, one program, one small result

A Claude Code plugin: the model writes one JavaScript program that calls your MCP tools in a sandbox. Only the return value goes back into the context.

License: MIT Node.js 22.13+ No dependencies Claude Code plugin Tests

Quick start · Usage · Hints · Functions · Permissions · Config


https://github.com/user-attachments/assets/468c412f-ecae-4e04-a53b-8a291561a052

Without code-mode, the model calls MCP tools one by one, and each full result goes into the context. With code-mode, the model writes one program. The program calls the tools, then filters and joins the results in a sandbox. Only the answer goes into the context.

  • Fewer tokens: the intermediate data stays out of the context. The model uses the context for the task.
  • Sandbox: the program runs in its own Node process, with no file system and a CPU limit. On macOS, and on Linux where unshare -rn works, it also has no network.
  • Hints: short notes for each MCP server tell the model about result formats, required arguments and limits. The model can propose a new hint or the removal of a wrong hint, and you approve it.
  • Saved functions: the model can propose a program part that works as a function for later sessions. You read the code and approve it.
  • Your permission rules apply: each MCP call in the program gets the normal permission check.

Quick start

You need Claude Code and Node.js 22.13 or later.

Type these commands at the prompt of a Claude Code session:

/plugin marketplace add gabe4coding/claude-code-mode
/plugin install code-mode@claude-code-mode

Start a new session. Then ask for a task that needs several MCP calls.

If you use auto mode, add allow rules for your MCP tools first. Read Permissions.

Example

You ask: "Which of my open Jira issues have no update in the last 14 days?" The model writes one program, for example:

const issues = await call("mcp__claude_ai_Jira__searchJiraIssuesUsingJql", {
  cloudId: "example.atlassian.net",
  jql: "assignee = currentUser() AND statusCategory != Done",
})
const cutoff = Date.now() - 14 * 24 * 3600 * 1000
return issues.issues
  .filter(i => Date.parse(i.fields.updated) < cutoff)
  .map(i => ({ key: i.key, title: i.fields.summary }))

The model gets only the short list, not each full issue.

Documentation

Page
InstallationRequirements, install, local folder, update
UsageThe three tools, how to write a program, the result
HintsWrite hints, approve proposals, the safety rules
Saved functionsApprove or write functions that programs use again
PermissionsManual and auto mode, allow rules
ConfigurationEvery option and its default
How it worksOne run from start to end, the four sandbox layers
TroubleshootingCommon errors and known limits
DevelopmentLayout, tests, releases

License

MIT. See LICENSE.

ai-agents
claude-code
claude-code-plugin
code-mode
mcp
model-context-protocol