Skip to content

Claude Code Integration

aiTerm exposes an MCP server that Claude Code CLI discovers and connects to automatically, providing IDE-like capabilities without requiring a full IDE.

How It Works

Claude Code CLI ←→ WebSocket/SSE ←→ axum server (Rust) ←→ Tauri events ←→ Frontend (Svelte)

The MCP server starts automatically when aiTerm launches (configurable in preferences). It writes a lock file to ~/.claude/ide/ and registers in ~/.claude.json for automatic discovery by Claude Code.

Available Tools

ToolDescription
getOpenEditorsList open editor tabs (path, language, dirty state)
getWorkspaceFoldersWorkspace root paths
getDiagnosticsLanguage diagnostics for a file
checkDocumentDirtyCheck if file has unsaved changes
saveDocumentSave file to disk
getCurrentSelectionActive editor selection + cursor
getLatestSelectionMost recent selection in any tab
openFileOpen file in editor tab (with optional line/text selection)
openDiffShow side-by-side diff for review (blocking)
closeAllDiffTabsClose all pending diff tabs

Claude Code Triggers

aiTerm ships with 6+ built-in triggers designed for Claude Code workflows:

  • Auto-capture session IDs — detects Claude’s resume commands and session UUIDs
  • Auto-resume — automatically reconnects to your last Claude session when you open a tab
  • Question detection — notifies when Claude asks “Do you want to proceed?”
  • Plan ready — alerts when Claude has a plan ready for review
  • Context compaction — notifies during and after context compaction
  • Tab state awareness — know at a glance which tabs have Claude waiting for input

Dev/Production Isolation

Dev builds register as aiterm-dev with display name “aiTermDev”, so development and production instances don’t interfere with each other.