Kent Documentation

website·Indexed 31 days ago

https://kent.sh/

Documentation for Kent, a local client-server tool for agent workflows and shell command post-processing. Includes guides on installation, configuration via `config.toml`, lifecycle and bash hooks, headless runs, sandboxing, and managing Git worktrees.

Tokens
14.1K
Snippets
58
Records
102
Agent score
52%

What's inside Kent

  1. Overview of Kent coding agent

    Kent is a high-performance coding agent for professional engineers focusing on output quality and long-running tasks across large codebases. Unlike basic 'vibe-coding' tools, Kent is designed for complex refactors and collaborative pair programming. Key architectural features include:

    • Advanced Compaction: Uses carryover prompts and a multi-step algorithm where the model decides when to compact context, allowing for 35+ compactions without losing critical state.
    • Supervisor Agent: A customizable supervisor runs in parallel with the main agent to review changes and ensure instruction adherence.
    • Async Execution: Subagents run in async shells, allowing the model to sleep and wake up in a '0-token ralph loop' until tasks are complete.
    • Sandboxing: Orchestrated by a 50mb server process that can be run in complete isolation (e.g., via Docker).
    • Parallelization: First-class support for Git worktrees, enabling 10+ agents to run in parallel via auto-managed worktrees.
  2. Overview of Kent Workflows

    Kent workflows are reusable process graphs that define the lifecycle of a task. They specify the starting point, the agent roles involved, decision points (transitions), human approval gates, parallel execution branches, and terminal states. Workflows are linked to projects; tasks reside in projects and move through the linked workflow as agents execute work, manage worktrees, and record activity.
  3. Start and manage the Kent Server process

    Kent uses a local client-server architecture where all frontends (TUI, desktop app, headless runs) act as clients. The server process manages long-running work including sessions, projects, runtime orchestration, background shells, tool execution, tasks, workflows, and storage. To start the server manually, use the kent serve command.
    kent serve
  4. Understand Kent configuration precedence

    Kent resolves settings using the following priority order (lowest to highest). A setting at a higher level overrides the same property from a lower level. Omitted properties are inherited.

    1. Built-in defaults
    2. Global config: ~/.kent/config.toml
    3. Workspace config: <workspace-root>/.kent/config.toml
    4. Private workspace config: <main-workspace-root>/.kent/config.local.toml (used primarily with worktrees)
    5. Environment variables
    6. CLI overrides

    Important Exception: Provider connection declarations are NOT resolved from workspace configs for privacy and safety; they must be placed in global configs.

  5. Provide required details in a security report

    To ensure quick triage, security reports should include as much of the following as possible:

    • Affected version, tag, or commit
    • Impact and attack scenario
    • Clear reproduction steps or a proof of concept
    • Relevant environment details
    • Indication of whether the issue is already publicly known
  6. Understand Kent's security and trust model

    Kent does not run tools inside a built-in sandbox. The agent executes shell commands and file tools directly in the environment where the Kent server is running. If the server environment has access to secrets, networks, or files, the agent inherits those same permissions. To achieve isolation, Kent should be run within a secure container or VM.
  7. Configure Kent as a background service

    Install the Kent background service to have a shared server start at login. This configuration uses approximately 20 MB of RAM when idle and allows multiple frontends to connect to a single orchestrator, which is required for reliable subagent/background shell control and for using the Kent Desktop app.
    kent service install
  8. Implement parallel execution in workflows

    To execute multiple nodes in parallel, use a Node Group. A fan-out transition from a source node routes to every branch in the group. Each branch then routes to a Join node, which aggregates the parameters before proceeding to the next step in the workflow.

    Example Flow: Implement -> Fan-out -> (Code Review AND QA) -> Join -> Approval Script -> Done

  9. Optimize Workflow Cache and Cost

    Workflow design directly impacts token spend and prompt-cache continuity:

    • Highest Continuity: continue_session maintains the retained Session, conversation history, and provider cache.
    • Clean Start: new_session starts fresh. To avoid wasting tokens on re-orientation, ensure the prompt and parameters contain all necessary context.
    • Balanced: compact_and_continue_session frees context by summarizing the previous session, though it incurs a cost for the compaction process.
  10. Create custom file-backed prompt commands

    Kent discovers Markdown prompt commands on the server within the attached Project Workspace. These are invoked via /prompt:<name>.

    Discovery Paths (Descending Precedence):

    1. <workspace>/.kent/prompts
    2. <workspace>/.kent/commands
    3. <persistence-root>/prompts
    4. <persistence-root>/commands
    5. <persistence-root>/.generated/prompts
    6. <persistence-root>/.generated/commands

    Argument Handling:

    • If the token $ARGUMENTS is present in the Markdown body, Kent replaces it with the trimmed trailing arguments.
    • If $ARGUMENTS is not present, Kent appends non-empty trailing arguments after one blank line.
  11. Guidelines for contributing to Kent

    To ensure a smooth contribution process, follow these workflow requirements:

    1. Start with an Issue: All external contributions must begin with a triaged issue before a PR is opened to confirm scope and approach.
    2. PR Quality: PRs should be small, solve one clear problem, include tests for behavior changes, and update documentation (including AGENTS.md if project guidance changes).
    3. AI Code Policy: AI-generated code is permitted if it meets project quality standards. However, you must:
      • Disclose AI use in the PR authorship.
      • Avoid "co-authored by <agent>" attributions.
      • Avoid adding AI config files like .cursorrules (edit AGENTS.md instead).
      • Use succinct, human-like PR descriptions rather than elaborate AI-generated ones.
  12. Install Kent Desktop

    Install the Kent Desktop application to access Workflows and Tasks for building agentic loops and automated pipelines. Note that the desktop app requires a running Kent server to connect to due to the asynchronous nature of workflows.
    # macOS via Homebrew
    brew install --cask respawn-llc/tap/kent-desktop