File Purpose ~/.karajan/kj.config.ymlMain configuration (or $KJ_HOME/kj.config.yml) <project>/.karajan.ymlProject-level pricing overrides only <project>/.karajan/roles/*.mdProject-level role instructions <project>/.karajan/plugins/*.jsProject-level plugins
CLI flags override config file values. Config file values override defaults.
coder : claude # AI agent that writes code
reviewer : codex # AI agent that reviews code
review_mode : standard # Review strictness profile
max_iterations : 5 # Max coder-reviewer loop iterations
review_rules : ./review-rules.md # Path to custom review rules
coder_rules : ./coder-rules.md # Path to custom coder rules
base_branch : main # Git base branch for diffs
max_budget_usd : null # Max budget in USD (null = unlimited)
Field Type Default Description coderstring claudeAgent CLI name: claude, codex, gemini, aider, or a custom plugin reviewerstring codexAgent CLI name for code review review_modeenum standardparanoid | strict | standard | relaxed | custommax_iterationsnumber 5Maximum coder-reviewer loop iterations (1-20) review_rulesstring ./review-rules.mdPath to reviewer instruction file coder_rulesstring ./coder-rules.mdPath to coder instruction file base_branchstring mainGit branch used for diff comparison max_budget_usdnumber | null nullEstimated session budget cap in USD (based on API-equivalent pricing). null = unlimited
Override provider and model per role:
Role Purpose coderWrites code and tests reviewerReviews code for quality, security, correctness plannerGenerates implementation plans before coding refactorerRefactors code after approval solomonResolves conflicts between coder and reviewer researcherAnalyzes codebase before planning testerAudits test quality after review securityOWASP security audit triageClassifies task complexity discoverPre-execution gap detection hu-reviewerUser story certification architectSolution architecture design auditRead-only codebase health audit impeccableAutomated UI/UX design audit commiterGit automation
Enable or disable optional roles:
All optional roles are disabled by default. Enable them with --enable-<role> CLI flags or in config.
require_test_changes : true
Field Type Default Description methodologyenum tddtdd (require tests first) or standard (tests optional)require_test_changesboolean trueWhen TDD, require test file changes alongside source changes test_file_patternsstring[] See above Patterns to identify test files source_file_extensionsstring[] See above Source file extensions to monitor for TDD enforcement
Field Type Default Description modelstring | null nullModel override for coder (e.g., claude-opus-4-6) auto_approveboolean trueAllow coder to approve its own output if reviewer approves
Field Type Default Description output_formatstring jsonReviewer output format (always JSON for structured review) require_schemaboolean trueValidate reviewer output matches expected schema modelstring | null nullModel override for reviewer deterministicboolean trueUse deterministic mode for reproducible reviews retriesnumber 1Number of reviewer retries on parse error fallback_reviewerstring codexFallback provider if primary reviewer fails
host : http://localhost:9000
container_name : karajan-sonarqube
network : karajan_sonar_net
enforcement_profile : pragmatic
- new_reliability_rating=E
- new_maintainability_rating=E
- new_duplicated_lines_density>5
extensions : karajan_sonar_extensions
compose_control_ms : 120000
sources : " src,public,lib "
exclusions : " **/node_modules/**,**/dist/**,**/build/**,**/*.min.js "
test_inclusions : " **/*.test.js,**/*.spec.js,**/tests/**,**/__tests__/** "
coverage_exclusions : " **/tests/**,**/__tests__/**,**/*.test.js,**/*.spec.js "
Field Type Default Description enabledboolean trueEnable SonarQube scanning hoststring http://localhost:9000SonarQube server URL externalboolean falseIf true, assume an external SonarQube (don’t manage Docker) tokenstring | null nullAuthentication token. Prefer KJ_SONAR_TOKEN env var quality_gateboolean trueCheck quality gate status after scan enforcement_profileenum pragmaticpragmatic (block on ERROR only) or paranoid (block on anything not OK)max_scan_retriesnumber 3Retry failed scans
Severity Meaning BLOCKERApp crash, data loss CRITICALSecurity hole, logic error MAJORQuality issue affecting function MINORCode smell, inconsistency INFOConvention, clarification
Field Type Default Description auto_commitboolean falseCommit all changes after approval auto_pushboolean falsePush branch to origin after commit auto_prboolean falseCreate pull request to base_branch auto_rebaseboolean trueRebase on base_branch before pushing branch_prefixstring feat/Prefix for branch names (e.g., feat/, fix/)
The Git automation flow after approval: rebase (if enabled) → commit → push → PR.
max_iteration_minutes : 15
max_agent_silence_minutes : 20
repeat_detection_threshold : 2
Field Type Default Description max_iteration_minutesnumber 15Time limit per coder-reviewer cycle max_total_minutesnumber 120Total session time limit max_planner_minutesnumber 60Hard runtime cap for planner-only execution (kj_plan/kj plan) max_agent_silence_minutesnumber 20Kill agent run if no output is received for this many minutes fail_fast_repeatsnumber 2Exit after N repeated identical failures repeat_detection_thresholdnumber 2Iterations before detecting repeating patterns max_sonar_retriesnumber 3Max SonarQube scan retries max_reviewer_retriesnumber 3Max reviewer retries on parse error max_tester_retriesnumber 1Max test audit retries max_security_retriesnumber 1Max security audit retries expiry_daysnumber 30Auto-cleanup sessions older than this
Note
Estimated costs, not real billing. Karajan runs CLI agents (Claude Code, Codex, etc.) under your existing subscriptions — it adds no extra cost. The budget system counts tokens and estimates what the session would cost if you were using APIs directly, based on published pricing rates. This is useful for comparing approaches and setting guardrails, not for invoicing.
output_per_million : 0.015
Field Type Default Description warn_threshold_pctnumber 80Warn when estimated spending reaches this % of max_budget_usd currencyenum usdDisplay currency: usd or eur exchange_rate_eurnumber 0.92EUR to USD exchange rate pricingobject Built-in Per-agent pricing rates for estimation (input_per_million, output_per_million)
The pricing section can also be set in a project-level .karajan.yml file to override per-project estimation rates.
Field Type Default Description max_attemptsnumber 3Max retry attempts for transient API errors initial_backoff_msnumber 1000Initial backoff delay (1 second) max_backoff_msnumber 30000Maximum backoff delay (30 seconds) backoff_multipliernumber 2Exponential backoff multiplier jitter_factornumber 0.1Random jitter as fraction of backoff (10%)
Field Type Default Description report_dirstring ./.reviewsDirectory for session reports and logs log_levelenum infoLogging level: debug | info | warn | error
Integration with Planning Game — an agile project management system (XP methodology) available as an MCP server .
Field Type Default Description enabledboolean falseEnable Planning Game MCP integration project_idstring | null nullPlanning Game project ID codeveloperstring | null nullDeveloper ID for codeveloper field
review_event : becaria-review
comment_event : becaria-comment
Field Type Default Description enabledboolean falseEnable BecarIA Gateway — publish pipeline results as PR comments/reviews via GitHub App review_eventstring becaria-reviewGitHub repository_dispatch event type for formal reviews (APPROVE/REQUEST_CHANGES) comment_eventstring becaria-commentGitHub repository_dispatch event type for agent comments comment_prefixboolean truePrefix comments with [Agent] (e.g., [Reviewer], [Sonar])
When enabled: true, Karajan automatically sets git.auto_commit, git.auto_push, and git.auto_pr to true. See Pipeline Flows for the full BecarIA architecture.
Field Type Default Description enabledboolean falseEnable Serena integration for codebase-aware context
Field Type Default Description enabledboolean trueEnable smart model selection based on task complexity tiersobject {}Named tiers with model assignments (e.g., fast, balanced, powerful) role_overridesobject {}Per-role model overrides that bypass tier selection
Example with tiers:
Disable with --no-smart-models CLI flag.
Field Type Default Description repeatThresholdnumber 2Stop the pipeline after this many consecutive identical failures
This is separate from session.fail_fast_repeats — failFast applies to the orchestrator’s global repeat detection across all stages.
Variable Purpose Default KJ_HOMEOverride Karajan config directory ~/.karajanKJ_SONAR_TOKENSonarQube authentication token From config KJ_SONAR_ADMIN_USERSonarQube admin username adminKJ_SONAR_ADMIN_PASSWORDSonarQube admin password From config KJ_SONAR_PROJECT_KEYOverride SonarQube project key From config VISUAL / EDITOREditor for kj config --edit vi
Environment variables take precedence over config file values for the fields they map to.
The review_mode setting controls how strictly the reviewer evaluates code:
Priority : Security → Correctness → Tests → Architecture → Style
Blocking : Security issues, logic errors, broken tests, file overwrites
Non-blocking : Style suggestions
Philosophy : Every change is suspect until proven safe
Priority : Security → Correctness → Tests → Data integrity → Architecture → Style
Blocking : All security checks, missing error handling, missing input validation, missing tests, entire file rewrites
Confidence threshold : Approve only if confidence > 0.85. Default to REJECTION
Priority : Security → Correctness → Tests → Architecture → Style
Blocking : All security issues, logic errors, insufficient test coverage, missing error handling for external calls
Confidence threshold : Reject if confidence < 0.80
Philosophy : Prefer approving with suggestions
Priority : Critical security → Clear bugs → Critical path tests
Blocking : Only critical security (secrets, SQL injection, XSS) and clear logic errors
Confidence threshold : Reject if confidence < 0.60
Uses the base reviewer.md file (project-local, global, or built-in) without a pre-defined profile. Full control via your review-rules.md file.
Role instructions are resolved in this order (first found wins):
Project-local : <project>/.karajan/roles/{role}.md
Global : ~/.karajan/roles/{role}.md
Built-in : templates/roles/{role}.md (shipped with Karajan)
Review mode profiles follow the same pattern:
.karajan/roles/reviewer-{mode}.md
~/.karajan/roles/reviewer-{mode}.md
templates/roles/reviewer-{mode}.md
Plugins are loaded from all locations (not first-wins):
<project>/.karajan/plugins/*.js
~/.karajan/plugins/*.js
~/.karajan/ # Global config ($KJ_HOME)
├── kj.config.yml # Main configuration
├── roles/ # Global role instructions
│ ├── reviewer-paranoid.md
├── plugins/ # Global plugins
├── sessions/ # Session logs
└── docker-compose.sonar.yml # SonarQube Docker config
├── .karajan/ # Project-level overrides
│ ├── roles/ # Project role instructions
│ └── plugins/ # Project plugins
├── .karajan.yml # Project pricing overrides
├── coder-rules.md # Coder guidelines
└── review-rules.md # Review guidelines
enforcement_profile : paranoid
enforcement_profile : paranoid
review_event : becaria-review
comment_event : becaria-comment