DEV Community

decker
decker

Posted on • Edited on

Running Claude Code on a Remote Server? Now You Can Actually See What It Did

Most of my actual work happens on remote machines. A beefy GPU instance for model fine-tuning, a cloud VM running 24/7 for long-running tasks, a staging server I SSH into when I need more RAM than my laptop has. If you do the same, you probably know the pain: AI coding tools like Claude Code or Gemini CLI work great once you get them running remotely — but managing those sessions is a mess.

You fire off a long Claude Code session on your EC2 instance, go get coffee, come back and... what did it actually do? Which files did it touch? Did it print an API key to stdout at some point? You have no idea unless you were watching the terminal the whole time.

Thats the gap Mantras Remote SSH feature fills.

The Problem With AI Coding on Remote Servers

When you run Claude Code or Gemini CLI locally, at least youre watching the screen. Remotely, its a different story:

  • No session replay. The terminal output scrolls past and its gone. You cant go back and review what the AI decided to do at step 7.
  • Sensitive data exposure. Remote servers often have production credentials, database tokens, API keys in environment variables. If those leak into AI session output — and they do — you might not catch it.
  • MCP services scattered everywhere. You set up MCP tools on your local machine but your remote VM has a different setup. Keeping them in sync is a manual headache.
  • No audit trail. If something breaks, good luck reconstructing what happened in an AI session from three days ago.

These are real problems, not hypothetical ones. Ive had sessions where I couldnt explain to a teammate what the AI changed because the context was just... gone.

What Mantras Remote SSH Does

Mantra is an AI coding session manager built around three things: Replay, Control, and Secure. The Remote SSH feature brings all three to your remote machines.

Once you connect a remote server via SSH in Mantra, it works the same as if the session were local. The supported tools right now are Claude Code, Cursor, and Gemini CLI.

Replay — Time Travel for Remote Sessions

This is the one I use the most. Mantra records your AI coding sessions and lets you replay them step by step. On a remote server, that means you can SSH into a VM, kick off a Claude Code task, disconnect, and later come back and walk through exactly what happened — every file edit, every decision point.

The Git Time Travel feature is particularly useful here. You can jump to any point in the sessions git history and see the state of the codebase at that moment. On a remote machine where youre not watching in real time, this is the only way to actually understand what the AI did.

Secure — Catching Sensitive Data in Remote Sessions

Remote servers are where your sensitive stuff lives. Mantras Secure feature scans session output for sensitive content — API keys, tokens, credentials — and flags them. Running this on remote sessions is probably more important than running it locally, because remote environments are where production secrets tend to live.

If an AI session on your staging server accidentally dumps a database connection string, you want to know about it.

Control — MCP Hub on Remote Machines

Mantras Control pillar includes an MCP Hub that manages your MCP (Model Context Protocol) services. The Remote SSH feature means you can manage MCP services on your remote machines through the same interface you use locally. No more manually SSH-ing in to restart an MCP service or check why something isnt connecting.

How to Set It Up

The setup is straightforward:

  1. Open Mantra and go to the Remote SSH section
  2. Add your server (host, port, username, key or password)
  3. Mantra connects and sets up its session management layer on the remote machine
  4. Start a Claude Code or Gemini CLI session on the remote — Mantra picks it up automatically

From that point, Replay, Secure, and Control all work on that remote session the same way they do locally.

Who This Is For

If youre running AI coding tools on:

  • Cloud VMs (AWS, GCP, Azure, DigitalOcean)
  • GPU instances for ML/AI work
  • Remote dev servers your team shares
  • Any machine you SSH into regularly

...then this is worth trying. The replay alone is worth it. Being able to come back after a long unattended Claude Code session and actually reconstruct what happened is genuinely useful.

Try It

Mantra is at https://mantra.gonewx.com?utm_source=devto&utm_medium=article&utm_campaign=devto-article-launch. The Remote SSH feature is available now for Claude Code, Cursor, and Gemini CLI.

If youre already using AI coding tools on remote servers and have been living with the limitations I described above — no replay, no audit trail, no visibility into sensitive data — its worth a look.

Top comments (0)