← Blog

Claude Code by Anthropic: How to Actually Use It

2026-09-13 · 5 min read · SubToAPI Team

Claude Code is Anthropic's command-line tool that lets Claude read, write, and run code directly in your terminal and project directory. If you're searching for how to use it, the short answer is: install it via npm, run claude inside your project folder, and start giving it plain-English instructions — it will read your files, propose edits, run tests, and commit changes with your approval at every step.

This guide covers the practical parts people actually get stuck on: installation, authentication, the commands you'll use daily, and how to structure a session so Claude Code is actually useful instead of just noisy. It also covers what to do once you outgrow the terminal and need programmatic access to Claude from your own application.

What Claude Code Is (and Isn't)

Claude Code is not a chat window bolted onto your editor. It's an agentic CLI that operates on your actual codebase: it reads files, greps for context, edits code, runs shell commands, and can execute your test suite. You stay in the loop — it asks for permission before running anything destructive by default — but the workflow is closer to pairing with a very fast junior engineer than typing prompts into a box.

It's separate from the Claude web app and separate from calling the Claude API directly. Claude Code uses your Anthropic account (Pro, Max, or API billing) for usage, and it's built specifically for coding tasks: refactors, debugging, writing tests, exploring unfamiliar repos, and shipping small features end to end.

Installing and Signing In

Claude Code installs through npm:

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

Once installed, cd into any project directory and run:

claude

The first run walks you through authentication — either your Anthropic account credentials or an API key, depending on your plan. After that, Claude Code has context on the current directory and you can start giving it instructions in plain language.

Core Commands You'll Actually Use

A handful of commands cover most day-to-day work:

Inside a session, you talk to Claude the way you'd brief a teammate: "the login form doesn't validate empty emails, fix it and add a test." Claude reads the relevant files, makes the edit, runs the test, and shows you a diff before anything is finalized (unless you've explicitly allowed auto-execution for that session).

A Realistic Workflow

The tool is most useful when you give it a tight, well-scoped task rather than a vague one. Compare these two prompts:

Too vague: "Improve the codebase."

Actually useful: "Add input validation to the signup form in src/forms/Signup.tsx, matching the pattern already used in Login.tsx, and add a unit test."

Claude Code performs best when it can point at existing patterns in your repo and follow them. For larger tasks, break the work into stages — ask it to plan first ("outline the steps to migrate this component to the new API, don't write code yet"), review the plan, then let it execute stage by stage.

For debugging, give it the actual error output and the file where it originates rather than a general description. It will search the codebase for related code, form a hypothesis, and test it — much faster than doing that manually across an unfamiliar repo.

Reviewing and Committing Changes

Claude Code shows diffs before writing to disk. Get in the habit of actually reading them, especially for multi-file changes — it's easy to approve a batch of edits on autopilot and miss something. For git operations, you can ask it directly:

claude "stage the changes, write a commit message summarizing the fix, and commit"

It will draft a commit message based on the actual diff rather than a generic placeholder, which is usually better than what gets typed in a rush at 6pm.

When You Need Claude in Your Own Product, Not Your Terminal

Claude Code is built for developers working locally. It's a different problem once you're building a product that needs to call Claude programmatically — a support tool, an internal automation, a SaaS feature — where you need a stable HTTPS endpoint, API keys you can rotate per environment, and usage visibility across a team, not a terminal session.

That's what SubToAPI is for. It turns your existing Claude access into a proper API: you get sub_live_... keys, streaming responses, tool use, and per-key usage metadata, without setting up separate billing or infrastructure. If you've been using Claude Code for development and now want the same model behind a feature in your app, the quickstart will get you a working request in a few minutes, and the messages and streaming docs cover the request formats. Plans start at €9/month with a free trial — see pricing — and you can generate a key right away at signup.

Practical Tips

Questions

Does Claude Code work with any programming language? Yes. It's language-agnostic — it reads and edits whatever files exist in your project, from Python and JavaScript to Rust, Go, or config files like YAML and Terraform.

Is Claude Code the same as calling the Claude API? No. Claude Code is a terminal-based coding agent tied to your Anthropic account. If you need to call Claude from your own application code, you need direct API access — see the tools documentation for function-calling and integration patterns.

Can I use Claude Code without giving it permission for every action? Yes, you can allow specific commands or auto-approve certain actions for a session, but it's safer to review file-editing and shell commands individually until you trust the workflow on a given project.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →