← All docs
Getting Started

Claude Code Basics

Claude Code is a terminal-based AI coding agent built by Anthropic. It runs in your terminal, reads and writes files, executes commands, and iterates on code until the task is done. Here is everything you need to know to use it effectively on ShellPod.

Starting Claude Code

To launch Claude Code, navigate to your project directory and run:

cd ~/your-project
claude

This opens the interactive Claude Code session. You will see a prompt where you can type natural language instructions. Claude Code will read your project files, understand the codebase, and execute tasks.

One-shot commands

For quick tasks, you can pass a prompt directly without entering the interactive mode:

claude "Add a loading spinner to the submit button"
claude "Fix the TypeScript errors in src/utils.ts"
claude "Write tests for the auth middleware"

Claude Code will execute the task, make the changes, and exit. This is great for focused, single-purpose tasks.

Essential slash commands

Inside the interactive Claude Code session, several slash commands are available:

  • /help — Show all available commands and keyboard shortcuts
  • /clear — Clear the conversation history and start fresh
  • /compact — Summarize the conversation to free up context window space
  • /cost — Show token usage and cost for the current session
  • /doctor — Check your Claude Code setup for common issues
  • /init — Generate a CLAUDE.md file for your project

Understanding the agentic loop

What makes Claude Code powerful is its agentic loop. When you give it a task, it does not just generate code and stop. It:

  1. Reads your codebase to understand the existing code
  2. Plans the changes needed
  3. Makes the changes (creates, edits, or deletes files)
  4. Runs tests or build commands to verify the changes work
  5. Iterates if something fails — reads the error, fixes the issue, and tries again

This loop continues until the task is complete or Claude Code needs your input. You will see each step in the terminal output.

Giving good prompts

The quality of your results depends on the clarity of your instructions. Here are some tips:

  • Be specific about what you want: "Add form validation to the signup page that checks email format and password length (min 8 chars)" is better than "Improve the signup page"
  • Reference specific files: "In src/components/Header.tsx, add a mobile menu toggle" helps Claude Code focus
  • Describe the expected behavior: "When the user clicks Submit, show a loading state, call the API, and redirect to /dashboard on success"
  • Mention constraints: "Use the existing Button component from src/ui/button.tsx — do not create a new one"

Reviewing changes

Claude Code shows you what it is doing in real-time. You will see file reads, edits, and command executions in the terminal output. Before Claude Code makes any file change, you can configure it to ask for approval or run in auto-accept mode for faster iteration.

After Claude Code finishes, always review the changes:

git diff                    # See what changed
git diff --stat             # Quick summary of changed files
git log --oneline -5        # Recent commits if Claude Code committed

The CLAUDE.md file

One of the most important files for Claude Code is CLAUDE.md in your project root. This file gives Claude Code persistent context about your project — build commands, architecture decisions, coding conventions, and anything else it should know.

Generate one with:

claude /init

Or create one manually. A good CLAUDE.md includes:

  • Build and dev commands (npm run dev, npm test, etc.)
  • Project architecture overview
  • Key files and their purposes
  • Coding conventions (naming, patterns, etc.)
  • Things to avoid (security constraints, deprecated patterns)

See our CLAUDE.md Editor guide for using the dashboard editor to manage this file.

Keyboard shortcuts

When inside the Claude Code interactive session:

  • Ctrl+C — Cancel the current generation
  • Ctrl+D — Exit Claude Code
  • Up/Down arrows — Navigate through prompt history
  • Escape — Clear the current input

Getting help

If something is not working as expected, try these steps:

  1. Run /doctor to check for setup issues
  2. Run /clear to reset the conversation if Claude Code seems confused
  3. Check our Common Issues troubleshooting guide
  4. Visit the ShellPod Discord for community support