No history yet

Agentic Environment Setup

Setting Up Your Agentic Workspace

Moving from a chat interface to an agentic workflow means giving your AI assistant direct access to your development environment. Instead of copying and pasting code, you'll use the Claude Code command-line interface (CLI) to let the agent read files, run commands, and operate directly within your terminal. This creates a much tighter feedback loop.

First, you need to install the CLI. Since it's a Node.js package, you can install it globally using npm. This makes the claude command available anywhere in your terminal.

npm install -g @anthropic-ai/claude-code-cli

After installation, you'll need to authenticate. The first time you run a command, the CLI will guide you through the login process, linking the tool to your Anthropic account.

Initializing Your Project

Every agentic project begins with establishing a shared understanding. The /init command is your starting point. When you run it inside a project directory, it creates a CLAUDE.md file.

/init

This file is the single most important piece of context you can give the agent. It serves as a persistent 'project README' for Claude, codifying the rules, patterns, and conventions it should follow. By defining these upfront, you ensure the agent aligns with your existing technical stack and project standards without constant reminders.

The claude.md file is your main way to share state, context, and instructions with Claude Code,across sessions and team members.

A good CLAUDE.md file might outline your project's architecture, define naming conventions, specify the testing library to use, and list key dependencies. It acts as the agent's ground truth.

# CLAUDE.md

## Project Overview
This is a React front-end application built with Vite and TypeScript. It communicates with a REST API for data.

## Coding Style & Conventions
- Use functional components with React Hooks.
- Component file names should be PascalCase (e.g., `UserProfile.tsx`).
- State management is handled with Zustand. Do not introduce Redux.
- All new components must have corresponding tests using Vitest and React Testing Library.
- Use `pnpm` for package management.

Managing Sessions and Context

Claude Code tracks your interaction within a session, which is identified by a unique session ID. This allows it to maintain context, remember previous commands, and track token costs. If you get disconnected or close your terminal, you can resume your work exactly where you left off by referencing that session ID.

Modern development often involves working across multiple repositories. For example, you might be working on a web client and a backend API simultaneously. You can provide Claude Code with this multi-directory context using the --add-dir flag.

# Start a session in the main project directory
claude

# Inside the session, add another directory to the context
/add-dir ../my-api-service

This command gives the agent access to both project folders, allowing it to reason about and make changes across the full stack. This is far more powerful than feeding files to a chatbot one by one. You can also manage project-specific settings in CLAUDE.md while keeping your personal preferences, like your favorite editor, in a user-scoped configuration file.

Quiz Questions 1/5

What is the primary function of the CLAUDE.md file in a project using the Claude Code CLI?

Quiz Questions 2/5

How can you provide the Claude Code agent with access to multiple, separate project directories, such as a web client and a backend API?