claude-code-setup-guide

mcp
Guvenlik Denetimi
Uyari
Health Uyari
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Gecti
  • Code scan — Scanned 2 files during light audit, no dangerous patterns found
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Complete Claude Code configuration guide — permissions, MCP, hooks, skills, subagents, agent teams (July 2026)

README.md

Claude Code: Complete Configuration Guide (December 2026)

A comprehensive, tech-stack-agnostic guide for configuring Claude Code from scratch — written to be executed by a Claude agent as well as read by humans (see For Agents).
Verified against official Anthropic documentation, the official changelog, and live package registries on 2026-12-02 (Claude Code 2.1.334; default model is Claude Opus 5.5 on every plan and provider except Microsoft Foundry (Sonnet 5.5 since 2.1.332); auto mode is the built-in starting permission mode for interactive sessions since 2.1.283, while claude -p and Agent SDK runs start in Manual mode since 2.1.302).

The guide is split into chapters. Each chapter's YAML frontmatter states what it covers, when to read it, and the version it was verified against. Machine-readable index: llms.txt.

Table of Contents

Phase 1: Foundation (Universal — Every Project)

# Chapter What it covers Read when
1 Architecture Overview & File Layout Extension layers, context costs, directory structure, loading precedence Always — read first
2 CLAUDE.md & Memory Content rules, 2026-style templates, imports, native AGENTS.md support, auto memory, /init, /doctor prompt-audit Always
3 Rules Modular guidelines, path-scoped rules, symlink sharing, recommended rule files Standards span several domains, CLAUDE.md is growing toward the official 200-line target, or different rules should apply to different paths
4 Permissions, Modes & Sandboxing Which mode a session starts in (auto by default), rule syntax and limits, ask checkpoints, plan mode, auto-mode classifier config, headless flags (-p starts in Manual), workspace trust, sandbox, Code Mode Always — before installing anything

Phase 2: Core Tooling

# Chapter What it covers Read when
5 Plugins Official marketplace, 13 LSP plugins, service integrations, claude-code-setup, community marketplaces, security, budget Language has an LSP plugin, or team services have official plugins
6 MCP Servers Tool search (deferred loading), transports and the 2026-07-28 protocol, scopes, OAuth from the shell, timeouts, verified server recommendations External services needed beyond plugins (DBs, browsers, trackers), or an MCP server misbehaves or its tools seem missing
7 Hooks All 34 lifecycle events, 5 hook types, handler fields (if, timeout, onFailure, async), tested ready-to-use configuration Always — must-hold rules belong in hooks

Phase 3: Project-Specific Configuration

# Chapter What it covers Read when
8 Skills & Slash Commands SKILL.md format, invocation control, arguments, bundled skills, community skills The same instructions keep being repeated, a CLAUDE.md section has grown into a procedure, or you need the bundled-skill or SKILL.md field reference
9 Subagents Frontmatter reference, nesting and concurrency limits, model selection order, forks (/subtask), memory, worktree isolation, recommended agents Delegatable roles fit (review, planning, build fixing), heavy exploration or log-reading floods the main context, or you need the subagent field reference or are troubleshooting unused agents
10 Agent Teams, Workflows & Multi-Agent Networks Agent teams, dynamic workflows / ultracode, background sessions, Agent SDK, MCP & A2A interconnect A task needs more agents than one conversation can coordinate, Agent SDK integration is needed, or agents must connect across tools or vendors (MCP, A2A)

Phase 4: Advanced Workflows

