Vibe Coding
Back to Claude Code

Claude Code / Reference

Claude Code configuration

Configuration is used to manage permissions, default behaviors, project rules, tool connections, and output preferences.

Claude Code configuration key concepts infographic
Claude Code configuration key concepts infographic

Set file hierarchy

Claude Code settings can come from user, project, local, managed settings and environment variables. Different tiers have different scopes, and enterprise hosting settings may force overrides or restrict local configurations.

Set sourceSuitable for content
User settingsPersonal default modes, environments, preferences.
Project settingsPermissions, Hooks, and project behaviors shared by the team.
local settingsDo not commit individual overrides or machine-dependent values.
Hosting settingsOrganizations enforce policies and security boundaries.
environment variablesOne-time or runtime configuration.

Common key settings

Common settings include defaultMode, autoCompactEnabled, autoMemoryEnabled, availableModels, env, hooks, permissions, model, output style and plug-in related configurations.

  • permissions.defaultMode determines the default permission mode.
  • autoCompactEnabled affects whether long sessions are automatically compressed.
  • env can set environment variables for the Claude process.
  • Hooks define automation before and after tool invocation.
  • availableModels limits the models available to the user.

Safe editing settings

Do not write keys into committable project settings. The settings for repository check-in should be conservative, and personal tokens, temporary environment variables, and local machine paths should be placed in local or user-level configurations.

{
  "permissions": {
    "defaultMode": "plan"
  },
  "env": {
    "NODE_ENV": "development"
  }
}

Complete usage points

Supplement the core concepts, operation sequences, permission boundaries and verification requirements that are easily compressed and missed in official documents, making it easier for English readers to learn completely by page.

Settings Details

Claude Code settings sources include user, project, local, managed settings, and environment variables. Together they determine the default permission mode, environment variables, hooks, availableModels, autoCompact, autoMemory, output style, plug-in and tool behavior.

Project committable settings should be conservative and appropriate for team-shared default behavior and security boundaries; local settings should be appropriate for personal machine paths or temporary overrides; managed settings should be appropriate for organization-enforced policies; and environment variables should be appropriate for one-time runs or CIs.

Security principles: Do not submit keys; do not use bypass or high-risk permissions as project defaults; operations involving production systems, deletions, deployments, and migrations should be explicitly controlled by permission rules or Hooks.

Study Checklist

Put the content on this page into real tasks and use the five dimensions of entry, context, permissions, verification and team rules to check whether you have truly mastered it.

Study Checklist

After reading this page, do not just remember the concept name. You should be able to place "Claude Code configuration" back into a real Claude Code engineering workflow: where the task starts, what context the system loads, which actions need approval, how the result is verified, and how to roll back when it fails.

If this is a configuration or reference page, be specific about where the configuration is placed, whether it will be submitted, whether it contains sensitive information, whether it will extend the default permissions, and how to troubleshoot the settings that actually took effect in the event of a failure.

  • Be able to describe in your own words the specific problem this page solves, rather than just reciting the title.
  • Able to write a minimal example task with goals, scope, prohibitions, and acceptance criteria.
  • Be able to determine which information should be put into the current prompt and which should be captured as project rules or configurations.
  • Be able to explain which long-term rules should go into CLAUDE.md, and which runtime behavior should be handled by settings, permissions, Hooks, Skills and MCP.
  • Ability to check diffs, command output, test results, screenshots or PR notes after a task is completed instead of just trusting the natural language summary.

If this page is used for team training, ask learners to complete a small task with Claude Code: read and explain first, submit a plan, make the smallest useful change, and close with real verification commands plus human diff review.