k0rtexdocs Get started

Claude Code provider.

On this page

Runs k0rtex sessions in Claude Code. Install it next to k0rtex-worker, for example k0rtex-worker[claude-code]; the worker finds it through the k0rtex.providers entry point.

On the worker #

This provider runs the claude command headless, so install Claude Code and sign in as the account that runs the worker (claude auth login), or set ANTHROPIC_API_KEY in the worker’s environment. To launch it from somewhere else, write providers.json in the worker’s data directory:

json
{"claude-code": {"command": "/opt/claude/bin/claude"}}

A worker that runs as root must set IS_SANDBOX=1, or Claude Code refuses the permission mode that unrestricted agents use.

What it does #

Everything k0rtex knows about Claude Code is in this package:

  • the launch: claude -p with stream-json in and out, and --permission-prompt-tool stdio so permission requests reach the owner,
  • how a session’s agents, permissions, skills and MCP servers become its flags (the agents and MCP servers go in private files, so no credential shows in the process list),
  • dialect.py, which reads the stream into k0rtex activity and writes the owner’s answers.

The models offered are the CLI’s aliases (fable, opus, sonnet, haiku).

k0rtex Claude Code
Primary agent and specialists agents, keyed k0rtex-<role>; the primary is selected as the session’s agent
An agent with no rules Every tool, permission mode bypassPermissions
An agent with rules Its tools list holds only what a rule allows or asks about, in mode default
shell <command> allow Bash(<command>) allow rule
read <pattern> ask or deny Read(**/<pattern>) rule
k0rtex_<server>_<tool> mcp__<server>__<tool>; mcp__<server> when the tool is *
subagent k0rtex-<role> allow Agent(k0rtex-<role>) in tools
Bundled skills The skills folder as an additional directory; the agent reads SKILL.md
MCP servers --mcp-config with --strict-mcp-config, so only the session’s servers load

Where it differs from k0rtex’s own rules #

  • Claude Code keeps allow, ask and deny rules per session, not per agent, and a deny beats an ask, which beats an allow. So the rules of a session’s agents are merged, and what an agent may not use is kept from it through its own tools and disallowedTools.
  • Whatever no rule allows is asked of the owner on the board. A restricted agent that tries a shell command outside its allowed list waits for an answer instead of being refused.
  • The account’s own Claude Code settings, plugins and CLAUDE.md files still apply to the session.
  • Model ids are Claude Code’s (sonnet, opus, or a full model id) and carry no vendor.

This page is backend/packages/provider-claude-code/README.md in the k0rtex repository. Suggest a change.