Vibe Coding
Back to Claude Code

Claude Code / core concepts

.claude directory

The .claude directory is suitable for placing project-level configurations, commands, skills, and team-shared Claude Code workflows.

.claude directory key concepts infographic
.claude directory key concepts infographic

What is the .claude directory responsible for?

The .claude directory is the centralized location for Claude Code configuration and capabilities within the project. It can contain project descriptions, settings, Hooks, Skills, Commands, Subagents, Workflows, Rules, and automatic memories.

The official page uses a "directory exploration" to show the role of each type of file. What learners need to master is: which content is suitable for submission to the repository for sharing, and which content should be left in the local or global user directory.

Common files and directories

Different files have different functions, and they cannot all be stuffed into CLAUDE.md.

locationPurposeIs it suitable to submit
CLAUDE.mdProject background, commands, architecture, team agreements.Suitable for submission.
settings.jsonPermissions, Hooks, environment variables, default behavior.Project sharing settings can be submitted, but sensitive values should not be submitted.
settings.local.jsonPersonal or local coverage.Don't submit.
rules/*.mdRules for automatic loading by path.Suitable for submission.
skills/*/SKILL.mdReusable task capabilities.Team skills can be submitted.
agents/*.mdSpecialized subagent definitions.Team shared agents can be submitted.

Pick the right location

Misplacing information can waste context or leak private configuration. Project stability is agreed to be placed in the repository, personal preferences are placed in the user directory, and secrets and machine-related settings are placed in local files or environment variables.

  • Ask Claude to remember the project command: CLAUDE.md.
  • Allow or deny tools: settings.json permissions or Hooks.
  • Run the before and after scripts: settings.json hooks.
  • Personal temporary preference: settings.local.json or user-level configuration.
  • Complex workflows: Skills, Commands, Subagents.

Is the debugging directory effective?

If Claude is not loading rules as expected, use commands such as /context, /doctor, /hooks, /mcp, etc. to confirm what is actually loaded instead of guessing.

/context
/doctor
/hooks
/mcp

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.

.claude directory practice

The .claude directory is used to organize Claude Code project-level capabilities. It can store settings, rules, commands, skills, agents, workflows and other files. Team shared content can be submitted, personal or sensitive configurations should stay local.

  • Project CLAUDE.md: project background, commands, architecture, conventions.
  • settings.json: team sharing permissions, hooks, default behavior.
  • settings.local.json: Local personal override, not submitted.
  • rules: short rules automatically loaded by path.
  • skills: reusable task workflow.
  • agents: specialized sub-agent definition.

When debugging, use /context, /doctor, /hooks, /mcp to view the actual loading status. Don't rely on guesswork to determine whether a rule is in effect.

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 directory" 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 concept page, be specific about how it affects the real task: does it change context, permissions, execution paths, validation methods, or changes the team collaboration process.

  • 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.