{
  "slug": "claude",
  "url": "/process/claude/",
  "name": "claude",
  "kind": "ai-agent",
  "package": "@anthropic-ai/claude-code (npm) or the native installer",
  "binary": "claude — a native binary since 2.x (npm puts it at node_modules/@anthropic-ai/claude-code/bin/claude.exe, an ELF file despite the name); older releases ran as a node process",
  "config": [
    "~/.claude/settings.json",
    ".claude/settings.json",
    ".claude/settings.local.json",
    ".mcp.json",
    "~/.claude/.credentials.json"
  ],
  "summary": "Claude Code command-line agent: reads, edits and runs commands in a project directory with the permissions of the user who started it, filtered by the session's permission mode.",
  "symptoms": [
    "a claude process at high CPU for minutes: almost always a build or test suite it launched, so look at its child processes, not at claude",
    "unexpected listening sockets or outbound connections: an MCP server a session started, which is a separate process",
    "files changed under a path you did not expect: acceptEdits or auto mode plus a broad allow rule, or a Bash command you approved once with 'don't ask again'"
  ],
  "safe_to_kill": "yes",
  "safe_to_kill_note": "It is an ordinary user process: Ctrl-C or kill -TERM stops it. The only things it can leave behind are a half-applied edit and a child command that was already running, so check git status, git diff and its leftover children afterwards. Killing it revokes nothing it was allowed to do while alive; that is a permissions question, below.",
  "what_it_can_do": "Everything your Unix user can do, filtered by the permission mode. Manual mode (config value default): read-only tools and a built-in set of read-only commands such as ls, cat and git status run without asking; file edits, other Bash commands, curl and wget, web fetches and searches prompt. acceptEdits adds file edits and mkdir, touch, mv, cp, rm and sed inside the working directory. plan is reads only. auto, the starting mode for interactive terminal sessions since v2.1.283, hands each action to a separate classifier model that approves or blocks it; your own deny and ask rules still apply. dontAsk denies anything that would have prompted, for CI. bypassPermissions, spelled --dangerously-skip-permissions on the command line, skips the prompts entirely, including writes to protected paths such as .git and .claude; it refuses to start as root, and the docs reserve it for containers and VMs. Rules live under permissions.allow, permissions.deny and permissions.ask in the settings files; deny rules win in every mode. A claude -p session starts in manual mode (since v2.1.302) and shows neither the workspace-trust prompt nor the .mcp.json approval prompt.",
  "diagnose": [
    {
      "cmd": "ps -eo pid,user,etime,args | grep -w '[c]laude'",
      "why": "who runs it, for how long, and with which flags: --dangerously-skip-permissions or --permission-mode on the command line tells you the mode without asking the user"
    },
    {
      "cmd": "ps --ppid \"$(pgrep -x claude | head -1)\" -o pid,etime,args",
      "why": "its children are what it is actually executing right now: the build, the test run, the MCP servers"
    },
    {
      "cmd": "python3 -c \"import json;print(json.load(open('$HOME/.claude/settings.json')).get('permissions'))\"",
      "why": "the user's allow, deny and ask rules; look for broad allows such as Bash(*) and for a defaultMode of bypassPermissions. Repeat for .claude/settings.json and .claude/settings.local.json in the project"
    },
    {
      "cmd": "find ~/.claude -maxdepth 1 -type f -perm /077 -printf '%m %p\\n'",
      "why": "on Linux the login lives in ~/.claude/.credentials.json with mode 0600; settings.json at 644 is normal, a group- or world-readable .credentials.json is not"
    },
    {
      "cmd": "cat .mcp.json 2>/dev/null; ss -tlnp | grep -E 'node|python|uv'",
      "why": "the project's MCP servers, and which of them are listening on a port. User-scope servers, plugins and claude.ai connectors can add more, so .mcp.json is not the whole list"
    }
  ],
  "fixes": [],
  "harden": [
    {
      "title": "Sandbox the shell commands, not just the prompts.",
      "cmd": "sudo apt-get install bubblewrap socat",
      "note": "Then run /sandbox in a session, or set sandbox.enabled to true in ~/.claude/settings.json. On Linux and WSL2 the sandbox uses bubblewrap for the filesystem (writes limited to the working directory and a temp directory) and a local proxy for the network, so only hosts in sandbox.network.allowedDomains are reachable; plain ssh and database clients that ignore proxy variables cannot connect at all. Native Windows runs unsandboxed. On Ubuntu 24.04 and later, AppArmor blocks bubblewrap's user namespaces until you add the profile from the sandboxing docs."
    },
    {
      "title": "Deny what you never want, in a settings file the repository cannot override.",
      "note": "permissions.deny: [\"Bash(curl *)\", \"Bash(wget *)\", \"Read(./.env)\", \"Read(~/.ssh/**)\"] in ~/.claude/settings.json or managed settings. A Bash deny rule matches the command text as written, so /usr/bin/curl or sh -c 'curl ...' slips past it; pair it with sandbox network isolation for enforcement that does not depend on spelling."
    },
    {
      "title": "Take bypass mode off the table for everyone on the box.",
      "note": "permissions.disableBypassPermissionsMode set to \"disable\" in managed settings (/etc/claude-code/managed-settings.json on Linux) removes --dangerously-skip-permissions; permissions.disableAutoMode does the same for the classifier. User and project settings cannot undo managed settings."
    },
    {
      "title": "One Unix user per agent.",
      "note": "An agent running as deploy cannot read david's home, ssh keys or shell history. This is the cheapest blast-radius cut on a shared machine and it needs no Claude Code configuration at all."
    },
    {
      "title": "Keep secrets out of the environment and the working tree.",
      "note": "A Bash command that runs env or cat .env reads every token in them. Use the sandbox's credential masking or an apiKeyHelper script for the keys the agent must have, and nothing else."
    },
    {
      "title": "Treat a cloned repository as untrusted input.",
      "note": "The workspace-trust dialog lists what a folder's .claude/settings.json would grant before it applies. Headless -p sessions skip that dialog, so run them, and any repository you did not write, inside a container or VM."
    }
  ],
  "impostors": [
    {
      "cmd": "readlink /proc/$(pgrep -x claude | head -1)/exe",
      "why": "a real claude resolves to the claude binary under node_modules/@anthropic-ai/claude-code/bin/ (npm install) or to the native installer's location in your home; an executable under /tmp, /dev/shm or a dot-directory you did not create is something else wearing the name"
    },
    {
      "cmd": "claude --version",
      "why": "prints the version and 'Claude Code'; a miner that borrowed the name has nothing to say here"
    }
  ],
  "listens": [],
  "distros": {
    "ubuntu": "22.04 and 24.04 install bubblewrap and socat from the main repositories; on 24.04 and later check sysctl kernel.apparmor_restrict_unprivileged_userns and add the AppArmor profile for /usr/bin/bwrap from the sandboxing docs if it returns 1.",
    "any": "Credentials: ~/.claude/.credentials.json, mode 0600. Configuration directory can be moved with CLAUDE_CONFIG_DIR, one per account. Managed settings for all users: /etc/claude-code/managed-settings.json."
  },
  "applies_to": "Claude Code 2.1.x on Linux, macOS and WSL2 (facts checked against the docs on 2026-10-20: auto mode default since v2.1.283, -p sessions manual since v2.1.302). Flag and setting names change between releases; see the verified date above.",
  "see_also": [
    "codex",
    "gemini",
    "openclaw-gateway",
    "ollama"
  ],
  "sources": [
    {
      "title": "Claude Code docs — Security",
      "url": "https://code.claude.com/docs/en/security",
      "fetched": "2026-10-20T00:00:00.000Z"
    },
    {
      "title": "Claude Code docs — Permission modes",
      "url": "https://code.claude.com/docs/en/permission-modes",
      "fetched": "2026-10-20T00:00:00.000Z"
    },
    {
      "title": "Claude Code docs — Configure permissions",
      "url": "https://code.claude.com/docs/en/permissions",
      "fetched": "2026-10-20T00:00:00.000Z"
    },
    {
      "title": "Claude Code docs — Sandboxing",
      "url": "https://code.claude.com/docs/en/sandboxing",
      "fetched": "2026-10-20T00:00:00.000Z"
    },
    {
      "title": "Claude Code docs — Authentication (credential management)",
      "url": "https://code.claude.com/docs/en/authentication",
      "fetched": "2026-10-20T00:00:00.000Z"
    }
  ],
  "tested_on": "Ubuntu 26.04 · Claude Code 2.1.304 via npm (file, permission and process checks); docs read 2026-10-20",
  "updated": "2026-10-20T00:00:00.000Z",
  "verified": "2026-10-20T00:00:00.000Z",
  "recheck_after": "2026-11-19T00:00:00.000Z",
  "changelog": [
    {
      "date": "2026-10-20T00:00:00.000Z",
      "note": "first version. The binary is native now (an ELF named claude.exe inside the npm package), which changes the impostor check compared with the node-based 1.x releases"
    }
  ]
}