# Chapter What it covers Read when
11 Context Management What each feature costs, the 400K auto-compact default, what survives compaction, /compact, /autocompact, idle compaction, prompt cache, /btw, /branch, checkpoints Sessions run long, usage and cost climb, or the codebase is large
12 Monorepos & Parallel Workflows Hierarchical CLAUDE.md, claudeMdExcludes, native worktrees (claude -w), background sessions on this machine (claude --bg, claude agents) Repo is a monorepo, or several sessions run in parallel on one machine
13 Editors & CI/CD IDE integrations, claude-code-action@v1 (official workflows), the Code Review product, GitLab CI/CD, headless claude -p --bare Project has CI (GitHub Actions, GitLab), IDE integration is wanted, or Claude runs unattended in scripts
14 Vercel Integration Official Vercel plugin, official MCP server, Vercel agent skills, deploy skill Project deploys to Vercel
16 Project Documentation for Agents Layered docs structure, router index + read-when navigation, change→doc trigger map, REVIEW.md, maintenance automation (validator/drift/commit-gate hooks, /update-docs skill, scheduled doc-sync) The project needs docs agents can find and load on demand, project knowledge outgrows CLAUDE.md, docs drift from the code, or a doc-maintenance workflow is being set up
17 Cloud Sessions, Scheduled Tasks & Cross-Session Messaging Cloud sessions (claude --cloud, Projects, auto-fix PRs), what a cloud VM gets from your setup, cloud scheduled tasks (formerly Routines) and other schedules, cross-session messaging, channels, self-hosted environments Work must run unattended, on a schedule, or in the cloud; sessions must coordinate across machines; or a cloud or self-hosted environment must be configured
18 Verification & Shipping The verify skill and evidence rules, /code-review before push, /ship and /steward, Code Review, PR Steward and Claude Approvals (.claude/approvals.yml), rolling out gates in observe mode Claude opens or maintains pull requests, the project needs review and merge gates, or you are setting up how Claude verifies its own work

Reference

# Chapter What it covers Read when
15 Reference Keyboard shortcuts, built-in commands, CLI flags, model aliases and defaults, which model and effort to pick, fast mode, troubleshooting Looking up a command/flag/shortcut/model, or troubleshooting

For Agents: Self-Configuration Procedure

This guide is written to be executed by a Claude agent configuring a project. Machine-readable index: llms.txt. Each chapter's YAML frontmatter carries description, read_when, verified, and claude_code_version. Outside a clone, fetch raw files from https://raw.githubusercontent.com/AlexandrG539/claude-code-setup-guide/main/<path> (e.g. chapters/04-permissions.md).

One-command setup: install the self-configure skill to ~/.claude/skills/self-configure/SKILL.md once, and /self-configure runs this procedure in any project:

mkdir -p ~/.claude/skills/self-configure && curl -s https://raw.githubusercontent.com/AlexandrG539/claude-code-setup-guide/main/templates/self-configure/SKILL.md -o ~/.claude/skills/self-configure/SKILL.md

Procedure (standing instructions for the whole configuration task):

  1. Inspect the project first: languages, package manager, frameworks, repo shape (single package or monorepo), existing .claude/ and CLAUDE.md, CI provider, deploy target. Route by facts found, not by assumptions.
  2. Read the core chapters in order: 1, 2, 4, 7. Read the others only when their Read when condition (TOC above, or chapter frontmatter) matches the project.
  3. Apply configuration in chapter order: CLAUDE.md and .gitignore entries (Ch. 1, Ch. 2) → permissions → plugins/MCP → hooks → skills/subagents → CI. Use the chapter templates verbatim; adapt only project-specific values (commands, paths, branch names). Omit template sections that don't apply to the project type (a docs-only repo has no test or typecheck commands) and sections you cannot fill from what inspection found — never leave a placeholder. Two fixed points: the Ch. 2 CLAUDE.md template references a verify skill, so for every project with something runnable create it from the Ch. 18 template (read that section even when no other Ch. 18 trigger matches), and drop the reference line when nothing is runnable; for CI, recommend /install-github-app (Ch. 13) and do not write workflows that need secrets unless the user asks.
  4. Rules that must always hold (formatting, protected files, protected branches) go into hooks, not CLAUDE.md prose — hooks are enforced, prose is advisory. Before installing the Ch. 7 hooks, check command -v jq: they parse their input with jq, and because the policy hooks set onFailure: "block", a missing jq blocks every Bash, Edit, and Write call — have the user install jq first.
  5. Verify what is checkable immediately: settings files parse as valid JSON, hook commands exit correctly when fed sample stdin (for hooks that can block, test both the pass and the block path; for the others — formatters, notifications, warnings — test that the hook acts on a matching input and does nothing on a non-matching one), referenced scripts and skills exist, templates landed where intended. Claude Code reloads edited settings files in the running session, permissions and hooks included, so the hooks you just installed apply to your own later commands — a block from one of them is the configuration working, not an error to route around. Then ask the user to confirm in a fresh session — /context all (Memory files section lists the CLAUDE.md and rules actually loaded; nothing oversized), /permissions (rules registered, correct source file), /hooks (hooks registered). The fresh session is what shows the configuration as every later session will load it: CLAUDE.md and rules load at session start, and those three commands are run by the user, not by you. /doctor (and /doctor prompt-audit, 2.1.283+) reviews the result for derivable content and outdated prompting patterns.
  6. Expect harness guardrails: interactive sessions start in auto mode by default (2.1.283+), where a classifier blocks risky actions instead of prompting — writing settings files that grant allow rules, and force-pushing, may be blocked for user review. The classifier itself allows a plain push to any branch, including the default one; in this guide's setup such a push is stopped by the Ch. 7 branch-protection hook or prompts through the Ch. 4 ask rule. This is expected — present the proposed content to the user and continue after approval; do not retry the blocked call unchanged. A claude -p or Agent SDK run with no mode set starts in Manual mode instead (2.1.302+): calls that need approval are denied unless an allow rule, hook, or --permission-mode covers them (Ch. 4, Ch. 13).
  7. Finish with a report: what was configured, which chapters were used, which conditional chapters were skipped and why, what was verified and how, and what awaits fresh-session verification.

