SuperAPI AI Directory

kolega-code

Open-source terminal coding agent where the model writes its own multi-agent workflows (Gigacode), with 15+ providers and MCP support.

Open website

About this tool

Purpose

Kolega Code is a coding agent that runs in the terminal, positioned as local-first. It is aimed at developers who need to complete tasks such as investigation, modification, migration, and review in code repositories. For broad tasks that a single agent loop struggles to cover, it provides the Gigacode engine, letting the model write its own multi-agent orchestration program.

Main capabilities

Gigacode: model-written orchestration

For repository-level reviews, migrations, or plans containing independent workflows, the model no longer delegates workers one by one, but instead writes an orchestration program. This program can combine parallel stages, pipelines, adversarial verification, judge panels, and synthesis gates to fit the task. The runtime saves the script to disk for inspection and re-running.

The model first investigates the repository, then writes a Python program against a small runtime API (agent, parallel, pipeline, phase, budget). The runtime enforces concurrency limits, agent count fallbacks, and token budget accounting, and dispatches typed sub-agents, including read-only investigators, coders, and browser agents, whose activity flows into the TUI's sub-agent inspector.

The runtime logs every completed agent call to a disk log. Resume is keyed by content rather than by position: when using resume_from_run_id, calls whose semantic input has not changed are replayed from the log at zero token cost. This mechanism still works even if the script is edited or reordered, or across sessions and process restarts.

Gigacode is off by default and can be enabled with /gigacode on.

General terminal coding agent capabilities

  • Plan/Build mode: read-only Plan mode is used to investigate and generate a reviewable task list, while Build mode is used for implementation (toggle with Shift+Tab). In Plan mode, workflow sub-agents are also forced to be read-only.
  • Repository tools: read and search code, create files, apply precise edits, and inspect session changes/diffs.
  • Terminal execution: run shell commands with streaming output, with project-level permission control.
  • Web search and browsing: uses keyless DuckDuckGo by default; configurable Firecrawl, Tavily, SearXNG; supports direct URL Scraping; provides a Playwright-based browser agent for interactive websites.
  • MCP servers: can connect to streamable_http, sse, and stdio types of MCP servers (including OAuth-enabled HTTP servers) as permission-gated tools.
  • Interactive or scripted: the Textual TUI supports queuing follow-up instructions; kolega-code ask makes a one-off call and outputs JSON; supports session listing/export/resume; provides a doctor command.
  • Editor integration: drives the full agent from Zed or VS Code via the Agent Client Protocol, including streaming responses, tool cards, diffs, permission prompts, plan/build approvals, session resume, slash commands, and subagent records.
  • Extensibility: agent skills, project prompt template overrides, lifecycle hooks, persistent project permission rules.
  • Local-first state: sessions, settings, permissions, OAuth tokens, and API key settings remain on the local machine, and use restrictive permissions where applicable.

Usage

Installation

Install using the script, or install with uv (or pip), then verify the installation.

Startup and connection model

Start a session in a project, and connect to a model via the first-run wizard by logging in with ChatGPT or using an API key. Afterward, settings can be opened from the sidebar or /settings. Use Shift+Tab to switch between Plan and Build modes, and run /gigacode on when the task is broad enough.

Models and routing

Kolega Code can route models by role: a strong long-context model can be used for the main loop, a faster model for tool calls, and a dedicated model for extended thinking. Planning, building, investigation, general, and browser agents all support per-role overrides. The Gigacode workflow can also use model_override to pin a cheaper model for a single call, letting one model write the orchestration while a cheaper model runs its agents.

Supported model providers include: OpenAI (login via ChatGPT subscription), Mistral AI (native API), DashScope / Qwen, OpenRouter (can connect to 250+ tool-capable models), Moonshot / Kimi, Z.AI / GLM Coding Plan, Kimi Coding Plan.

When using a paid ChatGPT plan (Plus, Pro, or Business), /login chatgpt can run OpenAI models without a separate API key; the token is stored locally (chmod 600) and refreshed automatically.

Web search backends include DuckDuckGo (default, no key required), Firecrawl, Tavily, and self-hosted SearXNG, selectable in settings or via KOLEGA_CODE_WEB_SEARCH_BACKEND.

Requirements

  • An API key for at least one supported model provider, ChatGPT login, or a local model
  • A terminal that supports a modern TUI (most terminals do)

Use cases

  • Repository-level code review, migration, or planning that includes independent workflows
  • Complex tasks that require parallel stages, pipelines, adversarial verification, or a review panel
  • Developers who want to investigate, edit, run commands, and browse the web within the terminal
  • Users who need to drive a full agent from Zed or VS Code
  • Users who want sessions, settings, permissions, and credentials stored locally

Limitations

  • Gigacode is off by default and must be enabled manually.
  • At runtime there are enforced upper limits on concurrency, the number of agents, and the token budget.
  • Regarding Mistral: Medium 3.5, Small 4, Large 4, and Ministral 3 support image input, while Codestral is text-only; Medium/Small/Large offer none (default) or high thinking; token counting is a conservative local estimate with a safety margin, not an exact Mistral tokenizer; the 32,768-token output reservation in the catalog is Kolega's budgeting policy, not a verified native maximum output limit; Kolega Code runs a local function tool loop and does not enable Mistral-hosted server tools; native Mistral keys and model IDs are independent of gateway credentials and routing.
  • Access to Large 4 depends on the account/subscription, and a catalog entry does not guarantee access; aliases (especially latest) may change their target and capabilities.
  • Use absolute binary paths, because bare kolega-code resolves to the version on the editor PATH, and an installed distribution may shadow a development checkout.
  • Local session state lives under the platform's state directory unless KOLEGA_CODE_STATE_DIR is set.
  • API key variables only provide credentials; you still need to explicitly select a provider and model or save them in settings.