Add Claude Code project config and refine .gitignore#17458
Open
JackieTien97 wants to merge 3 commits intomasterfrom
Open
Add Claude Code project config and refine .gitignore#17458JackieTien97 wants to merge 3 commits intomasterfrom
JackieTien97 wants to merge 3 commits intomasterfrom
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17458 +/- ##
============================================
- Coverage 39.82% 39.82% -0.01%
Complexity 312 312
============================================
Files 5135 5135
Lines 347073 347073
Branches 44220 44220
============================================
- Hits 138221 138211 -10
- Misses 208852 208862 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Add Claude Code project-level configuration (
CLAUDE.md,.claude/settings.json) and refine.gitignoreto properly handle Claude Code generated files.Changes
1.
.gitignore— Refine Claude Code ignore rulesBefore (too coarse):
This ignored the entire
.claude/directory andCLAUDE.md, preventing any Claude Code config from being shared with the team.After (fine-grained):
Why ignore these specific files:
.claude/settings.local.json— Machine-specific local settings (absolute paths, personal preferences). Committing this causes merge conflicts across different developer environments..claude/todos/— Session-level task tracking, ephemeral and per-session..claude/worktrees/— Temporary git worktree directories created during isolated development sessions..claude/scheduled_tasks.json— Session-level scheduled/recurring tasks, not meaningful across sessions.Why commit
CLAUDE.mdand.claude/settings.json:CLAUDE.mdis the project instruction file — it tells Claude Code how to build, test, and format code in this project. Sharing it ensures all team members get consistent AI assistance..claude/settings.jsoncontains shared project hooks (e.g., auto-formatting). It should be committed so the whole team benefits from the same automated workflows.2.
CLAUDE.md— Project instructions for Claude CodeComprehensive project guide covering:
Co-Authored-Bytrailer in commit messages3.
.claude/settings.json— Shared project hooksConfigures a
PostToolUsehook that automatically runsmvn spotless:applyon Java files after Claude Code writes or edits them. This ensures all AI-generated code changes comply with the project's Spotless formatting rules without manual intervention.{ "hooks": { "PostToolUse": [{ "matcher": "Write|Edit", "hooks": [{ "type": "command", "command": "...(spotless:apply on .java files only)...", "timeout": 30, "statusMessage": "Running spotless format..." }] }] } }Test plan
.gitignorecorrectly ignores local files (settings.local.json,todos/,worktrees/,scheduled_tasks.json)CLAUDE.mdand.claude/settings.jsonare tracked by gitmvn spotless:applywhen editing.javafiles