Claude Code CLI — Deep Dive & Relevance to Our Stack

Research Brief · Prepared by Chief · March 12, 2026

Topics: Claude Code CLI · MCP Protocol · Remote Control · System Management · Security

Note on your voice message: You said "absorb command line interface" — confident that's Claude Code CLI after some speech-to-text mangling. If you meant something else, let me know and I'll re-run. This is a good one though.

What Is Claude Code?

Claude Code is Anthropic's agentic CLI — a terminal-based AI coding assistant that goes well beyond autocomplete. It reads your entire codebase, executes shell commands, modifies files, manages git workflows, and can spawn up to 10 parallel sub-agents to work on problems in isolated contexts.

As of early 2026, 4% of all public GitHub commits (~135,000/day) are authored by Claude Code — a 42,896× growth in 13 months. 90% of Anthropic's own code is AI-written using it.

Why it matters for us

We already use Claude Code via OpenClaw for spawning coding tasks. But Claude Code has grown well beyond a coding tool — it's becoming a general system management interface with MCP, hooks, and remote control features that are directly relevant to how we run our infrastructure.


The Five Core Systems

Claude Code's power comes from five layered systems that most people never touch:

System What It Does Relevance to Us
Configuration CLAUDE.md / settings.json files at project and global level control behavior, model choice, and defaults High — define rules per repo (provider-search, cms-data, enterprise-assistant)
Permission System Granular allow/block rules for tools and bash commands. --permission-mode can range from plan-only to full bypass Critical — prevents runaway commands on production servers; essential for CI/CD spawns
Hook System Shell commands that fire deterministically on specific events (pre-tool, post-tool, stop, notification). Hooks always execute regardless of model behavior High — auto-lint, format, test on every edit. Hooks > prompts for things that must always happen
MCP Protocol Model Context Protocol — connects Claude to external services. Claude Code can both consume MCP servers AND be an MCP server Epic — see dedicated section below
Subagents Spawn up to 10 parallel agents in isolated contexts. Each returns only a summary to the main session — keeps context clean High — already using via OpenClaw; better delegation = less context bloat

🔥 New: Remote Control (February 2026)

This one is wild. Run claude remote-control in your local terminal → scan a QR code → your entire local session (same conversation, same context, same files, same MCP servers) is now live on your phone or Claude.ai in the browser.

How it works: Claude Code opens a tunnel to Anthropic's relay servers. Your phone connects through the Claude iOS/Android app or claude.ai/code. Everything is end-to-end — the code still executes locally on your machine, you just control it from anywhere.

What this means for us


🔥 MCP: Claude Code in Both Directions

This is where things get genuinely interesting for our stack. MCP works two ways with Claude Code:

Direction 1: Claude consumes MCP servers

Claude Code connects to external tools and services during a session. No copy-paste, no context switching. One command to add:

claude mcp add github \
  --transport http \
  https://mcp.github.com

3,000+ integrations available: GitHub, Postgres, Sentry, Linear, Figma, Slack, and more.

Direction 2: Claude IS the MCP server

Run Claude Code as an MCP server so other tools can call into it:

claude mcp serve

This means your enterprise assistant in Azure can make tool calls directly to a running Claude Code session on your local machine or a server.

Remote MCP Servers (Zero Local Setup)

Launched alongside Remote Control: tools like Sentry, Linear, and Figma can now connect directly to Claude Code over HTTP — no local server process needed at all. Just add the remote URL and you're live.


What This Looks Like for Our System Management

Here's the vision you were hinting at — using Claude Code CLI as the management layer for our infrastructure:

Use Case How Status
Manage Hetzner servers (CMS pipeline, provider search) SSH into server → run claude with MCP connected to Postgres/DuckDB → natural language queries and operations Ready to try
Manage Azure resources (enterprise assistant) Add Azure MCP server: claude mcp add azure --transport http <azure-mcp-endpoint> → manage Container Apps, check logs, restart services by talking to Claude Needs MCP setup
GitHub ops (PRs, CI, issues) GitHub MCP already exists → claude mcp add github --transport http https://mcp.github.com One command
Database management (DuckDB / Postgres / Supabase) Postgres MCP → natural language queries, schema inspection, data operations without raw SQL Supported
Enterprise assistant as MCP client Your Azure agent could call claude mcp serve on a server — effectively using Claude Code as a tool-execution engine Architecture play
OpenClaw + Claude Code bridge OpenClaw already calls Claude Code via ACP. But with claude mcp serve, OpenClaw could call specific Claude Code capabilities as discrete tool calls Future exploration

