No history yet

Setup and Security

Installation and Authentication

Moving from a web UI to a local terminal brings your AI assistant directly into your development workflow. Claude Code is an agentic CLI that acts as a true engineering partner, capable of executing commands and modifying your codebase. The first step is installing the native binary.

# For macOS, Linux, or WSL (using curl)
curl -fSL https://claude.sh/install.sh | sh

# For Windows (using PowerShell)
irm https://claude.sh/install.ps1 | iex

These commands download and run the appropriate installer for your system. Once installed, authenticate your terminal with your Anthropic account. Running any claude command for the first time will trigger this process.

The command claude login will open a browser window, prompting you to authorize the CLI via an OAuth flow. Once you approve, your terminal session is authenticated.

The Permission Model

Giving an AI agent access to your local file system requires clear, strict boundaries. Claude Code operates on a robust permission model to ensure you always have control. You can manage these settings with the /permissions command within a Claude Code session.

There are four primary permission modes, each offering a different level of autonomy and oversight.

ModeDescription
DefaultPrompts for confirmation before every file edit or shell command.
PlanShows its plan first. You approve the whole plan before it executes.
Accept EditsAutomatically accepts file edits but still asks before running shell commands.
BypassExecutes all actions without prompting. Use with extreme caution.

For most workflows, Default or Plan mode provides the best balance of safety and efficiency. You can switch modes mid-session by typing /permissions and selecting a new option.

Enforcing Security

While session-based permissions are useful, a more permanent security posture is essential for team environments or sensitive projects. This is managed through the managed-settings.json file. This configuration file allows you to enforce the Principle of Least Privilege by setting up allowlists, asklists, and denylists for specific actions.

// Example managed-settings.json
{
  "file_access": {
    "denylist": [
      // Disallow access to all .env files
      { "pattern": "**/.env" },
      // Disallow access to the .git directory
      { "pattern": "**/.git/**" }
    ]
  },
  "bash_access": {
    "denylist": [
      // Prevent destructive commands
      { "pattern": "rm -rf*" },
      // Block any git push commands
      { "pattern": "git push*" }
    ]
  }
}

This configuration file is placed in your project's root directory. The denylist is powerful for preventing common mistakes. Here, we've blocked access to environment variable files and the .git folder. We also prevented the agent from running destructive rm -rf commands or pushing code directly.

To ensure everything is configured correctly, you can run a diagnostic check.

claude doctor

This command checks your installation, authentication status, and configuration files, reporting any issues it finds. It's a good first step if you encounter unexpected behavior.