LoopCode is an autonomous software engineering orchestrator built on top of OpenCode. It acts as the planning, state machine, knowledge, and verification layer that guides OpenCode through executing complex, multi-task software goals.
Disclaimer: This project is not affiliated with, sponsored by, or endorsed by the OpenCode/Anomaly team.
- Shared Memory Engine: All multi-agent communication is centralized through a unified SQLite persistence layer (
SCHEMA_SQLembedded source of truth). Agents pass structured contracts asynchronously without direct coupling. - Semantic Knowledge & Code Graph: Fast local semantic embeddings using
fastembedandsqlite-vec. Incremental codebase indexing parses classes, functions, and variables viatree-sitter, augmented by an LSP client. - Parallel Task Scheduling: Decomposes natural language goals into a Directed Acyclic Graph (DAG) of tasks. The
GitWorktreeSchedulerperforms topological sorting based on filewriteAllowlistpermissions and runs independent batches concurrently in isolated Git worktrees. - 5-Layer Verification Engine: Validates task correctness via Compilation, Lint & Style, Unit Testing, Security Scanning (
semgrep/trivywith regex fallbacks), and LLM Review Agent. Distinctskippedstatus reported when scripts are missing. - Failure Evidence Re-planning: If a task exhausts its execution retries, compilation errors, test failures, and reviewer notes are injected back into the Planner Agent to self-correct the task DAG.
- Cost & Budget Limits: Enforces Monthly ➔ Goal ➔ Task spend caps. If breached, the system raises a notice (or opt-in gated rollback) and terminates with exit code 77.
- Loop/Oscillation Prevention: Hashes state signatures (phase, task index, modified files, retry attempts) to detect infinite loops and prompts the user or event bus for resolution.
- Catalog-Aware Model Router: Maps tasks to optimal models based on capability requirements, catalog availability, budget caps, and caching adjustments.
1. Standalone Binary Installer (Recommended)
curl -fsSL https://raw.githubusercontent.com/arjun-vegeta/loopCode/main/install.sh | bash2. Local Development Build
bun install
bun run build
bun run package # Compiles standalone binary via bun buildDecompose a natural language goal, plan, execute, and verify:
bun run src/index.ts "Add a new endpoint for user profile retrieval"-d, --db <path>: Path to the SQLite database (default:loopcode.db).-r, --resume <sessionIdOrTaskId>: Session ID or Task ID to resume.--login: Start in-TUI provider authentication workflow.--headless: Run in non-interactive CI mode.
| Code | Meaning |
|---|---|
0 |
Goal completed successfully |
1 |
Fatal error |
77 |
Budget limit exceeded |
130 |
Execution interrupted |
LoopCode checks for overrides in ~/.loopcode/config.toml:
[model]
default = "anthropic/claude-sonnet-4-6"
planning = "anthropic/claude-opus-4-6"
execution = "anthropic/claude-sonnet-4-6"
verification = "anthropic/claude-sonnet-4-6"
[budget]
maxMonthlyCostUsd = 100.0
maxGoalCostUsd = 10.0
maxTaskCostUsd = 2.0
[proxy]
enabled = false
kind = "antigravity"
port = 8080
autoStart = true
providerId = "antigravity"
[ui]
theme = "auto"
ascii = false
[safety]
permissionMode = "acceptEdits"
allowDestructiveRollback = false
maxParallelAgents = 5Run full verification suite (typecheck, lint, formatting, and unit tests):
bun run typecheck
bun run lint
bun run format:check
bun run testThis project is licensed under the MIT License - see the LICENSE file for details.