Claude Code Architecture and Features Guide
Claude Code is an agentic coding tool that can inspect a repository, propose edits, run permitted commands, and work through a task in a terminal session. The important boundary is not the interface label; it is the permission mode, working directory, tools, credentials, and network access available to that session.
This guide gives a practical overview of installation, project instructions, MCP, hooks, and non-interactive CLI use. Fast-moving features such as cloud sessions and integrations should be checked against the current Anthropic documentation before adoption.
Engine Architecture & Multi-Surface Execution
At the core of Claude Code is a single, unified execution engine that powers all client surfaces. Whether you run commands in your terminal CLI, trigger inline diffs inside VS Code or JetBrains, run side-by-side sessions in the Desktop app, or launch background tasks on the web (claude.ai/code), your project configuration remains strictly identical. Learn more about advanced programmatic execution in our Claude Agent SDK Guide.
Because every surface connects to the same underlying engine, project instructions in CLAUDE.md, saved auto-memory insights, registered skills, and connected MCP servers are automatically shared. Subscriptions (Claude Pro/Team/Enterprise) or Anthropic Console API keys authenticate all surfaces, while the Terminal CLI and VS Code extension also support third-party LLM providers.
Quick reference
- A session's behavior depends on its client, model, permissions, tools, project instructions, and network boundary.
CLAUDE.mdis repository guidance; do not assume that every client or cloud surface shares all local state.- VS Code and JetBrains plugins add rich interactive diff viewing, inline @-mentions, and editor selection context.
- The Desktop App (macOS & Windows) supports side-by-side session execution, visual diff reviews, and scheduled local tasks.
- Web sessions at claude.ai/code enable zero-setup cloud execution for long-running jobs and un-cloned remote repositories.
Remember this
Claude Code decouples the reasoning engine from the interface—allowing direct context handoffs across CLI, IDEs, Desktop, and Cloud.
Installation Pathways, OS Environments & Package Managers
Claude Code supports multiple installation pathways tailored to developer environments across macOS, Linux (Debian, Fedora, RHEL, Alpine), WSL, and native Windows. Choosing the correct installer determines how background updates and shell dependencies are handled. For isolated sandbox execution, see our Sandboxing & Isolation Guide.
Native Installers vs. Package Managers
The native installer is the recommended installation method because it includes automatic background updates:
- macOS / Linux / WSL:
curl -fsSL https://claude.ai/install.sh | bash - Windows PowerShell:
irm https://claude.ai/install.ps1 | iex - Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
1# Homebrew Install (macOS / Linux)2brew install --cask claude-code # Follows stable channel (~1 week delay)3brew install --cask claude-code@latest # Follows latest channel (instant updates)4 5# Upgrade Homebrew & WinGet installs manually6brew upgrade claude-code7winget upgrade Anthropic.ClaudeCodeOn native Windows, installing Git for Windows is strongly recommended so Claude Code can utilize its native Bash tool instead of defaulting to PowerShell. On first launch inside any project directory (cd my-project && claude), you are prompted to log in. Setting the ANTHROPIC_API_KEY environment variable bypasses interactive login prompts.
Quick reference
- Native script installs auto-update in the background; Homebrew and WinGet packages require manual upgrade commands.
- Homebrew offers two casks:
claude-codefor stable releases andclaude-code@latestfor immediate access to new versions. - Linux package managers (
apt,dnf,apk) provide native distribution support across Debian, RHEL, Fedora, and Alpine. - Running CMD commands inside PowerShell yields syntax errors (
&&token error); running PowerShellirminside CMD fails with command unrecognised. - Prompt indicators quickly identify Windows shell context:
PS C:\indicates PowerShell, whileC:\indicates Command Prompt.
Remember this
Use native curl/ps1 installers for automatic updates, or package managers (Homebrew/WinGet) for controlled infrastructure deployments.
Core Capabilities, MCP Integrations & Project Customization
Claude Code automates tedious development workflows such as writing unit tests for legacy code, fixing linting errors project-wide, resolving Git merge conflicts, updating dependencies, and drafting release notes. When given a bug report or stack trace, it traces the problem through the codebase to pinpoint root causes and implement verified fixes.
Customization via CLAUDE.md, Skills, and Hooks
Projects are customized using four extensible mechanisms:
- CLAUDE.md: A project-root markdown file read at session startup containing coding standards, architectural rules, and build commands.
- Auto-Memory: Automatically saved insights (such as build quirks or test flags) that persist across sessions without manual documentation.
- Skills: Packaged, reusable team workflows triggered by slash commands (e.g.,
/review-pror/deploy-staging). - Hooks: Shell commands triggered before or after agent actions—such as auto-formatting files after edits or running linters prior to commits.
Model Context Protocol (MCP)
Through MCP, Claude Code connects to external enterprise services—allowing it to read design documents from Google Drive, update Jira issues, fetch context from Slack, or query custom internal databases.
Quick reference
- Claude Code automates end-to-end Git operations including staging, writing descriptive commit messages, branching, and opening PRs.
- CI/CD integrations for GitHub Actions and GitLab CI support automated pull-request code reviews and issue triage.
- MCP provides an open standard for securely exposing external APIs and internal toolchains to the agent.
- Hooks allow teams to enforce deterministic quality gates (Pre-edit, Post-edit, Pre-commit) without relying solely on LLM compliance.
- Auto-memory continuously updates learned project knowledge without cluttering git-tracked
CLAUDE.mdfiles.
Remember this
Combine CLAUDE.md guidelines with deterministic shell hooks and MCP data connectors to build secure, context-aware development agents.
Sub-Agents, Cloud Routines & Cross-Device Teleportation
For complex, multi-faceted tasks, Claude Code supports sub-agent delegation. A lead agent breaks down high-level objectives, spawns specialized sub-agents to tackle isolated subtasks in parallel, and merges the results into a cohesive solution.
Scheduled Execution: Routines vs. Desktop Loops
Automation tasks can be scheduled to run locally or in the cloud:
1# Pipe log output directly into Claude Code (Unix Philosophy)2tail -n 200 production.log | claude -p "Notify Slack if critical anomalies exist"3 4# Perform bulk security review across modified files5git diff main --name-only | claude -p "Review changed files for security vulnerabilities"6 7# Repeat prompt polling inside terminal session8/loop 5m "Check deployment status and report errors"- Cloud Routines: Created on the web, in the Desktop app, or via
/schedule. They run on Anthropic infrastructure even when your computer is powered off. - Desktop Scheduled Tasks: Run on your local hardware with direct access to local filesystem paths and private network tools.
Cross-Device Teleportation & Integrations
With Remote Control and Dispatch, developers can monitor local sessions from mobile devices (iOS/Android). Running claude --teleport pulls web or mobile tasks back into your local terminal. The /desktop command seamlessly transitions a terminal session into the Desktop app for visual diff review, while Slack integrations allow users to @Claude a bug description and receive a working PR in return.
Quick reference
- Sub-agents execute subtasks in parallel, reducing wall-clock resolution time for large multi-file refactoring jobs.
- Cloud Routines continue running during off-hours and can be triggered by scheduled cron expressions, API webhooks, or GitHub events.
- The CLI follows Unix philosophy—supporting standard input piping (
tail -n 200 | claude -p) and file list chaining. claude --teleportsyncs session state from cloud/mobile surfaces directly into your active local workspace.- Channels enable external event streams (Discord, Telegram, iMessage, Webhooks) to push real-time alerts into active sessions.
Remember this
Use sub-agents for parallel execution, Cloud Routines for off-hours maintenance, and teleportation to switch fluidly across devices.
Hands-on Practice: Build a Multi-Tool Agent Session with Custom Skill and Hook
To consolidate your understanding of Claude Code, configure a local project environment with a custom CLAUDE.md and a documented CLI verification command. Keep the hook event names and settings schema aligned with the current Anthropic documentation; the exact event payload should be tested before enabling automatic writes.
1mkdir -p my-claude-project && cd my-claude-project2cat << 'EOF' > CLAUDE.md3# Project Guidelines4- Architecture: Modular TypeScript Next.js App Router5- Testing: Run the repository verification command before committing6- Formatting: Format modified files before review7EOF8 9# Non-interactive audit; inspect the output and exit status10git diff --name-only | claude -p "Review these changed files against CLAUDE.md and report failures"Intentional failure: add a formatting violation or failing test. Recovery: fix the violation, rerun the project check, and pass only when the command exits successfully and the diff contains no unreviewed changes.
Quick reference
- Creating
CLAUDE.mdestablishes persistent project rules without needing per-prompt repetition. - Configuring
PostToolUsein.claude/settings.jsoncan run project-specific formatting after supported tool calls. - Piping
git diffoutput intoclaude -pexecutes non-interactive CLI audits adhering to the Unix philosophy.
Remember this
Pairing explicit CLAUDE.md rules with automated post-edit hooks ensures AI code edits conform strictly to team quality standards.
Key takeaway
Practice task: remove the formatter command or run the CLI against a deliberately failing test. The expected result is a visible hook or test failure. Restore the command, rerun the check, and pass only when the output is formatted and the project's verification command succeeds. Confirm current commands and surface-specific features in Anthropic's documentation before scripting them in CI.
Polo Khan
Lead Author & Systems ArchitectSoftware engineer and distributed systems architect specializing in backend scalability, cloud-native infrastructure, databases, and AI engineering workflows. Author and maintainer of Core Concept Learning.
Related Articles
Explore this topic