Claude Code MCP Servers: Add Real Tools in Minutes
How to wire MCP servers into Claude Code with claude mcp add: the three transports, the three scopes (local/project/user), and which servers to install first (June 2026).
Articles tagged with #Claude Code
How to wire MCP servers into Claude Code with claude mcp add: the three transports, the three scopes (local/project/user), and which servers to install first (June 2026).
Claude Code keeps prompting for a command you allowlisted. Fix it: prefix patterns with a trailing wildcard, split compound commands, and check the new OS sandbox fallback. Verified June 2026.
Claude Code starts a session but ignores your project CLAUDE.md. Run /memory to see what loaded, fix the path/casing, and resolve the cause in minutes.
A PreToolUse hook keeps rejecting Edit calls, even safe ones. The fix is almost always exit-code 2 logic, the deny-JSON format, stdin parsing, or matcher scope.
MCP tool calls in Claude Code time out or hang while a direct curl works. Usually stdio stdout pollution, the wrong startup vs tool timeout, a never-sent initialize, or a proxy that buffers SSE. Fixes verified June 2026.
A long Claude Code reply cuts off mid-sentence. Fastest fix: tell it to continue from the last line. Real cause is usually auto-compact, the per-reply output cap, or one huge tool result eating the budget.
Resume a Claude Code session and it acts like a fresh start — forgetting the plan, the decisions, the half-finished refactor. Diagnose compaction, broken transcript chains, and ephemeral tool results, then fix it.
Edited ~/.claude/settings.json but Claude Code ignores your hook, permission, or env? Run /doctor first. Usually JSON syntax, wrong scope, or precedence shadowing.
You added a SKILL.md under ~/.claude/skills/ but /<name> says not found, or it never auto-fires. Fix the path, frontmatter, description, or skill-budget issue in minutes.
Your Claude Code statusLine shows an error, stays blank, or stalls the prompt. Fix the JSON-on-stdin contract, missing jq, exit codes, slow git calls, and workspace trust.
A Task subagent finished cleanly but the main Claude Code session shows nothing, a generic summary, or claims it's still running. Fix the final-message, output-size, or routing problem in minutes.
Claude Code re-prompts for a Bash or Edit you already allowed. Usually the allow pattern is too narrow, lives in the wrong settings scope, or the command is compound — here is the exact fix.
One task burns through the context window, auto-compacts mid-refactor, and loses your plan. Decompose into smaller steps, push reads into sub-agents, and save state to disk.
A dev server or curl runs forever and Claude Code freezes on a spinner. Use run_in_background, set an explicit timeout, and kill stuck shells with /tasks. Verified June 2026.
Every Claude Code keyboard shortcut verified against the official docs (June 2026): the 6 permission modes, the Esc/Esc rewind, readline editing, custom keybindings, vim mode, and terminal fixes.
How Claude Code skills work as of June 2026: the SKILL.md frontmatter reference, auto-trigger vs /command invocation, dynamic context injection, subagent forks, and team sharing via plugins.
A current, hands-on reference to Claude Code's built-in slash commands as of June 2026: session lifecycle, /rewind checkpoints, /usage cost, /plan and /effort, subagent / hook / MCP extensions, plus what changed (/vim and /pr-comments are gone).
Claude Code swept your `.env` or API key into a commit. Rotate the key first (always), purge git history second, then block it for good with a deny rule, scanner, and push protection.
You asked for one function; the PR ships five "might be useful later" siblings nobody calls. Bound scope in the prompt and CLAUDE.md, auto-delete dead exports with knip --fix, and lock it in CI.
Claude Code turns tests green by adding .skip, deleting assertions, or loosening matchers. Block test edits with a PreToolUse hook, diff test files separately for skip markers, treat any test change as its own PR.
12 prompt templates to hand work between Claude Code subagents — research, plan, implement, review, ship — without losing context. Updated for June 2026.
15 architecture review prompts that surface real layering bugs, dependency cycles, and boundary leaks — with file:line evidence, not generic "consider DDD" advice.
Whole-repo audit prompts for Claude Code, Codex, and Cursor — architecture smells, dead code, security risks, dependency drift, and test gaps in one structured pass.
Use Claude Code, Codex, or Cursor agents to pre-review your PRs before a human sees them. Exact prompt, loop, and tool pricing for June 2026.
Install Claude Code, write a CLAUDE.md, run Plan Mode, and ship your first reviewed refactor. Exact commands, plan/cost details, and the beginner mistakes to skip.
Install Claude Code, write a CLAUDE.md, and run safe agentic edits. Pricing, models, permission modes, and a beginner workflow — current as of June 2026.
CLAUDE.md is the instruction file Claude Code loads every session. What to put in it, where to place it, and how it loads — verified against the June 2026 docs.
Set up Claude Code on a real codebase the right way — install, CLAUDE.md, permissions, and a safe first task — in about 30 minutes (June 2026).
A reusable Claude Code plan-mode prompt and a two-hour workflow that ships three reviewed SEO fixes on your content site.
A daily Claude Code workflow that survives past week one: the official Explore → Plan → Implement → Commit loop, plan mode, /clear and /compact context hygiene, subagents, and CLAUDE.md upkeep — with June 2026 plan and model specifics.
Claude connects to GitHub three different ways. Here's which one to use for code research, terminal commits, and automated PR review — with the exact setup as of June 2026.
12 copy-ready prompts to brief Claude Code (or Codex) on real engineering work — scoped features, surgical bug fixes, migrations, refactors, TDD, perf, CI debugging — mapped to Plan Mode and /rewind.
The agent said 'rolled back' but the migration, the dist/ bundle, a Stripe webhook, and a PostHog flag are still live. Here's the six-domain checklist and the exact inverse commands that finish the job.
Claude Code stops every few seconds to ask permission or to ask "TypeScript or JavaScript?" Two different problems, two fixes: a permission mode for tool prompts, CLAUDE.md defaults + Proactive style for decision questions.
Agent forgets earlier decisions, re-reads CLAUDE.md, contradicts the plan. Auto-compact dropped the load-bearing details. Run /rewind, re-anchor, or restart with a tight handoff.
You fed Claude Code a detailed audit and it did its own thing. The report is context, not a contract — convert it to numbered Tasks, execute one at a time, and diff progress against the original list.
Claude Code suggests "extract this into a microservice" when you're intentionally monolithic. Fix it with explicit do/don't rules in CLAUDE.md, path-scoped .claude/rules/, and a PreToolUse hook that hard-blocks drift.
The diff is polished code for the wrong feature. Catch the divergence at the plan stage with Plan Mode (Shift+Tab) and a restate-before-execute step, not after the code lands.
Two hours of uncommitted edits gone after the agent ran. Try /rewind first, then editor local history and reflog — then lock it down with commit-before-agent, deny rules, and worktrees.
You approved a 5-step plan; Claude did 7 steps, skipped one, and refactored adjacent code. Bind execution to the approved plan with file-anchored steps + post-step status checks.
Claude Code editing the wrong files, duplicating functions that exist, or missing key code? It's almost never the model — it's missing project context. Seven concrete ways to make Claude Code read your repo, verified for June 2026.
Asked for a one-file rename, got a 12-file diff? Enforce the boundary with a permissions deny rule, scope every prompt with an editable-file list, and park adjacent issues in FOLLOWUPS.md.
Claude Code halts a refactor with 'usage limit reached.' Tell apart the 5-hour window, the weekly cap, and the separate Opus cap, save state, and resume without redoing work. Verified for June 2026.
Claude Code did 60% of the task then went silent — no error, no completion. Diagnose which of three flavors (context compaction, tool hang, dropped stream) and recover without redoing work.
Claude Code repeats the same edit, oscillates between two files, or chases a flaky test forever. Six loop signatures, the one-prompt fix for each, and the exact Esc / rewind / clear / Stop-hook commands to recover. June 2026.
Claude Code changed a file you didn't intend (lookalike name or it followed an import chain). Revert with git, then lock the boundary with permissions.deny Edit rules in .claude/settings.json.
Claude Code + Codex (or two parallel sessions) edited the same function and produced a merge conflict. Isolate scopes with git worktrees, abort the broken merge, and resolve as a human — never let an agent merge.
Claude Code is a terminal agent; Cursor is an in-editor copilot. Compare pricing, models, rollback, and task fit with current 2026 numbers and a decision sheet.
A field-tested 2026 workflow for building a bilingual Astro content site with Claude Code: exact CLAUDE.md scaffolding, plan mode, deploy-cost math, and where the agent reliably trips.
Keep coding agents on-spec across a multi-file build: a CLAUDE.md/AGENTS.md template, a 3-part per-task prompt, and the spec-file rules that matter as of June 2026.
Claude Code is Anthropic's command-line coding agent. What it does, how it differs from ChatGPT and Cursor, what plan you need, and how to ship your first task in ten minutes.