Guide
Claude Code: a guide to the terminal agent and cloud sessions
By Atlas AI Resources · Published November 10, 2026
Claude Code is Anthropic's coding agent. It reads your codebase, edits files, and runs commands from your terminal, an IDE, a desktop app, or the browser, and it can also run as a cloud session that keeps going after you close your laptop. This page starts with our own setup advice, then summarizes what Anthropic's docs say, mainly the overview, Use Claude Code in the cloud, and permission modes pages.
1. Our advice: a first safe setup
- Start local, in one repository. Run it in a project folder you know well, on a task you can check in minutes, such as adding missing tests. Don't start it in your home directory.
- Pick the permission mode on purpose. Use plan mode to explore first, and Manual mode for unfamiliar or sensitive code. Save hands-off modes for work you will review anyway, and keep the skip-everything mode for throwaway containers.
- Write deny rules for what must never happen. Instructions in CLAUDE.md are context, not a lock. If an action must be blocked, use a deny rule or a hook.
- Keep CLAUDE.md short and committed. Build commands, conventions, and layout. Add a line when it makes the same mistake twice. Commit it so cloud sessions get it too.
- Trust MCP servers one at a time. Connect only servers you would trust with the same access yourself, and treat anything they fetch as untrusted input.
- Leave cloud network access on the default. Use network secrets for API keys, never plain environment variables, and open more domains only when a build fails without them.
- Check repo automation before Auto-fix. If a PR comment can deploy or run privileged jobs in your repository, leave Auto-fix off there.
- Judge by kept work. Count changes merged and not reverted, not sessions started.
2. Our advice: where it fits
Use the terminal for work you want to watch and steer. Use a cloud session for a well-scoped task you can describe in one message and review as a branch later. Use the GitHub Action when a team wants @claude in issues and pull requests without everyone installing anything. Whichever you pick, the real gate is your repository's branch protection and required reviews.
3. Per the docs: surfaces and setup
- Claude Code runs in the terminal, IDE extensions (VS Code, whose extension also installs in Cursor, and JetBrains), a desktop app, and the web at claude.ai/code. Most surfaces need a Claude subscription or an Anthropic Console account; the CLI, VS Code, and JetBrains also support third-party providers.
- The native install updates itself in the background. Homebrew and WinGet installs don't auto-update, so you upgrade them yourself.
- You start it by running
claudein a project directory, and it asks you to log in on first use. - It works directly with git: staging changes, writing commit messages, creating branches, and opening pull requests. It can also be piped and scripted with
claude -p, for example in CI.
4. Per the docs: permissions and the sandbox
- Permission modes set what runs without asking. Manual mode (config value
default) allows reads only.acceptEditsadds file edits and common filesystem commands.planexplores before editing.autolets a second model, a classifier, review actions instead of you.dontAskallows only pre-approved tools and suits locked-down CI.bypassPermissionsallows everything and is meant for isolated containers and VMs only. - With Claude Code v2.1.283 or later, auto mode is the built-in starting mode for interactive terminal and VS Code sessions. You can switch modes with Shift+Tab in the CLI.
- Rules layer on top of modes: allow, ask, and deny. Deny rules block in every mode, including
bypassPermissions. Some actions are never auto-approved in any mode, such as tools matched by an explicit ask rule and tools that require your input. - Choosing "Yes, and don't ask again" saves a rule to
.claude/settings.local.jsonin the repository, and it applies to future sessions there (permissions page). - The Bash sandbox is an operating-system boundary around the shell commands Claude runs, limiting the files and network domains they reach. It is off by default; turn it on with
/sandbox. It covers shell commands only: file tools, MCP servers, and hooks run outside it. It runs on macOS, Linux, and WSL2, not native Windows (sandbox page). - The security page says you are responsible for reviewing proposed code and commands before approval. It lists prompt-injection safeguards, including a workspace trust dialog for new folders and no auto-approval of
curlandwgetby default, and it notes that a-psession shows neither the trust prompt nor the project MCP approval prompt.
5. Per the docs: CLAUDE.md, hooks, subagents, and MCP
- CLAUDE.md files hold instructions you write, loaded at the start of every session, at managed, user (
~/.claude/CLAUDE.md), or project (./CLAUDE.md) scope. Claude can read a repository'sAGENTS.mdinstead. The docs suggest under 200 lines per file. Auto memory is notes Claude writes itself from your corrections; the first 200 lines or 25KB load each session. Both are context, not enforced configuration (memory page). - Hooks are shell commands Claude Code runs at set points in its lifecycle, such as formatting after an edit or blocking edits to protected files like
.env. The docs call them deterministic control: the action always happens instead of relying on the model to choose it (hooks guide). - Subagents run side tasks in their own context window with their own prompt, tool access, and permissions, and return a summary. Their requests count toward the same usage limits. Built-in ones include a read-only Explore agent (subagents page).
- MCP connects Claude Code to outside tools and data. The docs say to verify you trust each server before connecting it, because servers that fetch external content can expose you to prompt injection. A project's
.mcp.jsonservers need approval, and a cloned repository can't approve its own servers (MCP page). See our MCP explainer.
6. Per the docs: cloud sessions
- A cloud session runs on Anthropic-managed infrastructure (or your organization's self-hosted environment) and keeps running after you close your laptop. You can start one from claude.ai/code, the Code tab in the Claude app, the desktop app, the terminal with
claude --cloud "task", or a cloud scheduled task. - The docs list cloud sessions for Pro, Max, Ultra, and Team plans, and for Enterprise users with premium seats or Chat + Claude Code seats. They count toward your plan's usage limits, with no separate charge for the cloud VM, and parallel tasks use limits proportionately.
--cloudclones your GitHub remote at your current branch, not your local checkout, so push first.claude --teleportpulls a cloud session into your terminal; it needs a clean git state, the same repository, a pushed branch, and the same account. Handoff from the CLI is one-way.- Each session uses a cloud environment: network access, environment variables, and a setup script. Network levels are None, Trusted (the default: package registries, GitHub, cloud SDKs), Full, and Custom. GitHub, enabled MCP connectors, network-secret hosts, and the Anthropic API stay reachable at every level.
- Anyone who uses an environment can read its environment variables and setup script. In Anthropic-hosted environments, network secrets stay outside the VM, and a proxy attaches them to requests for the hosts you list. GitHub credentials also stay encrypted on Anthropic's servers, and GitHub operations go through a proxy that attaches them server-side.
- Sessions start from a fresh clone. Your repo's CLAUDE.md,
.claude/rules, skills, agents, and (in one-repository sessions) settings and.mcp.jsoncarry over. Your personal~/.claudefiles and locally added MCP servers don't; commit what you need. - Setup scripts run as root on Ubuntu 24.04. If one finishes in roughly five minutes, the filesystem is cached for later sessions, and the cache rebuilds after roughly seven days or when you change the script or allowed hosts.
- Idle sessions stop and their VM is reclaimed. Reopening restores the conversation, not background commands or subagents that were still running.
- Limits: cloning in Anthropic-hosted environments and pull requests need GitHub (a non-GitHub repository can be sent as a local bundle; GitHub Enterprise Server is supported for Team and Enterprise). Organizations with IP allowlisting, Zero Data Retention, the HIPAA configuration, or customer-managed keys face restrictions the docs spell out.
7. Per the docs: GitHub integration
- Connecting GitHub for cloud sessions: authorize the Claude GitHub App, or run
/web-setupto send your localghtoken to your Claude account. - Auto-fix watches a pull request and responds to CI failures and review comments, pushing a fix when one is clear and asking you when a comment is ambiguous. It needs the Claude GitHub App. Its comment replies post under your GitHub username, labeled as from Claude Code. The docs warn that those replies can trigger comment-driven automation, and suggest turning Auto-fix off where a PR comment can deploy infrastructure.
- GitHub Actions: the Claude Code GitHub Action runs in your workflows and answers
@claudementions in issues and PRs./install-github-appinstalls the app, saves a repository secret, and opens a pull request with the workflow; it needs repository admin access and works only with github.com repositories.
8. How this compares
Claude Code's cloud sessions follow the same pattern as the other cloud agents we cover: an isolated machine, a prepared environment, and a branch that waits for a person. See our Cursor Cloud Agents guide, GitHub Copilot cloud agent guide, and OpenAI Codex Cloud guide. The difference worth knowing is that Claude Code is also a full local terminal agent, so the same CLAUDE.md, rules, and hooks shape both the session on your laptop and the one in the cloud. Codex Cloud's network secrets and Claude Code's work the same basic way: the raw key stays out of the machine. As with all of them, keep the real gate in your repository settings, not in the task description.
Related: Cursor Cloud Agents guide · GitHub Copilot cloud agent guide · OpenAI Codex Cloud guide · Keeping AI agents safe from prompt injection · Parallel agent campaigns · What is MCP? · Agent memory for AI fleets · The standing rules my Grok Bots share · Grok Bot vs Claude Cowork · Devin (Cognition) guide