Security Model — What's Protected

Default behavior: Claude Code will always ask permission before running bash commands, writing files, or calling external services. This is the safe default. You can tighten or relax it per project.

Key permission controls

Mode What Happens Best For
--permission-mode plan Claude can only plan and read — no writes, no commands Reviewing PRs, exploring unfamiliar codebases
--permission-mode default Asks before every sensitive operation Normal interactive work
--permission-mode acceptEdits Auto-accepts file edits, still asks for bash Trusted coding sessions
--permission-mode bypassPermissions No prompts at all — fully autonomous CI/CD, overnight coding agents (what we use via spawn script)

Enterprise / Team Deployment

For managed deployments (e.g., we want to configure Claude Code across client environments), there's a managed-mcp.json system designed for IT admins — system-wide MCP config that users can't override. This is interesting for selling to health systems: we could pre-configure Claude Code with their internal tools and lock down what it can access.

For our enterprise assistant work: The permission system maps directly to what healthcare clients will require. We can configure Claude Code to only access specific databases, specific Azure resources, and nothing else — and show that in a demo.

Hooks — Automation That Always Fires

Hooks are deterministic shell commands tied to events in a Claude Code session. Unlike prompts (which Claude can ignore), hooks always execute.

Hook Event Fires When Example Use
PreToolUse Before any tool call Block certain commands; log every operation; validate inputs
PostToolUse After a tool call completes Run linter after every file edit; auto-format; trigger tests
Stop Session ends Git commit changes; send completion notification; clean up
Notification Claude wants to alert you Route to Telegram instead of terminal; custom sound; log to file
"Use hooks for anything that must always execute. Hooks guarantee execution; prompts do not."

This is exactly the pattern we've been doing manually with our spawn-agent.sh wrapper script. Hooks could formalize that: auto-git-commit after session, auto-notify Telegram on stop, auto-test after file edits.


Quick Reference: Key Commands

# Basic sessions
claude                          # interactive
claude -p "fix the auth bug"    # one-shot, exits
claude -c                       # resume last session

# MCP management
claude mcp add github --transport http https://mcp.github.com
claude mcp add postgres --transport stdio -- npx -y @modelcontextprotocol/server-postgres
claude mcp list                 # see what's connected
claude mcp serve                # expose THIS instance as MCP server

# Remote Control (new Feb 2026)
claude remote-control           # scan QR → control from phone/claude.ai

# Agents
claude agents                   # list configured subagents

# Auth
claude auth status              # check login state
claude auth login --sso         # enterprise SSO login

# Permission modes
claude --permission-mode plan   # read-only, planning only
claude --permission-mode bypassPermissions  # fully autonomous (CI/CD)

Recommended Next Steps for Us

Quick wins (do this week)

  1. Add GitHub MCP — one command, gives us natural-language GitHub ops across all repos
  2. Set up a CLAUDE.md in each active repo — tells Claude Code the project conventions, what servers exist, what not to touch
  3. Try Remote Control — run claude remote-control on your Mac once, scan with Claude app on phone. Just to see it work
  4. Add a Stop hook to spawn-agent.sh — formalize the Telegram notification we already do manually

Medium-term (enterprise assistant angle)

  1. Azure MCP server — Anthropic has an Azure MCP or we can build a thin wrapper. This lets Claude Code (and our enterprise assistant) manage Azure resources via natural language
  2. Postgres MCP on CMS server — connect Claude Code to the DuckDB/Postgres on Hetzner. Makes database ops dramatically faster
  3. Demo story: "Claude Code connected to your Azure tenant, permission-locked to only your resources, controlled from your phone" — that's a real enterprise pitch
One thing to watch: Remote Control is still in "research preview" as of February 2026. Don't build production workflows on top of it yet, but definitely worth experimenting with for our own use.

Sources: code.claude.com/docs (official Claude Code documentation, March 2026) · blakecrosley.com/guides/claude-code (comprehensive CLI guide, updated March 11, 2026) · claudefa.st/blog/guide/development/remote-control-guide (Remote Control feature overview) · releasebot.io/updates/anthropic/claude-code (release notes) · builder.io/blog/claude-code-mcp-servers (MCP setup guide)

Report prepared by Chief · March 12, 2026 · Internal use only