Supported Editors
VS Code
Official support via ACP over stdio
Zed
Native ACP support (built-in)
Custom Clients
Any editor with ACP support
Agent Client Protocol (ACP)
ACP is a protocol for connecting AI agents to code editors. Loom implements ACP to provide a consistent interface across different editors.Architecture
Session
Session
An ACP session corresponds to a Loom thread (conversation). Sessions persist across editor restarts and maintain full conversation history.
Content Blocks
Content Blocks
User input is sent as ACP content blocks (text, images, etc.). Loom currently supports text blocks:
Streaming
Streaming
Assistant responses are streamed as content chunks for real-time display:
Tool Execution
Tool Execution
Tool calls are executed locally (not in the editor). The agent runs tools via Loom’s tool registry and streams results back.
Message Flow
VS Code (via ACP)
Connect Loom to VS Code using the ACP protocol over stdio.Setup
1
Install Loom CLI
2
Configure VS Code
Create a VS Code task to launch the ACP agent:Or configure in settings:
.vscode/tasks.json:3
Start Session
- Open the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run “ACP: Start Session”
- Select “Loom” from the agent list
- Start chatting in the ACP panel
Authentication
The ACP agent uses the same authentication as the CLI:Credentials are stored in
~/.loom/credentials.json and automatically used by the ACP agent.Available Commands
The ACP agent supports all Loom tools:read_file
Read file contents
write_file
Create or overwrite files
edit_file
Search and replace in files
list_files
List directory contents
search_files
Search code with regex
run_command
Execute shell commands
github_search
Search GitHub code
read_url
Fetch web pages
Implementation Details
Session Management
Sessions map 1:1 to Loom threads:Streaming Implementation
Loom streams LLM responses as ACP notifications:Type Conversions
All conversions between ACP and Loom types are pure functions:Custom ACP Clients
You can build custom ACP clients for any editor or environment:Protocol Overview
ACP uses JSON-RPC 2.0 over stdio:Supported Methods
- Session Management
- Messaging
- Configuration
Example Client (Python)
Debugging
Enable Debug Logs
Inspect Protocol Messages
Usetee to capture stdio traffic:
Common Issues
Agent Not Starting
Agent Not Starting
Symptom: Editor shows “Failed to start agent”Solutions:
- Check
loomis in PATH:which loom - Test manually:
loom acp - Check logs:
LOOM_LOG=debug loom acp
Authentication Errors
Authentication Errors
Symptom: “Unauthorized” or “Invalid API key”Solutions:
- Run
loom loginto authenticate - Check credentials:
cat ~/.loom/credentials.json - Set API keys:
export ANTHROPIC_API_KEY=...
Tools Not Working
Tools Not Working
Symptom: Tool calls fail or time outSolutions:
- Check file permissions for
read_file/write_file - Verify command exists for
run_command - Check network for
github_search/read_url
Best Practices
Persist Sessions
Sessions are automatically persisted to disk. You can resume conversations after restarting the editor.
Use Specific Models
Configure model per session based on task complexity. Use Claude Sonnet for coding, GPT-4 for general tasks.
Monitor Token Usage
Track token usage in notifications. Large codebases can consume significant context.
Graceful Shutdown
The agent handles SIGTERM/SIGINT gracefully, ensuring all threads are saved before exit.
Source Code Reference
- ACP Agent:
crates/loom-cli-acp/src/agent.rs - Type Bridge:
crates/loom-cli-acp/src/bridge.rs - Session Management:
crates/loom-cli-acp/src/session.rs - CLI Integration:
crates/loom-cli/src/main.rs
Agent Client Protocol specification: https://github.com/zed-industries/acp