Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

What Is Caliban?

Caliban is an AI agent harness: a CLI that drives one or more language models through a structured loop of prompts, tool calls, and responses while managing sessions, permissions, memory, and extensibility around that loop. It is provider-agnostic — the same harness works with Anthropic Claude (direct, Bedrock, Vertex), OpenAI (direct, Azure), Google Gemini (AI Studio, Vertex), and local Ollama, all through a common internal representation.

Capabilities at a glance

CapabilityWhat it gives youWhere to learn more
Interactive TUIFull-screen terminal UI with transcript, status bar, slash-menu, file picker, and permission modalsThe Interactive TUI
Headless / print modeOne-shot -p flag for scripting; stream-json protocol for machine-readable outputHeadless Basics
Persistent sessionsNamed sessions saved to disk; resume across invocations with --resume or --continueSessions & Persistence
PermissionsRule-based gate on every tool call; six modes from default to bypassPermissions; audit logPermissions Concepts
Built-in toolsRead, Write, Edit, MultiEdit, Glob, Grep, Bash, BashBg, WebFetch, WebSearch, NotebookEdit, TodoWrite, and moreBuilt-in Tools
MCP clientConnect external tool servers over stdio or HTTP; OAuth; per-server permission scopingMCP Servers
Sub-agentsIn-process agent calls, background agents via caliband, git-worktree isolationSub-agents
Memory tiersGlobal, project, and auto-memory via CLAUDE.md ancestry and @-importsMemory Tiers
Model routerDeclarative routes per purpose (MainLoop, Compaction, …); fallback chains; circuit breakersThe Model Router
Plugins, hooks & skillsBundle capabilities as plugins; hook lifecycle events; load skill files for slash commandsExtending Caliban

Provider-agnostic by design

Because Caliban normalizes all providers to a single internal IR, you can switch models or providers with a single flag (--provider, --model) or a caliban.toml router config, without changing your workflow.

The agent loop

At its core, Caliban runs a streaming agent loop:

flowchart LR
    U[User prompt] --> A[Agent loop]
    A --> M[Model — streams response]
    M -->|tool_use blocks| T[Tool dispatch]
    T -->|tool results| M
    M -->|stop| O[Response shown to user]

Each turn streams from the model as it arrives; tool calls are dispatched as they appear and their results fed back until the model produces a final text response. The loop runs identically in TUI, headless, and library contexts.