Coding Agent Execution ​
Prerequisite:
code_with_agentandcode_with_teamrequire at least one external coding CLI installed on your system:
- Claude Code CLI (
claude)- Codex CLI (
codex)Without one of these installed and on your
PATH, coding agent tools will fail.
code_with_agent and code_with_team run external CLIs via buildCodeAgentArgs() in src/code-agents/utils.ts.
Worker Commands ​
- Claude:
claude -p --verbose --output-format stream-json --dangerously-skip-permissions ... <task> - Codex:
codex exec --full-auto --json --color never ... <task> - Kimi:
kimi --yolo -p <task> ...
Execution Flow ​
- Tool schemas:
src/tools/definitions.ts(code_with_agent,code_with_team) - Orchestration:
src/code-agents/index.ts - Command construction:
src/code-agents/utils.ts
Normal tool calling (Read/Write/Bash/Browser) is separate from coding-agent CLI execution.
Validation & Package Manager Detection ​
When validate: true (default), both code_with_agent and code_with_team run a post-completion validation step. The validation command is auto-detected with monorepo awareness:
Resolution order ​
- Per-project override from config
codeAgents.validationCommands(keyed by project directory name) - Monorepo auto-detection — if the root
package.jsonhasworkspaces(orpnpm-workspace.yamlexists), scopes validation to only the changed packages:- Uses
git diffto find changed files - Maps files → package directories (finds nearest
package.json) - Runs scoped
yarn workspace <name> build/yarn workspace <name> testper package - Falls back to
yarn test-packages <path>if the root has atest-packagesscript and the package has notestscript
- Uses
- Simple project — runs
buildandtestscripts from rootpackage.jsonusing the detected package manager
Package manager detection (first match wins) ​
package.jsonpackageManagerfield (e.g."yarn@4.1.0")- Lockfile:
yarn.lock→ yarn,pnpm-lock.yaml→ pnpm,bun.lockb/bun.lock→ bun,package-lock.json→ npm - Fallback:
pnpm(SkimpyClaw default)
Implementation: detectPackageManager(), buildMonorepoValidationCommand(), and buildValidationCommand() in src/code-agents/executor.ts.
Team Orchestration — Git Worktree Isolation ​
When code_with_team runs parallel agents in the same wave, each agent gets its own git worktree so they can't overwrite each other's files. After the wave completes, branches are merged back sequentially.
Team Scratchpad (Automatic) ​
code_with_team now auto-integrates with scripts/team_scratchpad.py:
- Initializes a run at team start using run ID
team-<parent_agent_id> - Posts coordinator and worker lifecycle updates (start/progress/completion/failure)
- Includes blockers on failure states when available
- Automatically runs
summaryandrender-mdat team end
This integration is best-effort and non-blocking: scratchpad failures only log warnings.
Set SKIMPYCLAW_TEAM_SCRATCHPAD=0 to disable automatic scratchpad updates.
Flow ​
- Before each parallel wave:
git worktree addcreates.skimpyclaw-worktrees/<childId>on branchskimpyclaw-team/<childId> - Each child agent runs in its own worktree directory
- After wave: child commits are merged back into the main branch one at a time
- Merge conflicts are detected and reported (not silently lost)
- Worktrees are cleaned up after each wave and on error/cancel
Fallbacks ​
- Waves with only 1 child skip worktrees (no isolation needed)
- Non-git repos fall back to shared workdir
- Stale worktrees from crashed runs are cleaned up on next team start
Implementation: src/code-agents/worktree.ts and wave execution in src/code-agents/orchestrator.ts.
Exec Approval ​
src/exec-approval.ts classifies Bash commands before execution:
- Tier 0 — safe, auto-approved
- Tier 1 — low risk, auto-approved
- Tier 2 — medium risk (sudo, chmod 777, gh pr review), prompts user
- Tier 3 — catastrophic/irreversible (rm -rf, mkfs, dd, DROP TABLE), always requires approval
Pending approvals are held in an EventEmitter registry. The active channel sends the request; user replies inline to approve or deny.
Skills System ​
Skills are loaded from ~/.skimpyclaw/skills/<name>/SKILL.md. Each SKILL.md has YAML frontmatter:
---
name: my-skill
description: What this skill does
triggers: ["keyword1", "keyword2"]
priority: 100
---src/skills.ts scans the directory, loads valid skills, and injects relevant ones into the system prompt based on triggers and token budget (maxPromptTokens, default 4000 chars ≈ 1000 tokens).
Dashboard Architecture ​
The dashboard is framework-only (Preact/Vite).
| Concern | Location |
|---|---|
| Frontend source | web/dashboard/ |
| Built assets | dist/dashboard/ |
| Route | GET /dashboard via registerDashboard() in src/dashboard-frontend.ts |
| Backend API | src/api.ts — all endpoints under /api/dashboard/* |
| Auth | Bearer token from config.dashboard.token |
If dist/dashboard/index.html is missing, GET /dashboard returns 503 with a build hint.
Dashboard Tests ​
src/__tests__/dashboard.test.ts— framework route contract testssrc/__tests__/dashboard-mode.test.ts— framework static serving and safety checkssrc/__tests__/api.test.ts— backend API contract tests