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 ←→ Streamable HTTP ←→ 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.

SSH MCP Bridge

When you’re SSH’d into a remote server, aiTerm can bridge the MCP connection so Claude Code running remotely still has access to all IDE tools. A reverse SSH tunnel is set up automatically in the background — no manual port forwarding needed. The bridge status is shown in the tab bar with a bolt icon (green = connected).

Available Tools

Editor 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 — accept/reject)
showDiffView a git diff read-only (non-blocking)
closeAllDiffTabsClose all pending diff tabs

Workspace & Tab Navigation

ToolDescription
listWorkspacesList all workspaces with panes, tabs (IDs, display names, types, active state, notes)
switchTabNavigate to a tab by ID (auto-resolves workspace and pane)
getTabContextGet recent terminal output or editor content for tab discovery

Notes Management

ToolDescription
getTabNotesRead notes for a tab (defaults to active tab)
setTabNotesWrite or clear notes for a tab
listWorkspaceNotesList workspace-level notes (IDs, previews, timestamps)
readWorkspaceNoteRead full content of a workspace note
writeWorkspaceNoteCreate or update a workspace note
deleteWorkspaceNoteDelete a workspace note
moveNoteMove notes between tab and workspace (with conflict detection)
openNotesPanelOpen, close, or toggle the notes panel
setNotesScopeSwitch notes panel between tab and workspace views

Tab State & Preferences

ToolDescription
getActiveTabGet the currently active workspace, pane, and tab info
setTriggerVariableSet or clear a trigger variable for a tab
getTriggerVariablesRead all trigger variables for a tab
setAutoResumeEnable/disable auto-resume with optional command/cwd/ssh overrides
getAutoResumeGet current auto-resume configuration for a tab
getPreferencesRead aiTerm preferences
setPreferenceUpdate an aiTerm preference
findNotesSearch all tabs and workspaces for notes in one call
getDiagnosticsApp diagnostics — version, PTY stats, memory, WebGL state
readLogsTail the log file with level filter and search
getClaudeSessionsList all active Claude sessions across tabs with state, tool, and model info
listWindowsList all aiTerm windows with workspace summaries
createBackupCreate a state backup on demand
sendNotificationSend a toast or OS notification from Claude Code

Tab Context Discovery

The getTabContext tool lets Claude Code peek at what’s happening in your tabs — recent terminal output or editor file content. If you have fewer than 10 tabs, it automatically returns context for all of them, making it easy for Claude to find the right tab without you having to specify. For larger workspaces, you can pass specific tab IDs.

Claude Code Hooks

aiTerm integrates with Claude Code’s hook system for real-time session awareness — no regex triggers needed:

  • Session lifecycle — tracks session start, end, and compaction events
  • Active tool overlay — see what Claude is doing right now (editing files, running bash, etc.) in the terminal corner
  • Permission alerts — workspace sidebar shows an alert indicator when Claude needs permission approval
  • Auto-resume — automatically captures session IDs and reconnects on tab restore
  • Multi-agent awarenessgetClaudeSessions tool lets any Claude session discover all other active sessions across tabs for coordination
  • Compaction notifications — alerts during and after context compaction

File Drop & Image Paste

Drag files onto a terminal running Claude Code over SSH — aiTerm SCP uploads them to a temp directory on the remote and pastes the paths so Claude can read them as file references. On local terminals, file paths are pasted directly.

You can also paste images from your clipboard (Cmd+V) into a Claude Code session. aiTerm saves the image to a temp file and pastes the path, so Claude can view it directly — useful for sharing screenshots, diagrams, or error messages without leaving the terminal.

Dev/Production Isolation

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