.claude directory
A repository folder that stores Claude Code project configuration, custom slash commands, agents, hooks, and settings.
What is .claude directory?
A .claude directory is the folder Claude Code uses to store project-level configuration, custom slash commands, agents, hooks, skills, and other settings. In practice, it helps teams keep Claude Code behavior consistent inside a repository while still allowing personal configuration in a user-level ~/.claude directory. (code.claude.com)
Understanding .claude directory
The .claude directory is part of Claude Code’s on-disk project structure. Anthropic’s docs describe it as the place where Claude Code reads instructions, settings, skills, subagents, rules, memory, commands, and hooks, with project files meant to be committed to git and home-directory files meant for personal use. That split makes the directory useful for shared team workflows as well as individual developer preferences. (code.claude.com)
In a working repo, this folder acts like a control plane for how Claude Code behaves on that codebase. Teams can define reusable prompts as slash commands, add automation with hooks, and package task-specific behavior into subagents or skills. Because Claude Code can also read from parent directories and watch changes in the project tree, the .claude directory supports both local experimentation and repeatable repo-wide setup. (docs.anthropic.com)
Key aspects of .claude directory include:
- Project scope: Files in the repository-level .claude directory are shared with the codebase and can be versioned in git.
- Personal scope: Files in
~/.claudeapply across projects and are meant for individual defaults. - Commands: Custom slash commands let teams package repeatable prompts into files Claude Code can run.
- Hooks: Hook configuration can trigger scripts before or after tool use and other lifecycle events.
- Automation surface: Skills and subagents help Claude Code adapt to specialized tasks without rewriting the whole workflow.
Advantages of .claude directory
- Consistency: Teams can standardize Claude Code behavior across contributors and environments.
- Reusability: Common prompts, hooks, and task patterns can be saved once and reused often.
- Shareability: Project files can live in the repo, so new teammates inherit the same setup.
- Flexibility: Personal and project-level configuration stay separate, which keeps local preferences out of shared code.
- Automation: Hooks and agents reduce repetitive setup work and make workflows more deterministic.
Challenges in .claude directory
- Configuration drift: Multiple files and scopes can make it easy for project and personal settings to diverge.
- Discoverability: New contributors may need help understanding which files matter and when Claude loads them.
- Maintenance: Prompt files, hooks, and agents need the same care as code, including review and cleanup.
- Permissions planning: Hook and tool access should be set thoughtfully when sensitive files are in the repo.
- Workflow complexity: As the directory grows, teams need conventions for naming, ownership, and updates.
Example of .claude directory in action
Scenario: a team wants Claude Code to follow the same review and testing workflow in every checkout of their app.
They add a project-level .claude/settings.json to set permissions, a custom slash command for release notes, and a hook that runs tests after file writes. They also store a few reusable prompts in .claude/commands/ and a subagent for API cleanup tasks.
Now, when a developer opens the repo and asks Claude to help, the assistant already has the project context it needs. The team gets a more predictable experience without asking everyone to copy local setup by hand.
How PromptLayer helps with .claude directory
PromptLayer gives teams a place to manage prompts, versions, evaluations, and agent workflows alongside the rest of their LLM stack. If you are organizing Claude Code behavior in a .claude directory, PromptLayer can complement that setup by making prompts easier to track, compare, and improve over time.
Ready to try it yourself? Sign up for PromptLayer and start managing your prompts in minutes.