This project is currently under active development. The CLI tool isn't fully functional yet — I'm actively building it out.
⭐ Star the repo to follow along, and check back soon for updates!
The open-source AI-assisted coding tool for your terminal.
Loophole is a Go-powered terminal UI that transforms your command line into an intelligent development environment. It connects to leading AI models and provides them with powerful tools to read, analyze, and modify your codebase — all from an elegant TUI built with Bubble Tea.
Key capabilities:
- Chat with AI models that can see and edit your files
- Execute bash commands through AI suggestions
- Apply complex code refactors automatically
- Get real-time LSP diagnostics and code intelligence
- Manage multiple conversation sessions with full context
- Use Model Context Protocol (MCP) servers for extensibility
Multi-Model Support - Switch between Claude, GPT, Gemini, or any OpenAI-compatible endpoint. Use different models for different tasks within the same session.
Intelligent File Operations - Glob patterns to find files matching complex patterns, smart grep to search across your codebase with regex, atomic edits to apply precise diffs and patches, and batch operations to modify multiple files in one go.
Development Tools - Real-time diagnostics and code intelligence via Language Server Protocol, command execution to run bash commands directly from chat, MCP support to extend with Model Context Protocol servers, and version control awareness that understands your git context.
Productivity Features - Session management to switch between multiple conversations (Ctrl+S), custom commands to create reusable prompt templates (Ctrl+K), auto-compaction for intelligent context window management, SQLite persistence for full local history storage, and an interactive sidebar to visualize file changes in real-time.
| Provider | Models |
|---|---|
| Anthropic (Claude) | claude-3.7-sonnet (recommended for coding), claude-3.5-sonnet, claude-4.6-opus |
| OpenAI | o3-ultra, gpt-5.3-codex, gpt-4o |
gemini-3-deep-think, gemini-2.0-flash, gemini-1.5-pro |
|
| DeepSeek | deepseek-v3, deepseek-r1 |
- Go 1.21 or higher (only required when building from source)
npm install -g @loophole-ai/loophole-clicurl -fsSL https://raw.githubusercontent.com/loophole-ai/loophole-cli/main/install | bash# Clone the repository
git clone https://github.com/loophole-ai/loophole-cli.git
cd loophole-cli
# Install dependencies
go mod download
# Build
go build -o loophole
# Run tests
go test ./...
# Install globally
sudo mv loophole /usr/local/bin/- Set your API key(s):
export ANTHROPIC_API_KEY="your-key-here"
# or OPENAI_API_KEY, GEMINI_API_KEY- Create a
.loophole.jsonconfig file (optional):
{
"agents": {
"coder": {
"model": "claude-3.7-sonnet",
"maxTokens": 8192
}
},
"autoCompact": true
}- Launch Loophole:
loophole- Start a conversation - Launch
loopholeand ask a question - Let AI explore - Loophole can read files, search your codebase, and understand context
- Review changes - See proposed file modifications in the sidebar
- Apply or reject - Accept changes you want, skip the rest
| Shortcut | Action |
|---|---|
Ctrl+C |
Quit application |
Ctrl+? |
Toggle help dialog |
? |
Toggle help dialog (when not in editing mode) |
Ctrl+L |
View logs |
Ctrl+S |
Switch session |
Ctrl+K |
Command dialog |
Ctrl+O |
Toggle model selection dialog |
Ctrl+P |
Toggle provider selection (API key configuration) |
Esc |
Close current overlay/dialog or return to previous mode |
| Shortcut | Action |
|---|---|
Ctrl+N |
Create new session |
Ctrl+X |
Cancel current operation/generation |
i |
Focus editor (when not in writing mode) |
Esc |
Exit writing mode and focus messages |
| Shortcut | Action |
|---|---|
Ctrl+S |
Send message (when editor is focused) |
Enter or Ctrl+S |
Send message (when editor is not focused) |
Ctrl+E |
Open external editor |
Esc |
Blur editor and focus messages |
| Shortcut | Action |
|---|---|
↑ or k |
Previous session |
↓ or j |
Next session |
Enter |
Select session |
Esc |
Close dialog |
| Shortcut | Action |
|---|---|
↑ or k |
Move up |
↓ or j |
Move down |
← or h |
Previous provider (within model dialog) |
→ or l |
Next provider (within model dialog) |
Esc |
Close dialog |
| Shortcut | Action |
|---|---|
↑ / ↓ |
Move up/down |
Enter |
Select provider |
Esc |
Close dialog |
Enter |
Save API key (input) |
| Shortcut | Action |
|---|---|
← or left |
Switch options left |
→ or right or tab |
Switch options right |
Enter or space |
Confirm selection |
a |
Allow permission |
A |
Allow permission for session |
d |
Deny permission |
| Shortcut | Action |
|---|---|
Backspace or q |
Return to chat page |
Place .loophole.json in your home directory (~/.loophole.json) or project root:
{
"agents": {
"coder": {
"model": "claude-3.7-sonnet",
"maxTokens": 8192,
"temperature": 0.7
},
"summarizer": {
"model": "gpt-4o-mini",
"maxTokens": 2048
}
},
"autoCompact": true,
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
}
}
}| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY |
Claude API access |
OPENAI_API_KEY |
GPT-4 API access |
GEMINI_API_KEY |
Gemini API access |
LOOPHOLE_DEBUG=true |
Enable debug logging |
LOOPHOLE_CONFIG=/path/to/.loophole.json |
Custom config location |
Comprehensive documentation is available in the docs/ directory:
Loophole won't start
- Check your API keys are set
- Verify Go 1.21+ is installed
- Try
loophole --debugfor detailed logs
AI can't see my files
- Ensure you're running Loophole from your project directory
- Check file permissions
- Verify paths in error messages
Context window errors
- Enable
autoCompactin config - Start a new session for fresh context
- Use more concise prompts
We welcome contributions from the community.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Introduction - Overview and core concepts
- Getting Started - Installation and first steps
- Configuration - Full configuration reference
- Architecture - Technical overview
- Troubleshooting - Common issues and fixes
Loophole builds on the excellent work of many open-source projects:
- Bubble Tea - Excellent TUI framework
- Lip Gloss - Style definitions for TUI
- Go-GitHub - GitHub API client
- Sqlite3 - Local persistence
Loophole is licensed under the MIT License. See LICENSE for the full license text.
This project is a rebranded fork of the upstream blu-code project. See NOTICE.md for attribution details.
Garv Agnihotri — Open Source • AI-Powered Terminal Coding


