About kitherd
kitherd is a skill for coordinating worker agents with Herdr as a headless process manager and Kitty as their visual interface. It describes workspace isolation, agent lifecycle control, monitoring, and interactive attachment without tying workers to a visible multiplexer UI.
Key features
- 01Creates project-specific Herdr workspaces
- 02Starts and prompts worker agents
- 03Attaches workers in Kitty splits
- 04Monitors agent status and output
- 05Handles blocked agents and cleanup
Use cases
- 01Running background coding agents per project
- 02Viewing worker progress beside a terminal
- 03Checking a worker that requests input
- 04Stopping completed agents
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ hassan-shahbazi/ kitherd --skill kitherdAfter installing, type/kitherdin Claude Code to confirm it loaded.
Bundled filesscripts/herdr_panel.py
Details
From the project READMEHeadless Herdr with Kitty
This skill guides an AI coordinator (master) agent on how to manage worker agents using Herdr as the headless background process manager and Kitty as the native GUI window manager.
In this architecture:
- Headless Herdr Server (
defaultsession): Runs as a background daemon (systemd service on Linux, launchd agent on macOS). It manages panes, terminal emulators, agent processes, and persistent lifecycles with no interactive TUI. - Kitty Terminal: Serves as the visual interface. Rather than running a multiplexer UI, worker agents are viewed as native Kitty splits and tabs via
kitty @ launch ... herdr agent attach <name>. Closing a Kitty split only detaches the view; the worker agent continues running in the background. - Interactive Switcher (
herdr_panel.py): The user can open an interactive fzf panel listing all agents with real-time status to attach or terminate them with a defined keybinding.
Core Orchestration Rules
-
Target the Default Session: Always use plain
herdrcommands without--session <name>. Named sessions belong to interactive TUI workflows; do not create headless workers in them unless explicitly instructed. -
Strict Master-Worker Hierarchy: The master agent is the single coordinator that spawns, prompts, monitors, and stops worker agents. Workers must never spawn or control other agents; recursive or peer agent spawning obscures the decision tree and breaks coordination.
-
Herdr Environment Guards: The standard Herdr skill's
HERDR_ENV=1guard applies to interactive TUI panes, not the headless default session. You can safely runherdrCLI commands from any shell. Because the master runs outside a managed Herdr pane,--currentand$HERDR_PANE_IDare unavailable; always target explicit pane IDs or unique agent names. -
Directory Isolation via Workspaces: Every project directory must have its own dedicated Herdr workspace. Multiple workers for the same project share that workspace. Never mix workers from different repositories or projects in the same workspace to prevent context contamination during concurrent runs.
-
Mandatory Absolute
--cwd:--cwdis mandatory on everyworkspace create,tab create, andpane split. It must be an absolute path (use"$PWD"for the current project root). Herdr CLI does not automatically inherit the caller's working directory; omitting--cwdcauses the new pane to inherit whichever workspace was previously focused or fall back to$HOME. Confirm thecwdfield in JSON responses before starting an agent. -
Kitty Remote Launch Parity (
--copy-envand--cwd): When opening a window or tab in Kitty viakitty @ launch, always pass both--copy-envand--cwd="$PWD":kitty @ launch --type=window --location=vsplit --copy-env --cwd="$PWD" herdr agent attach <worker-name>--copy-env: Kitty's GUI process is spawned by systemd, launchd, or the desktop manager with a minimal environment.--copy-envpropagates your active shell environment (PATH, API keys, virtualenvs, direnv).--cwd="$PWD": Sets the working directory of the Kitty window container. Without this, new splits (alt+enter), tabs, or helper terminals created inside that Kitty window default to$HOME. Note:herdr agent attachis a client proxy, not a shell, so Kitty's--cwd=last_reportedcannot detect the agent's directory automatically.
-
Prefer Splits Over Tabs: Always default to Kitty vertical splits (
--location=vsplit) when attaching new worker agents so the user can observe progress side-by-side. Use horizontal splits (--location=hsplit) or tabs (--type=tab --tab-title <worker-name>) only if requested or if screen space is constrained.
Step-by-Step Workflow
Step 1: Ensure Project Workspace Exists
Check active workspaces:
herdr workspace list
If no workspace corresponds to your project directory ("$PWD"), create one:
herdr workspace create --cwd "$PWD" --label "<project-name>" --no-focus
Parse the workspace_id (e.g. w1) from .result.workspace.workspace_id.
Step 2: Create a Dedicated Tab/Pane for the Worker
Create a new tab in the project's workspace:
herdr tab create --workspace <workspace-id> --cwd "$PWD" --label "<worker-name>" --no-focus
Extract the pane_id from .result.root_pane.pane_id in the JSON response (e.g. w1:p2). Verify that .result.root_pane.cwd matches your project path.
Step 3: Start the Agent in the Pane
Start the worker agent in the newly created pane:
herdr agent start <worker-name> --kind <kind> --pane <pane-id> -- <agent-args...>
- Supported
--kindvalues include:claude,codex,copilot,opencode,agy,pi,gemini,cursor,amp,cline,omp,devin, etc. - Pass flags specific to the agent after
--(e.g.--dangerously-skip-permissionsor--model ...). herdr agent startblocks until Herdr detects that the interactive agent has booted and reached an idle, ready prompt.
Step 4: Open a Visual View in Kitty
Attach a Kitty split to view the agent:
kitty @ launch --type=window --location=vsplit --copy-env --cwd="$PWD" herdr agent attach <worker-name>
For a horizontal split, use --location=hsplit. For a new tab, use --type=tab --tab-title <worker-name>.
Step 5: Coordinate, Prompt, and Monitor
Submit instructions to the worker:
herdr agent prompt <worker-name> "<instruction-text>" --wait
--wait: Waits until the agent returns to an idle, done, or blocked state.- Inspect overall fleet status at any time:
herdr agent list
Step 6: Handling Blocked Agents and Approvals
When herdr agent list reports an agent status as blocked:
- Inspect the terminal screen to understand what the agent is asking:
herdr agent read <worker-name> --source visible - Caution with Claude Code: Claude Code's inline autosuggestions (ghost text in the input box) can occasionally cause Herdr's detector to report
blockedwhen the agent is actually idle. Always confirm withherdr agent readbefore attempting to answer a prompt. - Send necessary confirmation or keys:
herdr agent send-keys <worker-name> y herdr agent send-keys <worker-name> enter
Step 7: Teardown and Cleanup
When a worker completes its assigned task and is no longer needed:
- Close its Herdr pane on the server:
herdr pane close <pane-id> - The associated Kitty split or window will terminate automatically once the attached process exits.
Quick Reference CLI Commands
| Action | Command |
|---|---|
| List Workspaces | herdr workspace list |
| Create Workspace | herdr workspace create --cwd "$PWD" --label <name> --no-focus |
| Create Tab / Pane | herdr tab create --workspace <ws> --cwd "$PWD" --label <name> --no-focus |
| Start Agent | herdr agent start <name> --kind <kind> --pane <pane-id> -- <args> |
| Attach View in Kitty | kitty @ launch --type=window --location=vsplit --copy-env --cwd="$PWD" herdr agent attach <name> |
| Prompt Agent | herdr agent prompt <name> "<prompt>" --wait |
| Check Fleet Status | herdr agent list |
| Read Agent Output | herdr agent read <name> --source visible (or --source recent-unwrapped) |
| Send Keys to Agent | herdr agent send-keys <name> <key> |
| Close Pane | herdr pane close <pane-id> |