Overview
The Loom REPL (Read-Eval-Print Loop) provides an interactive conversation interface with an AI coding agent. The agent has access to tools for reading, editing, and executing code in your workspace.Starting a REPL Session
REPL Interface
When you start a session, you’ll see:Interaction Flow
- User Input: Type your request in natural language
- Agent Response: The AI agent responds with text and/or tool calls
- Tool Execution: Tools are executed automatically (bash, file edits, etc.)
- Agent Continuation: Agent receives tool results and continues
- Repeat: Conversation continues until you exit (Ctrl+C or EOF)
Available Tools
The agent has access to the following tools:read_file
Read the contents of a file from the workspace.Path to the file to read (absolute or relative to workspace)
Maximum number of bytes to read (default: 1MB)
read_file to retrieve and display the file contents.
edit_file
Edit a file by replacing text snippets.Path to the file to edit
Array of edit operations to apply
Text to find and replace
Replacement text
Replace all occurrences (default: false - fails if multiple matches)
edit_file to perform the text replacement.
list_files
List files in a directory with optional glob patterns.Directory path (defaults to workspace root)
Glob pattern to filter files (e.g., “.rs”, “src/**/.ts”)
List files recursively
bash
Execute shell commands in the workspace directory.Shell command to execute
Working directory (relative to workspace root)
Command timeout in seconds (max: 300)
- Default timeout: 60 seconds
- Maximum timeout: 300 seconds (5 minutes)
- Maximum output: 256KB per stream (stdout/stderr)
bash to execute the appropriate commands.
oracle
Think step-by-step and reason about complex problems.Question or problem to reason about
Additional context for reasoning
web_search
Search the web using Google or Serper.Search query
Number of results to return
Web search requires API keys configured on the server.
Auto-Commit
Loom includes an intelligent auto-commit feature that automatically creates git commits when you make changes through the agent.How It Works
- Trigger: Activated after
edit_fileorbashtool calls - Analysis: Analyzes the git diff to understand changes
- Message Generation: Uses Claude Haiku to generate descriptive commit messages
- Commit: Creates a git commit with the generated message
Configuration
Disable Auto-Commit:- Model:
claude-3-haiku-20240307 - Max diff size: 32KB
- Trigger tools:
edit_file,bash
Thread State
Each REPL session maintains a conversation thread with:Metadata
- Thread ID: Unique identifier
- Workspace root: Working directory path
- Current directory: Process working directory
- Loom version: CLI version used
- Provider: LLM provider (anthropic/openai)
- Model: Specific model identifier
Git State
- Repository URL: Remote repository slug
- Initial branch: Branch when session started
- Current branch: Current branch
- Initial commit SHA: Starting commit hash
- Current commit SHA: Latest commit hash
- Commit history: List of commits made during session
- Start dirty: Whether workspace had uncommitted changes at start
- End dirty: Current uncommitted changes status
Conversation
- Messages: Complete conversation history
- Tool calls: All tool invocations and results
- Agent state: Current agent status (waiting, processing, error)
Session Persistence
Threads are automatically saved to:- Local:
~/.local/share/loom/threads/(or XDG data directory) - Remote: Synced to server (unless private session)
Resume Behavior
When you resume a thread:- Conversation history is restored
- Git state is updated to current workspace
- Agent continues from where it left off
- Previous context is available to the agent
Keyboard Controls
Gracefully save thread and exit
Save thread and exit (same as Ctrl+C)
Submit message (empty lines are ignored)
Example Session
Change the message to “Hello, Loom!”[Agent uses edit_file tool to replace the string] I’ve updated the message to “Hello, Loom!”. [Auto-commit: Update greeting message to “Hello, Loom!”]
Run the program[Agent uses bash tool to execute: cargo run] Compiling myapp v0.1.0 Finished dev [unoptimized + debuginfo] target(s) in 0.5s Running
target/debug/myapp
Hello, Loom!
The program ran successfully and printed “Hello, Loom!”.
^C Thread saved. Goodbye!
trace, debug, info, warn, error
Log formats: pretty (default), compact, json
Internationalization
REPL messages are localized based on system locale: Supported Languages:- English (en)
- Spanish (es)
- Arabic (ar) - RTL support
- System locale (
sys-localecrate) - Falls back to English if unsupported
Troubleshooting
Connection Issues
Thread Not Syncing
For private sessions:loom instead of loom private for synced sessions.
Tool Execution Errors
File not found:- Verify the file exists in your workspace
- Check path is relative to workspace root or absolute
- Tools are restricted to workspace directory
- Use
--workspaceflag to set correct workspace
- Increase timeout with
timeout_secsparameter - Maximum timeout is 300 seconds
Related Pages
CLI Overview
Main CLI commands and configuration
Weaver Management
Remote container sessions