Claude Code Guide 2026: Setup, Pricing, Context, and Token Usage
Learn Claude Code setup, model choices, context management, subscription versus API billing, token costs, and practical ways to reduce usage safely.
Learn Claude Code setup, model choices, context management, subscription versus API billing, token costs, and practical ways to reduce usage safely.
Claude Code is Anthropic's terminal coding agent. It can inspect a repository, explain code, edit files, run commands, resume sessions, use project instructions, and connect to external tools. You can access it through an eligible Claude plan or use an API key with token-based billing.
This guide was checked against Anthropic's official setup, usage, and pricing documentation on October 21, 2026. Model availability and prices change, so verify the linked sources for your account.
Anthropic's documentation supports macOS, Linux, and Windows environments, with installation choices changing over time. Follow the current Claude Code setup guide, authenticate, open a terminal in your repository, and start Claude Code. Run its diagnostic command after installation if the client reports an update or environment problem.
| Sign-in method | How usage is measured | How to inspect it |
|---|---|---|
| Eligible Claude plan | Included usage with account-specific rolling limits | Limit message and account usage view |
| Anthropic Console API key | Pay as you go by model tokens and tools | /cost and Console billing |
| Bedrock, Vertex AI, or Microsoft Foundry | Provider billing and quotas | Cloud-provider usage tools |
With API billing there is usually no subscription-style hard stop: the account continues to incur charges within its configured limits. With a plan, usage resets according to the allowance shown for the account. Anthropic recommends /model to check or change the model and /cost to inspect API-backed session cost. See the official models, usage, and limits guide.
Each turn can include the conversation history, project instructions, files Claude has read, tool definitions, command results, and the new prompt. Output includes explanations, proposed code, tool calls, and responses. Long sessions therefore resend and process more context even when the visible prompt is short.
Anthropic publishes prices per million tokens and distinguishes base input, cache writes, cache reads, and output. As of the review date, the official table lists Claude Sonnet 5 at $2 per million input tokens and $10 per million output tokens, Claude Opus 5 at $5 and $25, and Claude Haiku 4.5 at $1 and $5. Exact models available inside Claude Code depend on your account and can differ from the API catalog.
For example, a Sonnet 5 API session processing 200,000 uncached input tokens and generating 20,000 output tokens would cost about $0.60 before tool charges: $0.40 input plus $0.20 output. This is an illustration, not a promise of what a coding task will consume. Read Anthropic's current model pricing table.
The context window limits what a model can consider in a request. It is different from the account's usage allowance. Claude Code can compact older conversation content as a session grows. Use /context to inspect loaded context, /compact to summarize history, and /clear when the next objective does not need the earlier conversation.
Inspect the authentication refresh flow. Do not edit yet. Identify the source of duplicate refresh requests, list the smallest files involved, and propose a test that fails before the fix. After I review the plan, implement only that scope and run the focused test plus type checking.
This prompt separates investigation from mutation, provides a boundary, and specifies evidence. It often uses fewer tokens than repeated corrections after an unconstrained first attempt.
A terminal agent can be powerful enough to alter files, install packages, call network services, and run destructive commands. Use version control, inspect commands, restrict network access, and keep production secrets outside the readable workspace. Treat MCP servers and plugins as additional software dependencies with their own permissions and data paths.
Compare Claude Code with OpenAI Codex if you want another terminal and cloud agent workflow. Consider Cursor for an AI-first editor, GitHub Copilot for a GitHub-centered workflow, or Gemini Code Assist for Google Cloud integration. See the full AI coding tools comparison.
Anthropic documents Claude account authentication for eligible plans, but availability and limits depend on the current plan and region. Check the account's plan page before subscribing.
For API-backed sessions, use /cost and the Console dashboard. Use /context to inspect loaded context. Subscription sessions show allowance and reset information rather than a simple API invoice.
Earlier conversation, files, instructions, and tool results can remain in context and be processed again. Compaction, caching, selective file reads, and fresh sessions can reduce repeated input.
Yes, Anthropic's current setup guide lists Windows support paths. Follow the official instructions because the recommended installation method can change.
Prepared with AI assistance and reviewed against the sources cited in the article. Product details may change after publication.
Explore related topics
Software Engineer with 5+ years of experience specializing in scalable web systems, modern full-stack architecture, and technical research.
Continue reading
Artificial IntelligenceUnderstand how Codex works across local and cloud workflows, how plan limits differ from API token billing, and how to control context, cost, and permissions.
Artificial IntelligenceUnderstand Cursor plans, model context windows, token-based usage, Agent workflows, privacy controls, and how to estimate the cost of real coding tasks.
Artificial IntelligenceLearn how GitHub Copilot agents work, compare current plans and AI credits, understand token-based usage, and follow a practical setup and evaluation workflow.