A minimal, scratch-built AI coding agent client in TypeScript. No LangChain. No abstraction layers. Just the core loop, your tools, and the LLM.
A carefully crafted set of native tools and a lean agent loop — no frameworks, no bloat.
OpenAI, Anthropic, DeepSeek, MiniMax, Kimi, GLM — swap providers with a single environment variable.
The LLM decides which tool to call, receives results, and iterates until the task is done. Max 20 rounds per task.
Tools defined as JSON Schema and dispatched natively by the LLM — no string parsing, no regex hacks.
Run shell commands safely inside the workspace with a 30-second hardcoded timeout.
Path-traversal protection via safePath(). All file operations are locked to the current workspace.
Sanitized eval for math — only 0-9 + - * / . ( ) characters pass through.
Extend the agent with installable skills. Skills live as SKILL.md files under {CODEDIR}/skills/ or .agents/skills/.
Persistent memories across sessions and automatic context compression to stay within token limits.
From entry point to agent loop — a zero-abstraction design you can read in an afternoon.
Sends conversation + tool definitions to the LLM. The LLM responds with text or tool calls. Tool results feed back as user messages. Repeats until done or 20 rounds reached.
Three-layer compression: large outputs → disk with previews, old tool results summarized, and an optional /compact command for LLM continuity summaries.
Before each tool call, deny rules are checked. Blocks destructive commands (rm -rf /, dd, mkfs*, shutdown) and /etc/* writes; prompts for confirmation on network commands (wget, curl, ssh, scp).
Persistent memories stored as Markdown files with YAML frontmatter. Four types: user preferences, feedback corrections, project facts, external references.
One dependency install, one API key, and you're talking to your agent.
# Clone and install $ git clone https://github.com/chingjustwe/codecode.git $ cd CodeCode $ npm install # Configure your API key $ cp .env.example .env $ # Edit .env with your provider & API key
# Default (Anthropic Claude) $ npm start # Or pick a provider: $ npm run openai $ npm run deepseek $ npm run minimax $ npm run kimi $ npm run glm
Each tool is a JSON Schema definition with a runtime function — registered in the tool registry and auto-included on every API call.
To deeply understand how coding agents work under the hood — tool-calling loops, multi-provider LLM integration, and file-system tooling — without any framework abstraction.
Two minimal runtime dependencies (dotenv + js-yaml) + TypeScript toolchain. That's it.
Every part of the agent is readable in an afternoon. No black boxes, no magic.