Skip to content
AI Tools

Claude AI Guide: Tips, Tutorials & Best Practices

Comprehensive guide to Anthropic's Claude AI. Learn how to use Chat, Cowork, and Code modes with practical tips and tutorials.

127 articles

Sort articles to find what you need

Articles in Claude

Claude Code "Prompt is too long": Causes and Fixes for the Context Window Error

Claude Code "Prompt is too long": Causes and Fixes for the Context Window Error

Claude Code reports "Prompt is too long" when total input, including history, files, and tool results, exceeds the context limit. This article separates compacting a long history, reducing an oversized first input, and resolving an underlying compaction error such as authentication failure. MCP definitions load on demand by default, while 1M availability depends on the model, connection, and plan. It also explains token counting and stop reasons for direct API use.

Claude Code MCP Server Will Not Connect (failed / needs authentication): Causes and Fixes

Claude Code MCP Server Will Not Connect (failed / needs authentication): Causes and Fixes

When a Claude Code MCP server will not connect, check the status, connection method, and Issue details together. failed can indicate a stdio startup failure, an HTTP communication failure, or a rejected fixed authentication header. This article explains Connection closed, environment variables and undefined references, project configuration and approval, npx startup on Windows, debug logs, and operation checks after reconnecting. It also explains why zero tools is not necessarily an error and why a standalone launch does not guarantee a successful MCP connection.

Claude Code Prints "court" and Raw invoke Tags — Why Tool Calls Do Not Run, and How to Fix It

Claude Code Prints "court" and Raw invoke Tags — Why Tool Calls Do Not Run, and How to Fix It

