SuperAPI AI Directory

keen-code

Keen Code is an open-source, context-aware and efficient CLI coding agent written in Go. Three aspects stand it out from…

Open website

About this tool

Keen Code is a terminal-based AI coding agent written in Go, positioned as a simpler, lighter, minimalist yet practical coding agent for typical software engineering tasks. It is similar to Claude Code or Codex CLI, but deliberately avoids features that are unnecessary or useless for ordinary software engineers, minimizing complexity and keeping the agent framework as simple as possible.

Main capabilities:

  • Multi-provider support: Anthropic, OpenAI, Codex (via OAuth), Gemini, DeepSeek, Kimi, GLM, MiniMax, OpenCode Go, Yolo-Auto, and Amazon Bedrock. Can be switched via /model.
  • 10 built-in tools: read_file, write_file, edit_file, glob, grep, bash, web_fetch, ask_user, delegate_task, and call_mcp_tool. The core coding tools remain lean.
  • Hash line editing: read_file adds an N:HASH| anchor to each line (line number + the line's 3-character FNV-1a hash), and edit_file atomically applies a multi-operation ops[] array based on a single file snapshot; stale anchors are rejected, avoiding edits to content that has drifted. Inspired by pi-hashline-edit.
  • MCP (Model Context Protocol): connects to external tool providers from ~/.keen/mcp/configs.json (or a file specified via --mcp-config <file_path>), supporting streamable HTTP or stdio, with authentication methods including none, api_key, or browser-based oauth. Use /mcp to connect to and inspect servers.
  • Skill-driven MCP servers: each connected MCP server generates an ordinary skill (mcp:<server>) containing a tool table and JSON schema, keeping tool discovery prompt-efficient, with detailed schemas loaded on demand.
  • Skill system: discovers user-defined skills from the project and home directories (.agents/skills, .keen/skills, .claude/skills), activates them as slash commands, and manages them via /skills. Built-in coPractical skills for mmit and review.
  • Sub-agents: define focused profiles in markdown files under .agents/agents/ (project or home directory), with their own provider, model, thinking intensity, and permissions. The main agent delegates up to 10 bounded tasks in parallel via delegate_task.
  • Persistent memory: global (~/.keen/memory/global/MEMORY.md) and project (.keen/MEMORY.md) markdown files are loaded into the system prompt in every session; when you ask it to remember, the agent records to these files. Manage via /memory.
  • Thinking mode: extended reasoning for complex tasks. Use /thinking to change the thinking intensity level of the current model. All models that support thinking are configurable.
  • Session management: persistent sessions with resume support.
  • Context compaction: use /compact to summarize the conversation into a smaller continuation context, or let Keen automatically compact when the context approaches the model's budget.
  • Configurable tool history: by default uses a concise cross-turn TurnMemory summary; use /tool-history full to preserve full tool output for future turns.
  • Adversarial review and side questions: use /adversary to run a separately configured second model as an adversarial critic of the main agent's work, and use /btw to ask quick questions without affecting the main conversation.
  • Input queue: prompts and skill activations entered while the agent is streaming output are queued, previewed, and submitted one by one when the turn completes. Use /emptyq to clear the queue.
  • Headless mode: use keen run "<prompt>" to run non-interactive turns, supporting --format json output, provider/model overrides, --completion-signal gating, and --session resume.
  • Permission system: filesystem access is checked by guards: working directory paths pass, sensitive paths prompt for approval, system or .gitignore paths are denied. Use /allow-permission to always allow a tool.

Usage: Installation: can be installed globally via a script or npm. Installs to /usr/local/bin (if writable), otherwise $HOME/.local/bin. The same command can update the CLI to the latest version. You can also run it directly without a global install. Startup: start Keen in the current directory. Use --model-config and --mcp-config to choose custom configuration files; both accept relative or absolute paths, work independently, and replace their respective defaults (~/.keen/configs.json and ~/.keen/mcp/configs.json); a missing, unreadable, or invalid custom file causes startup to fail and does not fall back. The former --config flag is now --model-config.

Use cases: Aimed at typical software engineering tasks, suitable for developers who want a lightweight, minimalist terminal coding agent. The project itself is also an experiment, demonstrating how to use a coding agent to develop a coding agent, with engineers as "orchestrators" collaborating with AI agents to develop software.

Limitations: Keen Code is highly opinionated, avoiding features that are unnecessary or useless for ordinary software engineers, and is deliberately kept simple. By default, cross-turn context uses a bounded TurnMemory summary, which may occasionally require re-reading files or re-running searches. Full tool history increases prompt size and token cost, and is not persisted when a session is saved. More providers will be added in the future.