Overlap with the official claude-code-setup plugin: it analyzes a codebase and recommends hooks, skills, MCP servers, and subagents (Ch. 5). Running it first is a fine baseline; this guide additionally covers permission policy, CLAUDE.md content rules, documentation structure, and fresh-session verification.

Boundaries:

Always Ask the user first Never
Compare each chapter's claude_code_version to the installed claude --version; if the CLI is newer, re-verify changed behavior against the official docs before applying Overwriting an existing CLAUDE.md, settings file, or hook Put secrets or credentials in CLAUDE.md, settings files, or committed MCP configs
Keep CLAUDE.md lean — only facts Claude can't infer from the code (Ch. 2 rubric) Installing plugins or MCP servers Enable bypassPermissions or weaken existing deny rules
Prefer each chapter's single recommended default; deviate only for a stated project-specific reason Adding allow rules broader than the Ch. 4 template Delete existing project configuration

Why This Order?

  1. Foundation first — CLAUDE.md, rules, and permissions define what Claude always knows and what it can never do. They cost nothing to set up, apply universally, and prevent mistakes from the start.
  2. Core tooling second — plugins, MCP servers, and hooks are infrastructure. Install plugins before writing custom skills or agents, because plugins often bundle those. Hooks enforce automation that Claude cannot "forget."
  3. Project-specific third — custom skills, subagents, and multi-agent setups fill gaps not covered by plugins.
  4. Advanced workflows last — context management, parallel work, and CI/CD are refinements on a solid foundation.

Quick-Start Checklist (15 minutes)

  1. claude in your repo → /init (or CLAUDE_CODE_NEW_INIT=1 claude for the interactive flow) → Ch. 2
  2. Set permissions in .claude/settings.json; run /fewer-permission-prompts after a few sessions → Ch. 4
  3. Install your language's LSP plugin: /plugin install typescript-lsp@claude-plugins-official → Ch. 5
  4. Add the auto-format + branch-protection hooks → Ch. 7
  5. Learn four habits: give Claude a way to verify its work (a check in the prompt, a /goal condition, or a Stop hook — the official best-practices page opens with this), plan mode (Shift+Tab) when the change spans files or the approach is unclear ("if you could describe the diff in one sentence, skip the plan"), /code-review before you push, /rewind instead of fighting a broken state → Ch. 4, Ch. 7, Ch. 8, Ch. 11, Ch. 18

What's New in the December 2, 2026 Update (2.1.304–2.1.334)

Re-verified every chapter against a dated snapshot of all 220 official docs pages, the changelog (27 release entries), live registries, and Anthropic's guidance posts published since October. Each chapter was edited against a quote ledger and then checked again by a separate verifier that saw only the chapter and the snapshots. The meaningful changes:

