[Feature Request]: Bare Git Repository .claude Config Support
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
I use a git bare repo + worktree workflow for managing large enterprise
projects. My project monorepo already has a committed .claude/ setup
for team use (shared commands, project context).
The current workflow requires me to manually create .claude config in
every new worktree for personal commands (like PR creation, task
management). Since worktrees are ephemeral and created per branch,
this is impractical. There is no layer between the project-committed
.claude/ and the global ~/.claude/ for personal, project-specific config.
Proposed Solution
Claude Code should recognize a .claude/ folder placed in the bare repo
root as a valid personal config layer. Since bare repo has no working
tree, this config can never be accidentally committed — making it
naturally personal and machine-specific.
New config lookup chain:<worktree>/.claude/ ← project team config (existing)<bare-repo-root>/.claude/ ← NEW personal project config~/.claude/ ← global personal config (existing)
Commands and CLAUDE.md from all layers should be merged.
Alternative Solutions
- Symlinks: Break on git pull/checkout when project .claude/ is committed
- ~/.claude/commands/: Works but pollutes global config with
project-specific commands, no clean separation per project
- Committing personal config: Not viable, these are personal workflow
tools not meant for team sharing
Priority
High - Significant impact on productivity
Feature Category
Configuration and settings
Use Case Example
My file structure:
my-app-bare/ ← git bare repo
.claude/ ← WANT this to work for personal commands
commands/
create-pr.md ← GitHub PR with my personal standards
clickup-task.md ← ClickUp task with my formatting
main/ ← worktree (main branch)
stage/ ← worktree (stage branch)
feature/
auth/ ← worktree
jwt/ ← worktree
Each worktree already has project's committed .claude/ (team config).
I need my personal commands available in ALL worktrees automatically
without committing them or duplicating them per worktree.
Additional Context
Technical note: Bare repo root can be detected from any worktree via: git rev-parse --git-common-dir
This is the same mechanism git itself uses internally. Claude Code
could use this to walk up and find bare repo .claude/ automatically.
This workflow (bare repo + worktrees) is increasingly common among
senior developers managing large, long-lived enterprise projects with
multiple parallel feature branches.
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
This is NOT a duplicate of the listed issues:
My proposal uniquely leverages the bare repo root as a natural,
architecture-level personal config boundary. Since bare repos have
no working tree, config placed there can NEVER be accidentally
committed — no .gitignore needed. This is a fundamentally different
and cleaner approach for the bare repo + worktree workflow.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
I have the same concern as you and would like to see a solution like your proposal to it.
But let me share a pattern worth investigating for anyone using git worktrees (especially bare-repo layouts) who wants
.claude/updates to propagate across worktrees and teammates without waiting on feature-branch merges.Layout:
The idea: Track
.claude/as a git submodule pointing at a dedicatedclaude-configrepo, with branch tracking enabled:Updates flow: edit
.claude/from any worktree → push to theclaude-configrepo'smain. Teammates pick it up viagit submodule update --remote --merge, regardless of which parent branch they're on.Automating the sync with hooks: to avoid relying on teammates remembering the command, commit
post-merge,post-checkout, andpost-rewritehooks to a tracked.githooks/directory and have everyone rungit config core.hooksPath .githooksonce (or wire it into a setup script / Husky). Each hook runs:A
pre-pushhook that warns on uncommitted/unpushed changes in.claude/is also worth adding — prevents pushing a parent pointer at a SHA that only exists on your laptop.Per-branch local instructions still work via gitignored
*.local*files andCLAUDE.local.md. For personal cross-worktree prefs, use@~/.claude/...imports. And for org-wide overrides shared across multiple projects, teammates can import from a common parent directory:@~/organization-parent-directory/.claude/....Caveats:
mainto keepgit statusclean and fresh clones reproducible.--recurse-submodulesand a decision on whether to use the recorded SHA (reproducible) or livemain(fresh).Lighter alternative for solo/small setups: a dedicated
claude-configbranch checked out as its own worktree, symlinked into each feature worktree's.claude/. Same single-source-of-truth, less tooling overhead — but doesn't scale to teammates as cleanly.Curious if others have tried either approach and how it held up.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.