Sending a prompt to a Claude Code cloud session from my terminal
On this page
I wanted to start a Claude Code task and then close my laptop. The task needed to keep going without me. I already run agents on a VPS, but that is another server to maintain. Claude Code can run a session in the cloud, so I tried starting one from my terminal instead.
The command
The command is claude --cloud, then the prompt in quotes, then any flags. This is the shape I used. I've trimmed the prompt to keep it short.
claude --cloud "Action the ten open Dependabot security alerts in this repository.
Branch from main.
For each alert, find which direct dependency pulls in the vulnerable package.
Prefer a direct bump. Use a narrow override only when a direct bump will not work.
Update the lockfile with the package manager.
Run the project's full verify command. Report each check honestly. A check that was skipped is not a pass.
Open one pull request with the fixes. Do not merge it, deploy it or dismiss any alerts." --model claude-haiku-5-5The quoted text is the description of the session. The help text says --cloud creates a cloud session with the description you give it.
I chose Haiku 5.5 for this task, because it is only dependency upgrades. The --model flag is how I asked for it, and the session ran on Haiku 5.5.
Gotcha: the prompt has to come first
My first try put --model straight after --cloud:
claude --cloud --model claude-haiku-5-5 "Action the ten open Dependabot security alerts in this repository."Claude Code stopped with --cloud requires a description.
The fix is to put the quoted prompt straight after --cloud, then the other flags.
What the example asks for
The example task is ten open Dependabot security alerts. The prompt asks for one pull request with the fixes. It does not allow merging, deploying or dismissing any alerts.
Two rules in the prompt set how the fixes should be made. A bump should come from the direct dependency where it can. A check that was skipped should be reported as skipped, not as a pass.
The session did open a pull request with the security fixes.
What to check afterwards
The prompt stops at an open pull request, so the review and the merge are still manual steps. Before merging, read the diff. Check that each change matches an alert. Then read the verify output and look for any check that was skipped.
Seeing what a session costs
I didn't have a good way to see what a session cost, so I looked at what Claude Code offers. There are three options.
/costinside a session shows the cost and token use so far. Some guides say Anthropic does not treat this figure as a bill on Pro and Max plans, so I read it as a rough guide.- A status line can show the cost all the time. Claude Code passes the session's cost to a status line script. Run
/statuslineand describe what you want. ccusageis a community tool. It reads the log files Claude Code writes on your machine and estimates the cost of each session. Runccusage sessionto see one session's breakdown.
ccusage can only count sessions whose log files are on your machine. A cloud session runs on Anthropic's servers, so it may not show up there. I still don't have a clean way to see what a cloud session costs. That part is still open.
Limits
- The command needs an interactive terminal, so a script cannot run it. Put the prompt straight after
--cloud, with the other flags after it, or the command will not start. - The session clones the GitHub remote at your current branch, not your local checkout. Push first if you have local commits.
- Cloud sessions are available on Pro, Max and Team plans. Anthropic's documentation for cloud sessions says they count toward your plan's usage limits, with no separate charge for the cloud machine.
- Cloud sessions keep working when the laptop is closed. A long session still uses context on every call. I wrote about what that costs.