Area Change See
Models fable → Fable 5.2 and best = opus (2.1.321); Microsoft Foundry defaults to Sonnet 5.5 and its opus is Opus 5.5, sonnet is Sonnet 5.5 on Agent Platform and Foundry (2.1.332); fast mode is generally available on Fable 5.2 and Opus 5.5 and was removed from Opus 4.8 on 2026-11-30; new guidance on which model and effort to pick and how to escalate Ch. 15
Auto-compaction at ~400K On current 1M-context models the default compaction point moved from about 967K to about 367K tokens (2.1.334, rolling out); /autocompact 1M opts out Ch. 11
Permissions and sandbox claude -p and SDK runs start in Manual mode (2.1.302); sandboxed Bash no longer runs without prompts by default (2.1.325); new permissions.denyInsteadOfPrompting (2.1.319) and blockWritesOutsideWorkingDirectories (2.1.314); /auto-mode-setup; Code Mode (experimental) Ch. 4
Hooks 34 events: PreSkillShellCommand (2.1.332) covers a skill's injected shell commands, which PreToolUse does not see; onFailure on mcp_tool hooks (2.1.328); branch-protection push pattern no longer blocks branches that merely end in main/dev; roll new gates out in observe mode first Ch. 7
New Ch. 18: Verification & Shipping A project verify skill with evidence and a three-round cap, /code-review before push, /ship and /steward (2.1.330), Code Review, PR Steward and Claude Approvals (.claude/approvals.yml) Ch. 18
Cloud scheduled tasks Routines were renamed cloud scheduled tasks (2.1.332; /routines still works); runs start in auto mode and can stop at ask rules; /loop and recurring tasks last 30 days, not 7 (2.1.330); scheduled runs ask before a skill that declares allowed-tools unless Skill(name) is allowed (2.1.325) Ch. 17, Ch. 16
CLAUDE.md guidance Templates follow the rewritten official best-practices page: no emphasis markers, no "keep going" lines, no architecture summaries; ask for evidence; on-demand CLAUDE.md and rules files are truncated past 40,000 / 150,000 characters (2.1.309) Ch. 2, Ch. 3
Skills and review A skill's model: applies only when you type /name (2.1.330); /code-review reviews the whole branch (2.1.329), reports bugs and CLAUDE.md violations (2.1.328), and reads REVIEW.md (2.1.333–2.1.334); skills can come from MCP servers (beta, 2.1.332) Ch. 8, Ch. 16
Subagents Seven built-in subagents (web-fetch); CLAUDE_CODE_SUBAGENT_EFFORT (2.1.316); prefer one loop with skills over many specialist subagents Ch. 9
MCP and plugins Tool search is on behind a custom ANTHROPIC_BASE_URL (2.1.304); the v1 MCP client is gone (2.1.323); MCP tasks (2.1.319); /plugin has Built-in and Stats tabs Ch. 6, Ch. 5
CI and Vercel The official review workflow installs code-review@claude-plugins-official; the Vercel plugin registers its MCP server itself Ch. 13, Ch. 14

Earlier revisions (October 2026 and before)

October 19, 2026 (2.1.221–2.1.303): Claude 5.5 family and Opus 5.5 as the default, auto mode as the starting mode with permissions.ask checkpoints in the template, native AGENTS.md, rules loading on write/edit, hook handler fields (if, onFailure), subagent model order, MCP protocol 2026-07-28, new Ch. 17, official GitHub Actions workflows; third-party star counts replaced by activity stamps.

July 3–28, 2026 (2.1.201–2.1.220): chapter split, tool search made MCP budgets obsolete, /fork//branch//subtask naming settled, auto mode GA on all providers, dynamic workflows and ultracode, claude -w worktrees, claude-code-action@v1. Corrections made then and still in force: @playwright/mcp (not @anthropic/mcp-server-playwright), uvx mcp-server-fetch (no npm fetch server), @modelcontextprotocol/server-postgres archived, settings key disabledMcpjsonServers, renamed repos affaan-m/ECC and ruvnet/ruflo, and the blocking-hook shell pattern (exit 2 at top level, never inside a piped group). Full history: git log.

Sources

Every chapter ends with links to the official documentation pages it was verified against. Primary sources:

Third-party claims (packages, marketplaces, community repos) were checked against live npm/PyPI/GitHub state on 2026-12-02; each carries its source link in place. Anthropic's 2026 guidance posts (claude.dev/blog, claude.com/resources) are cited as guidance, never as behavior. When this guide and the official docs disagree, trust the docs — and please file an issue here.

Yorumlar (0)

Sonuc bulunamadi