← Reddit

How to run claude for hours? How can I configure a VPS-based HERMES agent using Claude CLI to run continuously (24/7) and autonomously improve my project without stopping after 10–20 minutes or requiring additional user prompts/permissions, so it keeps generating tasks, executing them, and iterating

Reddit · ALSamandar · July 23, 2026
A user seeks to configure a VPS-based HERMES agent with Claude CLI to run autonomously 24/7, generating and executing tasks to improve a project without user prompts. The current system halts after 10-20 minutes despite detailed project instructions being provided, and the goal is for it to continue iterating until manually stopped.

Detailed Analysis

The Reddit post captures a recurring friction point among developers building autonomous agent systems on top of Claude: the gap between what users want (a self-directing agent that runs indefinitely) and how Claude's CLI and API are actually architected (session-bounded, permission-gated, and designed to pause for human input at decision points). The poster describes a "HERMES agent" — a custom orchestration layer running on a VPS that issues instructions to Claude CLI — and complains that despite detailed upfront instructions and a stated project goal, Claude only sustains autonomous work for 10-20 minutes before stopping and requiring a new prompt. This is a common pattern for anyone trying to build a "set it and forget it" overnight coding agent.

The technical reality is that Claude CLI (and the underlying Claude Code product) is intentionally built around bounded task loops, context windows, and safety-oriented permission prompts for actions like file writes, shell commands, or destructive operations. These aren't bugs so much as deliberate guardrails: Anthropic designs Claude Code to checkpoint frequently, surface risky actions for approval, and terminate a turn when it reaches a natural stopping point or hits context/token limits, rather than looping indefinitely on its own initiative. A single CLI invocation is not designed to be a persistent daemon — it's a request/response tool, even when scripted. So when a user wants true 24/7 autonomy, they're really asking to build an orchestration system *around* Claude, not to change Claude's own behavior.

Achieving what the poster wants typically requires an external supervisor loop rather than trying to coax Claude itself into never stopping. Practical patterns people use include: running Claude Code in non-interactive/headless mode with `--dangerously-skip-permissions` or equivalent flags to bypass approval prompts (accepting the real security risk that implies on a VPS), wrapping invocations in a shell/cron/systemd loop that re-prompts Claude with the next task immediately after each completion, maintaining external state (a task queue, progress log, or scratch files) so each new invocation can pick up where the last left off despite context resets, and using a lightweight planner step where Claude itself generates the next task list at the end of each run, which the orchestrator then feeds back in as the next prompt. This "agentic loop" pattern — plan, execute, checkpoint, re-invoke — is essentially how most autonomous coding agent frameworks (AutoGPT-style systems, Devin, and custom setups like HERMES) work under the hood; the LLM never runs continuously, it's invoked repeatedly by scaffolding that simulates continuity.

This question also reflects a broader trend in AI development in 2025-2026: growing developer appetite for long-horizon, autonomous agents that operate with minimal supervision, running unattended overnight or across days, colliding with the safety-conscious, human-in-the-loop design philosophy that Anthropic and most frontier labs still favor. Anthropic has been extending Claude's usable context and improving Claude Code's autonomy (e.g., longer-running sessions, better self-checkpointing), but full unsupervised operation—especially with permission checks disabled on a VPS with real file-system and network access—remains something users have to engineer themselves, at their own risk, rather than a supported first-class mode. Threads like this on r/ClaudeAI illustrate the DIY ecosystem of wrapper agents, cron jobs, and prompt-engineering hacks that has grown up to bridge that gap, and they foreshadow likely future product direction: more native support for long-running, checkpointed, permission-scoped autonomous agents rather than users having to hand-roll orchestration layers themselves.

Read original article →