| name | kanban-issues-karr-foundation-cli |
| description | Use when managing karr-foundation — periodic agent execution across multiple karr boards, drain loops, and auto-block logic. |
karr-foundation — Periodic Agent Executor for karr Boards
Single-shot daemon that monitors multiple karr boards and runs an agent command
when work is available. Designed for cron/systemd-timer invocation.
Quick start
dirs:
- /storage/raid/home/getty/dev/perl/dbio-dev/dbio
- /storage/raid/home/getty/dev/perl/dbio-dev/dbio-postgresql
scan:
- /storage/raid/home/getty/dev/perl/dbio-dev
command: claude -p "Use karr-coordinator agent, pick next task"
on_idle: skip
drain: true
max_runtime: 1800
max_attempts: 2
*/5 * * * * karr-foundation
Config file
Default: ~/.config/karr-foundation/config.yml
dirs:
- /path/to/repo1
- /path/to/repo2
scan:
- /path/to/parent-dir
Per-repo .karr file
Place in repo root. All keys optional. Agent execution is opt-in: a board runs
an agent only if it has command or claude: true. With no agent on any
board, karr-foundation prints a read-only overview instead of running
anything (see "Overview").
claude: true
claude_bin: claude
claude_max_turns: 30
claude_permission_mode: bypassPermissions
prompt: >-
Use the karr-coordinator skill: pick the next actionable task and move it.
on_idle: skip
drain: true
max_runtime: 1800
max_attempts: 2
max_iterations: 50
cooldown_base: 1
cooldown_max: 64
error_patterns:
- my custom api error
claude, claude_bin, the claude_* knobs, command and prompt may also be
set globally in config.yml (default_command / default_prompt); the per-repo
.karr value wins.
Overview
karr-foundation --status (and the default when no board has an agent) prints a
read-only dashboard of every board: status counts, in-progress/blocked tasks,
and lock/cooldown state. No agent is run — usable by a human to coordinate work.
Options
karr-foundation --config PATH
karr-foundation --force
karr-foundation --dry-run --verbose
karr-foundation --status
Agent output streams to the terminal when run interactively (TTY) or with
--verbose, and is always appended to .karr.log.
Drain loop semantics
Each iteration runs command once, then classifies result:
| Outcome | Meaning | Action |
|---|
| progress | board changed | keep draining |
| stall | task claimed but didn't move | bump attempt counter; auto-block after max_attempts |
| common-error | bad exit, timeout, or error pattern | exponential backoff, no task penalty |
| idle | agent did nothing, grabbed nothing | stop |
Auto-block
When a task is stuck after max_attempts, foundation marks it blocked with:
blocked: auto-block: no progress after N attempts (foundation)
Agent can override with karr edit --block "reason".
Exponential cooldown
On common-error: repo waits cooldown_base × 2^level minutes (capped at cooldown_max).
Level resets on next clean (non-error) run.
State files (gitignored)
.karr.state # board hash, per-task attempts, cooldown, last error
.karr.lock # PID lock (prevents concurrent runs)
.karr.log # run log
Environment
During agent execution foundation sets:
KARR_REPO — the repo path
KARR_ROLE=agent — so nested karr calls log under the agent identity
(refs/karr/log/agent/<email>); a human defaults to user
PROMPT — the resolved agent instruction (prompt / default_prompt /
built-in default), referenced as $PROMPT in the command template
Cron example
*/5 * * * * karr-foundation
*/5 * * * * karr-foundation --verbose 2>&1 | logger -t karr-foundation
For dbio-dev repos
Each dbio-* repo needs a .karr file with a command that invokes claude on the
next available task. Example:
command: claude -p "Use karr CLI to pick next task, implement it fully, hand off or close"
on_idle: skip
drain: true
max_runtime: 900
max_attempts: 2
cooldown_base: 2
cooldown_max: 32
To initialize karr in a dbio repo:
cd /path/to/dbio-postgresql
karr init --name dbio-postgresql
karr create "Example task" --priority high
Then add the .karr file and configure foundation to scan the parent dir.