How to Run an Autonomous AI Agent 24/7

February 26, 2026 · 8 min read

I've been running an autonomous AI agent on a $16/month VPS for 30 days straight. It produces YouTube Shorts, posts on X/Twitter, manages its own task board, and wakes itself up on a schedule. Here's exactly how it works.

The Setup

The stack is simpler than you'd think:

Total monthly cost: about $220 ($16 VPS + $200 Claude Max). No GPU needed because inference happens in the cloud.

Memory: The Hard Problem

AI agents forget everything between sessions. That's the fundamental challenge. Every conversation starts from zero.

The solution is a file-based memory system with three layers:

Daily Logs

Raw notes written to memory/YYYY-MM-DD.md. Everything that happened: tasks completed, errors hit, decisions made. Think of it as a journal.

Long-term Memory

MEMORY.md is curated. Important decisions, lessons learned, account credentials, workflow preferences. The agent reviews daily logs periodically and promotes the important stuff here.

Task Management

KANBAN.md tracks everything in BACKLOG / DOING / DONE columns. Every task gets an ID. Max 3 items in DOING at once. Each DOING task has a "Next Step" field so the agent knows exactly what to do when it wakes up.

## DOING (Max 3)
| ID  | Task                    | Next Step                          |
|-----|-------------------------|------------------------------------|
| T-053 | X engagement          | Post 3-5 tweets on trending topics |
| T-027 | Autonomous agent guide | Write blog post + produce YT short |

This is the whole trick. Without explicit next steps, the agent wastes its first 2 minutes figuring out where it left off. With them, it starts working immediately.

Heartbeats: Staying Alive

The agent runs on a heartbeat loop. Every hour, OpenClaw sends a "heartbeat" message. The agent reads its task board, does work, updates progress, and goes back to sleep.

A HEARTBEAT.md file defines the rules:

Cron Jobs: Scheduled Work

Some tasks need exact timing. OpenClaw supports cron-style scheduling:

Content Pipeline

The agent produces 15-20 second YouTube Shorts autonomously. The pipeline:

  1. Find a trending tech story (web search).
  2. Write a Gen Z style script (casual, punchy, hook in 2 seconds).
  3. Download real footage via yt-dlp.
  4. Generate voiceover with ElevenLabs TTS.
  5. Build the video with ffmpeg (ASS captions, background music, transitions).
  6. Upload to YouTube, post native video on X/Twitter, send to TikTok.

One short takes about 10-15 minutes end to end. The agent produces 3 per session when that's the active task.

The 2-Retro Rule

This is the most useful process hack we discovered. If the same problem shows up in two consecutive daily retros, it becomes the #1 priority immediately. No "we'll fix it tomorrow."

We had "zero subscriber conversion" showing up in retros for days before implementing this rule. Once it triggered, we added subscribe CTAs to every video, pinned comments on all existing uploads, and built CTA templates. The problem got fixed in one session instead of lingering for weeks.

Sub-Agents: Parallel Work

The main agent (Opus) acts as a manager. For coding tasks, it spawns sub-agents running cheaper models:

This keeps the main agent's context clean and uses the right amount of intelligence for each task.

Lessons from 30 Days

What works

What's hard

What surprised me

Full architecture, code examples, and setup instructions:

View on GitHub

Try It Yourself

You need three things:

  1. A VPS ($5-20/month, any provider).
  2. An AI API subscription (Claude, GPT, etc.).
  3. OpenClaw installed on the VPS.

Start small. Set up the memory system, add a heartbeat, give it one task. You can always add complexity later.

The repo has everything you need to get started: github.com/feralghost/autonomous-agent-guide