Loop: Run Persistent Claude Code Agents in Docker for Continuous Tasks

Loop: Run Persistent Claude Code Agents in Docker for Continuous Tasks

Loop lets you deploy Claude Code agents as Docker containers that run scheduled tasks, manage memory, and integrate with Slack/Discord alongside the desktop app.

6h ago·3 min read·5 views·via hn_claude_code
Share:

Loop: Run Persistent Claude Code Agents in Docker for Continuous Tasks

What It Does

Loop is an opinionated development environment that packages Claude Code agents into Docker containers with persistent memory, scheduling capabilities, and multi-platform interfaces. Unlike running claude code commands manually in your terminal, Loop creates managed agents that can handle recurring tasks, maintain conversation history across sessions, and operate through desktop, Slack, or Discord interfaces simultaneously.

The core architecture separates orchestration from execution: an Orchestrator manages messages and sessions, while a DockerRunner creates containers that run claude --print with mounted project directories. This preserves your local file paths inside the container, so agents can work on your actual codebase.

Setup

Installation is straightforward:

# macOS with Homebrew (CLI only)
brew install radutopala/tap/loop

# Or download the desktop app from Releases
# Then initialize configuration
loop onboard:global

Edit ~/.loop/config.json to enable platforms and add credentials:

{
  "platforms": ["local"],
  "anthropic_api_key": "sk-ant-..."
}

You can use either an Anthropic API key (pay-per-token) or a Claude Code OAuth token from your Pro/Max subscription. The desktop app provides an IDE-like interface with chat, terminal, file editor, and diff viewer.

When To Use It

Loop shines for three specific Claude Code workflows:

  1. Scheduled Maintenance Tasks – Use the built-in scheduler to run agents on cron intervals. Example: daily dependency updates, weekly code quality scans, or hourly log analysis.

  2. Team Collaboration Bots – Connect Loop to Slack or Discord so team members can @mention Claude agents for code reviews, debugging help, or documentation generation without leaving their chat platform.

  3. Long-Running Projects with Memory – Loop's SQLite database with Ollama embeddings gives agents persistent memory across sessions. This is ideal for multi-day refactoring projects where the agent needs to remember previous decisions and context.

The MCP (Model Context Protocol) server inside containers provides tools for scheduling, listing, and canceling tasks directly from Claude's interface. This creates a feedback loop where Claude can manage its own execution schedule.

Key Configuration Notes

  • Loop runs on macOS or Linux with Docker Desktop (macOS) or Docker Engine (Linux)
  • The daemon manages via launchd on macOS or systemd user services on Linux
  • You can run multiple platforms simultaneously: ["local", "discord", "slack"]
  • Project directories are mounted at their original paths inside containers, maintaining your local development environment
  • Memory indexing uses Ollama for embedding generation and semantic search

This approach transforms Claude Code from a command-line tool you invoke manually into a persistent development assistant that can work autonomously on your schedule.

AI Analysis

Loop fundamentally changes how you should think about Claude Code deployment. Instead of treating it as a terminal command, you can now deploy Claude agents as infrastructure. First, consider moving repetitive coding tasks to scheduled Loop agents. If you run `claude code` daily for similar tasks (dependency updates, test generation, documentation), configure a Loop agent with a cron schedule. The agent will run autonomously and maintain context between executions via the SQLite memory store. Second, use the desktop app as your primary Claude Code interface instead of the terminal. The integrated file editor, terminal, and diff viewer create a more cohesive experience than switching between your IDE and command line. The app auto-updates, so you'll always have the latest Loop features. Third, explore the MCP tool integration. Inside Loop containers, Claude has access to scheduling tools via the `loop` and `loop-browser` MCP servers. This means you can prompt Claude to "schedule a daily code review at 9 AM" or "check for security vulnerabilities every Monday," and it will configure itself through the API.
Original sourcegithub.com

Trending Now

More in Products & Launches

Browse more AI articles