Phase 07 · AI-Assisted Engineering with Claude CodeLesson 4 of 4
Running Claude Code on the Cloud
Keep an agent working around the clock on a remote machine.
The problem
Running a coding agent on your laptop works well for interactive sessions. But some jobs are long (migrating a large codebase, processing hundreds of files, running overnight tasks), and some should run on a schedule. Running the agent on a cloud machine lets that work continue even when your laptop is closed.
The concept
Deep dive: 1h 11m video. You don’t need it all in one sitting. Use the chapter list under the video to jump straight to the part you need.
Jump to a chapter 21 chapters
- 0:00:00Intro: Run Claude Code 24/7 Like a Hired Intern
- 0:01:12The Problem: Why Claude Code Keeps Dying
- 0:05:05Laptop vs Cloud: The Core Difference
- 0:06:20VPS Setup: Hostinger Walkthrough + 20% Discount
- 0:10:34Authorizing & Launching Claude Code on VPS
- 0:15:09Remote Control: Access Claude from Any Device
- 0:17:02Live Demo: Giving Claude Tasks from Your Phone
- 0:20:33Token Monitoring: Claude Monitor & Agent Flow Dashboard
- 0:29:50Web Access: Claude from Browser & Incognito
- 0:32:01Scenario Recap: Without VPS vs With VPS + Remote Control
- 0:35:16Live Build: Adding Features Remotely via Phone
- 0:37:00Cron Jobs: Scheduling Claude Commands Automatically
- 0:38:29The Memory Problem: Context Lost Between Sessions
- 0:39:32mem0: Persistent Memory Store for Claude Code
- 0:44:52Free mem0 Deal — $57 Off for 3 Months
- 0:49:12Full Mobile Control Demo: App Workflow from iPhone
- 0:54:48The Session Death Problem & Why You Need T-Mux
- 0:55:48T-Mux: Terminal Multiplexer for Bulletproof Sessions
- 1:00:00Live Build: Visitor Wall App with Socat Tunnel
- 1:05:25Running Multiple Parallel Claude Sessions
- 1:07:07Outro + Hostinger & mem0 Final Recommendations
Chapters from the video description on YouTube.
Why run agents in the cloud?#
- Long tasks keep going without your computer needing to stay on.
- Scheduled work: nightly reports, dependency updates, data clean-ups.
- Consistent environment: the same machine setup every run.
- Parallel work: several agents on separate tasks at once.
The basic setup#
- Create a cloud virtual machine (any major provider works) with a modest size to start.
- Install the tools: git, your language runtime and the agent CLI.
- Clone your repository onto the machine.
- Configure secrets as environment variables, never in files that get committed.
- Run the agent in a persistent session (for example with
tmux) so it survives disconnects.
The basic setup
- Create a cloud virtual machinemodest size to start
- Install the toolsgit, runtime, agent CLI
- Clone your repository
- Configure secretsas environment variables
- Run in a persistent sessionfor example
tmux
# start a session that keeps running after you disconnect
tmux new -s agent
# … start your agent task inside it …
# detach with Ctrl+B then D; reattach later with:
tmux attach -t agent
Security first#
A cloud agent works without you watching, so its permissions matter even more.
| Practice | Why |
|---|---|
| Secrets in environment variables or a secrets manager | Keeps keys out of code, logs and git history |
| A dedicated machine and account for the agent | Limits what's exposed if something goes wrong |
| Least-privilege access tokens | The agent can push to a branch, but not deploy to production |
| Work on a branch, review via pull request | A human approves before anything reaches the main codebase |
Supervise the output#
Autonomous does not mean unsupervised. Check logs regularly, review the pull requests the agent opens, and set clear limits: a maximum runtime, a maximum spend, and a rule to stop and report when it's stuck rather than guessing.
Try it
Your task · about 10 minutes
Write down which secrets your project uses and move every one of them into environment variables before you run an agent on a cloud machine.
Recap & next
Key takeaways
- Running agents on a cloud machine lets long tasks continue when your laptop is off.
- Keep secrets in environment variables, never in code or prompts.
- Limit what the agent can do on the server with scoped permissions.
- Check logs and results regularly; autonomous does not mean unsupervised.
Quick check
2 questions · instant feedback
Go deeper
The full course on Claude Code
Udemy course
Claude Ecosystem - AI, Code, Cowork, M365 & Certification
View course (opens Udemy in a new tab)
Finished this lesson?
Mark it complete to track your progress and keep your streak going.