---
title: Claude code AI agent 101
url: https://calvin.my/posts/claude-code-ai-agent-101
published: 2025-07-18
updated: 2026-09-14
category: AI
tags:
- Claude
- Anthropic
- AI agent
summary: An introductory guide to Claude Code explains how to install and launch the coding agent from a project’s root, choose subscription or API billing, and optionally select a model. It covers persistent project instructions, permission controls for sensitive files and actions, and ways to reference files or images. Readers also learn to monitor session costs, access partner pricing, resume prior sessions, and submit bug reports.
---

# Claude code AI agent 101

This article collects basic knowledge you need to know about the Claude code AI coding agent

* * *

## 1\) Install / Update

In the terminal app, use the command below to install the tool.&nbsp;

```bash
npm install -g @anthropic-ai/claude-code
```

This requires npm. If you don't have it, you can get it via [nvm](https://github.com/nvm-sh/nvm).

## 2\) Running

You should run the tool at the root of your project directory.

```bash
cd /path/to/app/root && claude
```

## 3\) Billing

You can choose a subscription package or pay per use via API token. After Claude is started, run the /login command below:

```bash
/login
```

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/0d82bc24-09e1-4dae-bd72-ae7f7e0210f0.png)

## 4\) Select Model

This step is optional. Claude Code uses a default model; at the time of this article, it is Sonnet 4. If you intend to use a different model, run the /model command below:

```bash
/model
```

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/e6e74fcf-f383-472d-8491-fe6ba06efb1e.png)

## 5\) Providing Memory

It is possible to provide instructions (memory) to the tool. After Claude is started, run the /init command below:

```bash
/init
```

This creates a **CLAUDE.md** file where you can place information such as coding guidelines. A sample is shown below:

```markup
# Testing Guideline
1. Run all tests before making any changes to ensure there are no existing failures.
2. After completing your modifications, re-run the tests. If any tests fail, you must fix your code.
3. If the existing test cases do not cover the code you changed, you must add test coverage for these changes.
4. Finally, verify that all your changes comply with the linter formatting requirements.
```

## 6\) Tool setting

Claude allows you to whitelist or blacklist certain actions. For example, you can have the tool create a directory without asking you. However, you do not want it to read certain files that contain sensitive information. A sample is shown below:

```bash
vi ./.claude/settings.local.json
{
  "permissions": {
    "allow": [
      "Bash(mkdir:*)",
    ],
    "deny": [
      "Read(.env)"
    ]
  }
}
```

## 7\) Referencing a file/directory

You can use the @ symbol. Example:

```bash
> Review @js/application.js for mistakes
```

## 8\) Referencing an image

You can drag and drop the image into the terminal window.

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/20c0c0f6-dbc0-4d47-bd35-b89d03bc51f9.png)

## 9\) Cost

You can check the cost of the current session by using the / command below:

```bash
> /cost 
  ⎿ Total cost:            $0.0687
    Total duration (API):  39.2s
    Total duration (wall): 1m 55.2s
    Total code changes:    0 lines added, 0 lines removed
    Usage by model:
        claude-3-5-haiku:  7.7k input, 309 output, 0 cache read, 0 cache write
           claude-sonnet:  165 input, 620 output, 31.3k cache read, 17.2k cache write
```

Tips to save cost: [https://docs.anthropic.com/en/docs/claude-code/costs#reduce-token-usage](https://docs.anthropic.com/en/docs/claude-code/costs#reduce-token-usage)

## 10\) Development Partner Program

In the Anthropic console, you can enroll in the Partner program to get a better token rate.

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/4a37ffbf-b906-444c-b9cf-cc00ad2f0535.png)

Once enrolled, the label below is displayed when you use the tool.

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/575acf36-9b22-4749-b1bd-563b4d36a47e.png)

## 11\) Resume from a previous session

You can use the -r option to start Claude code and pick the session you want to resume.

```bash
claude -r
```

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/8d016146-39ac-4c9d-8643-2a32102bd0e5.png)

## 12\) Report bugs

Report bugs to Anthropic by using the / command below:

```bash
/bug
```

![](https://camy-pub.s3.ap-southeast-1.amazonaws.com/d7f62516-9aa9-47b7-b161-e873654ab8ce.png)

Enjoy coding with Claude :)
