> For the complete documentation index, see [llms.txt](https://riteshs4hu.gitbook.io/infosec-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://riteshs4hu.gitbook.io/infosec-notes/artificial-intelligence/ai-agents/claude-code.md).

# Claude Code

Claude Code is an AI-powered coding agent from Anthropic that operates directly in your local terminal.

* Install Claude Code using the official installation script:

```bash
curl -fsSL https://claude.ai/install.sh | bash
```

#### Fix `command not found`

If the `claude` command is not found after installation, add the local binary directory to your `PATH`:

```bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
```

***

### Run Claude Code with Ollama Models

References

* <https://docs.ollama.com/integrations/claude-code>
* <https://ollama.com/search?c=cloud&o=newest>

Prerequisites

1. Install **Ollama**.
2. Pull the desired model.

Example:

```bash
ollama run gpt-oss:20b-cloud
```

```bash
ollama run nemotron-3-ultra:cloud
```

* Configure Environment Variables

Set the required environment variables:

```bash
export ANTHROPIC_AUTH_TOKEN="ollama"
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL="http://localhost:11434"
```

Reload your shell configuration:

* **Bash**

```bash
source ~/.bashrc
```

* **Zsh**

```bash
source ~/.zshrc
```

Launch Claude: Recommended (Ollama Launch)

```bash
ollama launch claude --model gpt-oss:20b-cloud
```

#### Alternative (Inline Environment Variables)

```bash
ANTHROPIC_AUTH_TOKEN=ollama \
ANTHROPIC_BASE_URL=http://localhost:11434 \
ANTHROPIC_API_KEY="" \
claude --model nemotron-3-ultra:cloud
```

***

### Configure MCP (Model Context Protocol)

Reference:

* <https://code.claude.com/docs/en/mcp>

Claude Code supports multiple MCP transports, including:

* HTTP
* SSE (Server-Sent Events)
* WebSocket

***

* Add a Remote HTTP MCP Server

```bash
claude mcp add --transport http ftp-enum http://192.168.1.19:8080/mcp
```

* Remove an MCP Server

```bash
claude mcp remove ftp-enum
```

* List Configured MCP Servers

```bash
claude mcp list
```
