Skip to content

Meet CodeN

CodeN has a concrete boundary: it is a local coding agent that connects directly to a model provider, with terminal interfaces by default and an experimental local Web interface. Its core is neither a remote execution service nor a general agent framework; it connects provider-native tool calling to a local tool registry, permission policy, sessions, and extension mechanisms.

The central design choice is malleability. A Plugin changes the actions available to the model, a Skill supplies method knowledge on demand, a Hook runs deterministic policy at lifecycle boundaries, and AGENTS.md supplies durable project instructions. They complement one another, but none turns untrusted code into a sandbox.

CodeN is a coding agent built around pluggable tool plugins. It drives provider-native tool calling to read, modify, and execute commands locally; its small, inspectable core does not depend on an agent framework or server-side code execution.

终端窗口
bun add -g @twinklerg/coden # or npm install -g @twinklerg/coden
export CODEN_OPENAI_API_KEY=... # or CODEN_ANTHROPIC_API_KEY
coden "fix the failing tests in this project"

Install, configure, and finish a first task in three commands. CodeN starts in the CLI/REPL by default and treats the working directory as its workspace. You can also start the experimental local Web interface:

终端窗口
coden --web
coden --web --no-open
coden --web --web-host 0.0.0.0
coden --web --resume <session-id>

Web binds a random 127.0.0.1 port and opens a browser by default. Provider, model, thinking, and language are inherited and read-only; the server keeps one Agent and one turn, while additional tabs are read-only but can take control.

Step Task Page
1 Confirm the runtime environment Requirements
2 Install CodeN Install CodeN
3 Configure your first provider Configure Your First Provider
4 Understand the interface modes Launch the CLI / TUI
5 Complete your first task Complete Your First Task
  • Core Concepts: agent loop, workspace, tools and risk levels, approval modes, sessions, context and thinking levels.
  • Interfaces: CLI/REPL, full-screen TUI, print mode, experimental Web, slash commands, CLI options.
  • Configuration: precedence, scopes, environment variables, OpenAI/Anthropic setup, language and thinking levels, field reference, credential and data security.
  • Skills: discovery, creating a skill, installation and debugging.
  • Plugins: local TypeScript plugins, npm plugin management, author protocol, trust and security boundaries, marketplace.
  • Agent Hooks: events, matchers, I/O protocol, decisions and permissions, execution and timeouts, trust and security, examples.
  • Advanced: Smart Approval, outside-workspace access, session storage, custom base URL, automation.
  • Reference: CLI reference, configuration reference, troubleshooting, FAQ, security model.
  • Every command, configuration key, and behavior in these docs is verified against the current source code.
  • CodeN does not read the system locale; the default interface language is Chinese.
  • bash and plugins run with the current user’s process permissions. This is not a general-purpose sandbox; risk classification is a heuristic guard against mistakes.
  • Session JSONL and trace files may contain sensitive content; do not share them without review.

A coding agent implemented independently in TypeScript and built around pluggable tool plugins: it drives provider-native tool calling to read, modify, and execute locally, without an agent framework or server-side code execution.

Scenario Requirement
run the published CLI Node.js 22+
local TypeScript plugins (*.ts) Bun (cannot load under Node)
npm plugin install/sync bun on PATH
develop from source Bun 1.1+ and Just

Two providers, openai and anthropic, with model IDs set explicitly (default gpt-5-mini). CodeN maintains no model capability allowlist and sends parameters as-is. See Configure Your First Provider.

OpenAI-compatible endpoints via CODEN_OPENAI_BASE_URL. Anthropic always uses the official endpoint. See Custom Base URL.

$XDG_DATA_HOME/coden/sessions/<workspace-hash>/ (default ~/.local/share/coden). File permissions are 0700/0600; contents include model output and reasoning and are sensitive. See Session Storage.

  • -p --auto for single-turn, CI-friendly runs.
  • --max-steps bounds steps (default 80).
  • --resume <id> restores context instead of rebuilding it.
  • Thinking levels affect budget allocation (Anthropic budgets count inside reservedOutputTokens).

Plugins and bash run with the current user’s process permissions and are not a sandbox. Guards: project plugins require workspace trust; npm lifecycle scripts are disabled by default; dangerous-command detection; --auto never skips trust confirmation. See Plugin Trust and Security.

No. npm plugins always use https://registry.npmjs.org, and specifiers accept only npm:<package>[@version]; private registries, Git, URLs, and local directory sources are unsupported.

Restart and run coden --resume <session-id>; interrupted tool calls are repaired as runtime.interrupted errors so the model can continue.

终端窗口
git clone <repository-url>
cd coden
bun install
just check

just build builds the CLI and plugin contract; just publish-dry-run previews the npm publish contents.

Yes. Every command, default, and behavior is checked against the current source, tests, and the built artifact; unverifiable claims do not appear.