
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
codemode-agent
Advanced tools
Claude agent with execute tool providing programmatic access to file operations, system commands, and MCP tools
A Claude agent with an execute tool that provides programmatic access to file operations, system commands, and MCP tools. Features interactive mode with real-time typing, persistent execution context, and seamless integration with multiple MCP servers.
npm install -g codemode-agent
Or use with npx (no installation required):
npx codemode-agent --agent "Your task here"
CodeMode supports two modes: Agent Mode (interactive) and MCP Server Mode.
Run Claude agent with execute tool for autonomous task completion:
# Interactive mode (default)
codemode-agent --agent "Create a React component"
# Single execution mode (non-interactive)
codemode-agent --agent "Fix bugs" --no-interactive
# Using npx
npx codemode-agent --agent "Your task here"
Start the MCP server that provides the execute tool:
# Start MCP server
codemode-agent --mcp
# Using npx
npx codemode-agent --mcp
# Disable external MCP servers (built-in tools only)
codemode-agent --mcp --nomcp
Add to your Claude Desktop configuration:
{
"mcpServers": {
"codeMode": {
"command": "npx",
"args": ["codemode-agent", "--mcp"]
}
}
}
# Create a file
codemode-agent --agent "Create a file called test.txt with content 'Hello World'"
# Search code
codemode-agent --agent "Find all JavaScript files and count the lines of code"
# Edit files
codemode-agent --agent "Replace all console.log with logger.info in src/"
# Navigate and extract data
codemode-agent --agent "Navigate to example.com and get the page title"
# Screenshot capture
codemode-agent --agent "Take a screenshot of github.com"
# Form automation
codemode-agent --agent "Fill out the contact form on example.com"
# Semantic search
codemode-agent --agent "Find all authentication-related functions"
# AST pattern matching
codemode-agent --agent "Find all useState calls with initial value of null"
# Codebase audit
codemode-agent --agent "List all TODO comments with their locations"
{glob, type, output_mode, '-i', '-n', '-A', '-B', '-C', multiline, head_limit}[{content, status, activeForm}]'pending' | 'in_progress' | 'completed'All MCP tools are available via namespaced functions. Use serverName.toolName(params) format.
CodeMode consists of three main components:
Routes to agent mode or MCP server mode based on command-line flags.
Create .codemode.json to configure MCP servers:
{
"mcpServers": {
"builtInTools": {
"command": "node",
"args": ["built-in-tools-mcp.js"]
},
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
},
"vexify": {
"command": "npx",
"args": ["-y", "vexify@latest", "mcp"]
}
}
}
Configuration file is searched in order:
./.codemode.json./node_modules/codemode-agent/.codemode.json~/.claude/.codemode.jsonVariables persist across execute calls within the same session:
// First execute call
myVar = 42;
console.log(myVar);
// Second execute call (same session)
console.log(myVar);
Variables declared with let, const, or var do NOT persist. Use bare assignment or global.myVar for persistence.
Use clear_context() to reset the execution context.
Run the test suite:
npm test
For full integration testing:
# Start MCP server
node code-mode.js
# In another terminal
node test-builtin-tools.js
--agent [task] - Run in agent mode with optional initial task--no-interactive - Run single execution without interactive mode--mcp - Start MCP server mode--nomcp - Disable external MCP servers (built-in tools only)CodeMode properly handles interrupt signals:
All child processes (MCP servers, execution worker) receive proper shutdown signals and clean up resources.
@anthropic-ai/claude-agent-sdk - Agent framework and streaming@modelcontextprotocol/sdk - MCP protocol implementationchalk - Terminal colors and stylinghighlight.js - Code syntax highlightingfast-glob - File pattern matchingchokidar - File system watchinguuid - Unique identifier generationwhich - Command resolutionzod - Schema validationIf Ctrl-C doesn't interrupt execution, ensure you're running the latest version:
npm install -g codemode-agent@latest
For long-running operations, the timeout is set to 180 seconds. If you need longer:
Edit execution-worker.js and increase the timeout value in __callMCPTool.
Variables declared with let, const, or var don't persist. Use bare assignment:
// Won't persist
let myVar = 42;
// Will persist
myVar = 42;
// Will persist
global.myVar = 42;
Ensure your terminal supports ANSI colors. For Windows, use Windows Terminal or WSL.
Current version: 2.0.38
See CHANGELOG.md for full version history and recent changes.
MIT
lanmower
Contributions welcome! Please open an issue or submit a pull request.
FAQs
Claude agent with execute tool providing programmatic access to file operations, system commands, and MCP tools
We found that codemode-agent demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.