Skip to content

Quick Start

This guide assumes you’ve already installed Karajan Code and run kj init.

  1. Navigate to your project

    Terminal window
    cd /path/to/your/project
  2. Run a task

    Terminal window
    kj run "Add input validation to the signup form"

    This launches the full pipeline with your configured defaults (e.g., Claude as coder, Codex as reviewer, TDD methodology).

  3. Watch the pipeline

    You’ll see real-time output as each role executes:

    [coder] Writing validation logic and tests...
    [sonar] Quality gate passed — 0 blockers, 0 critical
    [reviewer] APPROVED — no issues found
    ✔ Pipeline completed in 2m 34s (iteration 1/5)

    If the reviewer finds issues, the coder gets another attempt. The loop continues until approval or the iteration limit is reached.

  4. Check the results

    Terminal window
    git diff # See what changed
    kj report # View session summary
    kj report --trace # Detailed cost breakdown per stage

The standard workflow — coder writes, SonarQube scans, reviewer checks, loop until approved:

Terminal window
kj run "Fix the login bug that ignores empty passwords"

Skip the review loop. Useful for quick changes you’ll review yourself:

Terminal window
kj code "Add a loading spinner to the dashboard"

Review the current diff without writing code. Useful after manual changes:

Terminal window
kj review "Check my authentication refactor"

The most powerful way to use Karajan Code is as an MCP server inside your AI agent. After npm install -g karajan-code, the MCP server auto-registers in Claude and Codex.

From your agent, simply ask it to run a task:

“Use kj_run to fix the SQL injection vulnerability in the search endpoint”

The agent sends the task to kj_run, gets real-time progress notifications, and receives structured results — all without leaving the conversation.

Manual MCP configuration (if needed):

{
"mcpServers": {
"karajan-mcp": {
"command": "karajan-mcp"
}
}
}

See the MCP Server guide for the full list of 23 available tools.

FlagWhat it does
--coder claudeChoose which agent writes code
--reviewer codexChoose which agent reviews
--methodology tddEnforce test-driven development
--mode paranoidUse the strictest review profile
--enable-triageAuto-classify task complexity
--enable-securityRun OWASP security audit
--auto-commitGit commit after approval
--no-sonarSkip SonarQube analysis
--max-iterations 3Limit coder/reviewer loops

For the full list, see the CLI Reference.

triage? → researcher? → planner? → coder → refactorer? → sonar? → reviewer → tester? → security? → commiter?
  1. Triage (optional) classifies task complexity and activates only necessary roles
  2. Coder writes code and tests following TDD methodology
  3. SonarQube (optional) runs static analysis with quality gates
  4. Reviewer checks the code with configurable strictness
  5. If issues are found, the coder gets another attempt with the reviewer’s feedback
  6. Loop until approved or the iteration limit is reached

Built-in guardrails prevent runaway sessions: max iterations, per-iteration timeouts, total session timeouts, and optional estimated budget caps. Karajan itself adds no cost — it runs CLI agents under your existing subscriptions.