Features
Everything you need for efficient AI-assisted coding in the terminal.
Cache-First Loop
Whale's context layout treats DeepSeek's prefix-cache as a first-class citizen. The system prompt, tool specs, and skills form an immutable prefix that stays stable across turns. Conversation history appends in append-only mode. This means long sessions keep benefiting from cached prefixes — delivering ~90% cache hit rates in practice.
┌─────────────────────────────────────┐
│ Immutable prefix │ ← fixed across turns
│ system + tool specs + skills │ cache target
├─────────────────────────────────────┤
│ Append-only dialog log │ ← appended each turn
│ [user][assistant][tool][user]... │ keeps prefix stable
├─────────────────────────────────────┤
│ Scratch area │ ← reset each turn
│ reasoning / intermediate results │ no downstream reuse
└─────────────────────────────────────┘ Tool-Call Repair
DeepSeek's tool-call output can include malformed JSON, escaped content, or missing parameters. Whale includes a dedicated repair layer that handles these edge cases.
Scavenge
Recovers tool-calls from reasoning content when the model emits them outside the tool block.
Flatten
Automatically flattens deep schemas to prevent parameter drops.
Recovery
Handles JSON truncation, stringified arrays, null fields, and callback storms.
TUI & Slash Commands
Whale's terminal UI is built with Bubble Tea in Go. Every interaction stays inside your terminal.
| Command | Purpose |
|---|---|
| whale | Start the interactive TUI |
| whale exec "prompt" | Run a one-shot prompt non-interactively |
| whale setup | Save a DeepSeek API key |
| whale doctor | Run health checks |
| whale resume | Reopen a previous session |
| /ask | Read-only question mode |
| /plan | Plan first, decide whether to execute |
| /review | Code review for local changes, branches, PRs |
| /compact | Compact the current conversation context |
| /focus | Toggle focused view (hide thinking/tool details) |
MCP & Skills
Extend Whale's capabilities without modifying the core toolset.
MCP Support
Load external tools from MCP servers. Whale connects to standard MCP servers to add custom tooling for databases, APIs, cloud services, and more.
Agent Skills
Reusable workflows for team conventions, code review, testing, or tool-specific guidance.
Type $skill-name in the TUI to invoke a skill.
Dynamic Workflows
Whale's Dynamic Workflows let you orchestrate multiple AI agents using JavaScript scripts — enabling fan-out research, multi-perspective reviews, pipeline processing, and adversarial validation, all from your terminal.
Workflow scripts are simple JavaScript files that use agent(), parallel(), and pipeline() primitives to coordinate agents. Each agent gets its own context, tools, and model access — results are merged back into the conversation.
const results = await parallel([
() => agent("Search for best practices in Go error handling"),
() => agent("Find common Go error handling mistakes"),
]);
return agent("Synthesize both findings into a concise guide"); Fan-out Research
Launch multiple research agents in parallel, each exploring a different angle, then synthesize the results.
Multi-Perspective Review
Have agents review code from different viewpoints — security, performance, idiomatic style — then aggregate findings.
Pipeline Processing
Chain agents in sequence: plan → implement → review → decide. Each step passes its output to the next.
Adversarial Validation
One agent generates claims or code, another tries to find flaws. Iterate until both agree.
Isolated Worktrees
Use whale --worktree <name> to create an isolated git worktree
for each feature or bug fix. Changes stay in their own branch, and Whale cleans up after you.
whale --worktree feature-x
whale exec --worktree feature-x "implement and test this change"