Skip to content
Historical archive: this page describes Karajan v3. kj run and its pipeline were retired in 5.0; your agent does the work and Karajan governs it. See Migrating to 5.0.

kj agents

kj agents is the role → provider map. Every pipeline role (coder, reviewer, planner, …) is backed by some AI provider (Claude, Codex, Gemini, Aider, OpenCode); this command shows that mapping and changes it without re-running the kj init wizard.

kj agents reads the role-to-provider assignments from your config and either lists them (kj agents / kj agents list) or sets one (kj agents set <role> <provider>). By default kj agents set writes the panel of the repo you are in, .karajan/kj.config.yml (--local); --global writes the shared ~/.karajan/kj.config.yml, used by repos without a panel of their own. Outside a repo with a .karajan/ folder, kj agents set without --global stops and says so.

This is the “I want Gemini reviewing instead of Codex from now on” command.

The panel is yours: it decides who writes the code, who reviews it and who arbitrates. kj agents set is a human act (ADR 0009, ADR 0018), like kj hooks set. kj refuses it when it runs inside an agent session or descends from an agent process, and you confirm it by typing back the code it shows at your terminal. At the critical level (the default) and at max your phone signs it too; at normal, only when a phone is enrolled. Type it in your own terminal, never in a script.

The MCP tool kj_agents lists the panel; its set action refuses and names the kj agents set command for you to type. kj agents (the listing) stays free.

  • Switching a role’s provider permanently — kj agents set reviewer gemini.
  • Inspecting the current map — kj agents before a run to confirm who’s backing what.
  • After installing a new agent CLI — point a role at it without the full kj init wizard.
  • Cost/quality tuning — move the coder to a cheaper provider, keep the reviewer on a strong one.
  • From an agent session — kj refuses it; the agent tells you the command and you type it.
  • First-time setup — kj init detects what’s installed and walks every role; kj agents assumes you already know the provider name.
  • Enabling/disabling a role — that’s pipeline toggles (--enable-X / config), not provider mapping. kj agents only answers “which provider”, not “does this role run”.
  • Reading what a role does — that’s kj roles, not kj agents.
Form Effect
kj agents / kj agents list Print every role and its assigned provider.
kj agents set <role> <provider> Reassign one role: kj agents set coder claude.
Flag Default When to flip it
--local on Write this repo’s .karajan/kj.config.yml.
--global off Write the shared ~/.karajan/kj.config.yml, for repos without a panel of their own. Exclusive with --local.
Terminal window
kj agents

What happens: prints the role→provider table (e.g. coder → claude, reviewer → codex, planner → claude). The fastest way to answer “who reviews here?”.

Terminal window
kj agents set reviewer gemini

What happens: kj shows a code, you type it back, and this repo’s .karajan/kj.config.yml gets reviewer: gemini; kj review in this repo uses Gemini until you change it again. No other role is touched.

Terminal window
kj agents set coder codex
kj agents set reviewer claude

What happens: coding moves to one provider, review to another — a deliberate cross-provider pair set as the persistent default.

kj agents set checks the role and the provider, runs the human act, and only then writes the config file of its scope. A refused act writes nothing. The provider must be one kj knows or a binary on your PATH.

Keeping kj agents (the provider behind a role) distinct from kj roles (what the role is) keeps two independent questions apart: who backs a role, and what the role does.

  • kj roles — what each role is; kj agents only sets who backs it.
  • kj init — the wizard that establishes the initial mapping.
  • kj config — view the underlying kj.config.yml.
  • Pipeline roles — the full catalogue of roles you can reassign.

Karajan Code™ · AGPL-3.0