Skip to content
AI AGENT HARNESS · NODE 24 · TYPESCRIPT

An open-source agent harness that respects your prompt cache.

Keep top-level tools small, call MCP servers from a lightweight Node 24 TypeScript sandbox instead of dumping huge JSON Schemas, and run parallel git-worktree agents right inside your terminal.

Node 24+
npm install -g @irorange27/iki && iki
iKi CLI (anthropic) — claude-sonnet-4-6
thread: thr_8a2f (0 msgs)
[Context] AGENTS.md (94 lines) · PERSONA.md (312 chars)
[Tools] 3 builtin (bash, job, ptc) · MCP: zotero (35 tools, code mode)
›Ask iKi or type / for commands…
~/papers/agent-harness (main)claude-sonnet-4-6
turn:0/step:0·0in/0c·mcp:35t
01

Built to Keep Prompt Caches Warm

The system prompt and the 3 built-in tools (bash/pwsh, job, ptc) stay fixed across turns. When workspace state, skills, or MCP servers change, iKi appends a short note to the latest turn instead of editing earlier history.

Read about context & caching
AreaTypical Setup iKi
MCP Context CostFull JSON Schema sent on every turnCompact index + on-demand types (e.g. Zotero 35 tools: 29 KB → ~360 chars)
Calling Multiple ToolsOne round-trip per call; noisy outputs pile upPromise.all in the sandbox, filtered locally in 1 turn
Prompt Cache HitsDynamic timestamps or changing tools bust the cacheFixed system prompt & tools; changes append forward
Parallel ProgressWait blindly or juggle tmux panes by handgit worktree isolation + live status bar and log viewer
01 · SUMMARY

Compact signatures for small servers, tool names for large ones—never repeated unless something changes.

02 · ON-DEMAND TYPES

Call mcp.describe() when a server is actually needed to get clean TypeScript declarations instead of verbose JSON Schema.

03 · SANDBOX

Run TypeScript inside an isolated Node 24 VM to batch calls and return only the cleaned result.

02

Lightweight MCP & Independent Code Sandbox

MCP integration and the TypeScript sandbox (PTC) are distinct capabilities that compose cleanly. Connecting a 35-tool server like Zotero MCP (~29 KB raw JSON Schema) adds only a ~360-char summary in Code Mode, with on-demand TypeScript types and batched execution in Node 24—or switch to Direct Mode anytime.

03

Parallel Agents & Background Jobs

Split larger tasks across parallel workers in isolated git worktrees, using a stronger coordinator and faster workers. A live status strip shows what every worker and background command is doing so you are never waiting in the dark.

Read Swarm & Jobs docs
workspace: "share" (git worktree)
Each coding worker gets its own branch and working directory while sharing .git objects.
parallel edits
Live Worker & Board View
Inspect any worker stream or the shared message board without leaving the terminal.
/swarm watch
Auto-Background Long Commands
Slow builds and test runs move to the background on timeout with live logs and instant kill.
/jobs

A Layered Modular Architecture

Click any package to see what it owns and what it can depend on—checked automatically with dependency-cruiser and knip.

App & Gateway Shells↓
Core Orchestration↓
Runtime & Storage↓
Base Types & Config↓
Selected Package

@iki/harness

Core orchestration: session management, turn preparation, MCP Code Mode manager, git-worktree Swarm coordinator, and tool wiring.

Internal Dependencies
checked by dependency-cruiser & knip

Released under AGPL-3.0-only.