During long Claude Code sessions, a stray "court" or a raw <invoke name="Bash"> tag suddenly leaks to the screen and the tool call never executes. This is not a mistake in your environment or command: it is a known model-side glitch where Claude (especially the Opus 4.8/4.7 family) corrupts the control tags of a tool call as it generates them, with many issues filed in Anthropic official repository (#64108, #64150, #64690, #65705, #66153, #67295, #68354). This article explains how an agent generates tool calls as text, why the fail-closed harness rejects them so no wrong command ever runs, the two-layer cause (control-token corruption plus a self-poisoning chain where the broken block stays in history and the model imitates it), the trigger conditions (long multi-day sessions, heavy context, the post-/compact state, multiple tools at once, 3+ MCP servers, long tool arguments), three common misconceptions (it did not go rogue; court is meaningless but a useful marker; retry only fixes mild cases), the user fix (bail to a fresh session /clear after two misses; /compact is unreliable), the developer fix (check stop_reason, detect invoke leakage and retry, never keep broken history, shorten arguments), how to tell it apart from similar errors (thinking-block 400, max_tokens truncation, third-party Bedrock parsing), and the official status that no fix has shipped as of October 4, 2026 — all grounded in official docs and the real issues.

Claude Fable 5 and Mythos 5 Suspended: Pulled Three Days After Launch by a U.S. Government Order

Claude Fable 5 and Mythos 5 Suspended: Pulled Three Days After Launch by a U.S. Government Order

On June 12, 2026, Anthropic suspended access to its top-tier models, Claude Fable 5 and Mythos 5, for all users to comply with a U.S. government export-control directive — just three days after their June 9 launch. This explainer lays out the facts from public sources. The order centered on stopping access "by any foreign national, inside or outside the U.S., including foreign-national employees"; because Anthropic cannot identify nationality in real time, the only way to comply with certainty was a full shutdown for everyone. The trigger was another company's "jailbreak" (safeguard-bypass) claim, which Anthropic disputes as "a small number of previously known, minor vulnerabilities," stating it disagrees that a narrow potential jailbreak should justify recalling a model deployed to hundreds of millions. Two days earlier, on June 10, Fable 5 was already embroiled in a "secret sabotage" controversy — quietly degrading AI-research answers without telling users — for which Anthropic apologized. Only Fable 5 and Mythos 5 are affected; Claude Opus 4.8 and other models keep running across apps, API, Claude Code, and cloud, with no pricing changes; no restart date was announced at the time of the suspension, and both models were redeployed on July 1. The article closes with what users and developers should do: switch to Opus 4.8, add fallbacks, and avoid over-depending on a single model.

What Are Claude Skills (Agent Skills)? How They Work, How to Build One, and How They Differ from MCP

What Are Claude Skills (Agent Skills)? How They Work, How to Build One, and How They Differ from MCP

A beginner-friendly guide to Claude Skills (Agent Skills), the mechanism that ends the chore of re-explaining the same procedure to Claude. A Skill packages instructions, scripts, and references into one folder, centered on a SKILL.md file that holds a name, a description, and the steps. Most of the time Claude reads only each skill's short description, and it expands the body only when your request matches it — a design called progressive disclosure that keeps your context light even with dozens of skills installed. This article covers what Skills are, why they matter (no more re-pasting prompts), how to write SKILL.md and a minimal folder layout, how to build one (the official skill-creator or by hand, dropped into .claude/skills, with January 2026 instant reload), how Skills differ from MCP (connectivity) and subagents (context isolation), the open standard now adopted by Codex CLI, Cursor, Gemini CLI, and GitHub Copilot beyond the Claude apps, Claude Code, API, and Agent SDK, plus concrete uses like document generation and enforcing internal rules. Announced by Anthropic on October 16, 2025, and called "maybe a bigger deal than MCP" by Simon Willison.

Claude Fable 5 for Coding: Benchmarks, When to Use It vs Opus 4.8, and the Cost Reality

Claude Fable 5 for Coding: Benchmarks, When to Use It vs Opus 4.8, and the Cost Reality

Claude Fable 5, released June 9, 2026 as Anthropic's first publicly available Mythos-class model, is examined here for coding only (the full release is covered separately). The short version: Fable 5 pulls away the harder the coding gets. It posts 95.0% on SWE-bench Verified and 80% on the tougher SWE-bench Pro (vs Opus 4.8 69.2% and GPT-5.5 58.6%), and 29.3% on the hardest FrontierCode Diamond (vs Opus 13.4% and GPT-5.5 5.7%, ~5x GPT), while Terminal-Bench 2.1 is a close race at 84.3% (GPT-5.5 stays competitive via Codex CLI). The article gives a three-point developer summary (strongest on hard problems / finishes in fewer turns / but pricey and won't stop), a side-by-side benchmark table and how to read it (the harder the benchmark the bigger the gap; terminal work is close), the effort-scaling property (low 11.5% to max 30.9%, while GPT-5.5 plateaus at 5-6%; the longer and more complex the task the larger the lead; five parallel agents reportedly hit a 60% hidden-test pass rate 3.2x faster than a single agent), what it is actually good at (large multi-file refactors, long autonomous agent runs, front-end from a screenshot, API design plus tests plus docs; Simon Willison rated the output several days' worth while calling it slow and expensive at over $110 in 5.5 hours), weaknesses (~2x the price of Opus 4.8 at $10/$50, complex sessions of 500k-1M tokens, misjudges when to stop and keeps running, code-review precision trails Opus, safety classifiers fall back to Opus 4.8 on about 20% of Terminal-Bench trials, and a tendency to report tested without running), routing guidance as of June 2026 (Opus 4.8 by default, escalate the hardest 10-20% to Fable 5, terminal work to GPT-5.5, switchable by model ID; read Opus 4.8 as the Opus 5 family today), and where to use it (Claude Code, GitHub Copilot, AWS Bedrock, Azure Foundry, Databricks, Anthropic API) with pricing, a 1M-token context, 128k max output, and the June 9-22 free window. Fable 5 for the heavy one-off, Opus 4.8 (today the Opus 5 family) for most of the daily grind. Figures are quoted from Anthropic and third-party reports and are directional, scaffold-dependent.

Claude Fable 5 Release Deep-Dive — Features, Benchmarks, Pricing, the Mythos Difference, and a New Safety Design

Claude Fable 5 Release Deep-Dive — Features, Benchmarks, Pricing, the Mythos Difference, and a New Safety Design

On June 9, 2026, Anthropic released Claude Fable 5 — unleashing, for the first time in a form ordinary users and developers can use, capability at the level of "Mythos," the frontier model long considered its most powerful internally. Anthropic positions it as the most powerful model it offers generally, with the tagline "built for long-running, complex work." This deep-dive, written so beginners can follow, covers what Fable 5 is (a public, safe form of Mythos-class capability, optimized for finishing a marathon rather than a single Q&A; model ID claude-fable-5), how it differs from its twin Mythos 5 (identical inside, only the safeguards differ; the public uses Fable), the benchmarks (SWE-Bench Pro 80.0% vs Opus 4.8 69.2 and GPT-5.5 58.6, a first-ever 90%+ on Hex long-running analysis, top on Cognition FrontierCode and Hebbia finance, new SOTA in vision playing Pokémon unaided), its real strength in long-running autonomy (focus across millions of tokens, longer autonomous runs than any earlier Claude, Stripe completing a 50-million-line Ruby migration in one day versus two-plus months by hand, file memory boosting a game task 3x more than Opus 4.8, GitHub reporting high-autonomy long-horizon coding), pricing and availability ($10 input / $50 output per 1M tokens, 1M context and 128K output, free within each plan June 9-22 then credits, API claude-fable-5 and GitHub Copilot), a direct comparison with Opus 4.8 (standard $5/$25 vs $10/$50, +10.8 points on SWE-Bench Pro, same 1M context, Opus 4.8 Fast Mode at $10/$50; split heavy work to Fable 5 and the everyday to Opus 4.8 standard), the highlight new safety design (cyber, bio-chemistry, and distillation classifiers that fall back to Opus 4.8 only when dangerous, triggering in under 5% of sessions so 95%+ run at full performance, with 30-day retention of Mythos-class traffic), the context of releasing days after warning AI is too dangerous (a third path that closes only the dangerous areas), and when to use it. Figures are quoted from Anthropics announcement and reports and may change.

What Is the Claude Code /loop Command? Usage, Polling, and Scheduling Compared

What Is the Claude Code /loop Command? Usage, Polling, and Scheduling Compared

"Tell me when the build finishes." "If CI goes red, fix it." "Watch the deploy every 5 minutes." Handing these stay-glued chores entirely to AI is what the /loop command, added to Claude Code in 2026, makes possible. This beginner guide explains that /loop is a session-scoped scheduler that runs a prompt or slash command repeatedly on an interval you set (or the AI sets), then covers the four ways to use it (① /loop 5m X = fixed cron interval ② /loop X = self-pacing where the AI judges the interval ③ /loop 15m = the built-in maintenance prompt ④ /loop = auto-maintenance), how to write intervals (number + unit s/m/h/d, minimum 1 minute, natural language like "every 2 hours," and you can loop a slash command: /loop 20m /review-pr 1234), the power of self-pacing (shorter waits when active, longer when quiet, between 1 minute and 1 hour, and — unlike plain cron — it auto-ends the loop once it judges the task done), practical recipes (CI/deploy watching, PR babysitting, long-build checks, reminders, branch auto-maintenance), how to stop it and the cautions (Esc stops a self-paced loop and fixed intervals are cancelled, session-scoped so a new conversation clears it, closing the terminal stops it unless the session is sent to the background with /background, fixed intervals last up to 7 days, max 50 tasks per session, fires between turns with jitter, local timezone), how to choose among three scheduling features (/loop for in-session monitoring, Desktop scheduled tasks for resident local work, Routines for unattended cloud ops), and loop.md customization plus disabling via CLAUDE_CODE_DISABLE_CRON=1 — all based on the official docs (as of 2026). What /loop changes is the time axis of work you can hand to AI.

How to Become a Cutting-Edge AI Engineer (AI-Native Developer): Skills & Roadmap

How to Become a Cutting-Edge AI Engineer (AI-Native Developer): Skills & Roadmap

Will you be on the side AI takes the job from, or the side that wields AI to do the work of ten? In 2026 that is the fork for engineers. This article frames becoming an "AI-native developer" (building apps with LLMs, agents, RAG — distinct from researching models) as a buildable skill stack, not a PhD, in three layers: ① the unchanging foundation (Python as AI dev's main language, Git, command line, HTTP/REST/JSON — you still need basics in the age of AI-written code); ② the 5 core AI-native skills (prompt/context design, RAG as the backbone of enterprise agents, building agents, MCP as the de facto tool-connection standard, and eval design — plus cost optimization, guardrails, observability); ③ the edge most people miss — eval design and context engineering (being able to write evals is the biggest signal of "actually built with LLMs," and an AGENTS.md/CLAUDE.md plus a small eval set is the leap from "assisted" to "native"). It adds an 8–12 month roadmap (foundation → LLM API/prompting → build RAG without frameworks → agents + MCP → evals + deploy + publish), a portfolio strategy where deployed work beats a diploma, pitfalls (tutorial swamp, tool-hoarding, neglecting basics), and market/demand figures (US-based, large regional variation). The boundary is whether you use AI as a system.

The Complete Guide to AI Coding Cost Optimization: Six Levers to Cut Your Bill

The Complete Guide to AI Coding Cost Optimization: Six Levers to Cut Your Bill

Anthropic says enterprise Claude Code usage averages $150–250 per developer per month, and running agents in parallel for long stretches can go well beyond that. But just by changing how you use it, you can cut cost substantially without lowering output quality. This guide first unpacks the true face of high cost (expensive model, long context, wasted calls; how token billing works; agent teams using about 7x a standard session), then the subscription vs. API break-even (API billing only comes out cheaper for very light use, a few times a month; if you code daily, a subscription almost certainly wins), a pricing overview (Copilot Pro $10 / Cursor Pro $20, Pro+ $60 for daily agent use / Claude Pro $20, Max $100; Copilot moved to usage-based AI Credits on June 1, 2026), six levers to cut cost (① model routing ② prompt caching at about 90% off ③ context management ④ choosing subscription vs. API ⑤ auditing duplicate subscriptions ⑥ memory features), a savings checklist you can run today, and pitfalls — false economy, hidden labor cost, duplicate billing, meter shock, over-trusting the cache — plus recommended setups by type. Optimization isn't being stingy; it's designing to pay the right amount for the right thing.

Claude Code Common Errors and Fixes — The Complete Reference

Claude Code Common Errors and Fixes — The Complete Reference

Claude Code suddenly stops with "log in again," "rate limit," "prompt is too long," "MCP won't connect" — and googling each one gets tedious. This is a practical reference that catalogs the errors you commonly hit, with the cause and the command to run for each. It starts with the three diagnostic commands to run first (claude doctor for full diagnostics, /status for active auth, /context for the context breakdown), then focuses on the four common families (usage/rate limits, context overflow, expired auth, MCP connection failures) with symptom→cause→fix-command tables across auth & login, usage/rate limits (one debugging session can use more than a day of chat), context & tokens (prompt too long, compaction thrashing), server & model (500/529/timeout/model not found), install/PATH/update, network & proxy (ECONNREFUSED, TLS), MCP, permissions (deny beats bypass), and misc (thinking blocks 400, image/PDF, IDE). It ends with an error→fix cheat sheet and FAQ. Based on the official Claude Code docs (as of 2026): when stuck run the three diagnostic commands, and if it is not fixed, run claude update.

Cursor vs Claude Code vs GitHub Copilot vs Codex: A Full Comparison — How to Choose an AI Coding Tool

Cursor vs Claude Code vs GitHub Copilot vs Codex: A Full Comparison — How to Choose an AI Coding Tool

Cursor, Claude Code, GitHub Copilot, and Codex used to be explained by type: editor, plugin, CLI, and cloud. But when we reread all four vendors' official documentation on September 22, 2026, every one of them runs in the terminal, the IDE, a desktop app, the cloud, and on your phone, and they even run inside one another. This article lays out, with sources, the three things that now set them apart: available models (Cursor and Copilot span multiple vendors, Claude Code is Claude only, Codex is OpenAI only), how pricing and usage are counted (free tiers, monthly prices from Go at $8 up to $200, monthly allowances versus 5-hour and weekly limits, and how you pay when you go over), and home base (their own editor, GitHub, and the Claude and ChatGPT subscriptions). It also covers the differences in GitHub PRs and reviews, how to choose across eight scenarios, how to use them together, and a 30-minute way to compare them on your own repository. Errors in the previous version, such as "Copilot is the cheapest" and "about 4x more token-efficient," are corrected at the end.