Skip to content

Add Claude Code project config and refine .gitignore#17458

Open
JackieTien97 wants to merge 3 commits intomasterfrom
ty/AddClaude
Open

Add Claude Code project config and refine .gitignore#17458
JackieTien97 wants to merge 3 commits intomasterfrom
ty/AddClaude

Conversation

@JackieTien97
Copy link
Copy Markdown
Contributor

Summary

Add Claude Code project-level configuration (CLAUDE.md, .claude/settings.json) and refine .gitignore to properly handle Claude Code generated files.

Changes

1. .gitignore — Refine Claude Code ignore rules

Before (too coarse):

.claude/
CLAUDE.md
.worktreeinclude

This ignored the entire .claude/ directory and CLAUDE.md, preventing any Claude Code config from being shared with the team.

After (fine-grained):

# Claude Code
.claude/settings.local.json
.claude/todos/
.claude/worktrees/
.claude/scheduled_tasks.json

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.md and .claude/settings.json:

  • CLAUDE.md is 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.json contains 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 Code

Comprehensive project guide covering:

  • Project overview: IoTDB architecture, version info
  • Build commands: Full build, per-module build, unit tests, single test class/method
  • Integration tests: All profiles (tree-model, table-model, simple, cluster) with examples
  • Code style: Spotless + Google Java Format, Checkstyle, import order
  • Architecture: Node types (ConfigNode, DataNode, AINode), dual data model (tree/table), key subsystems (queryengine, storageengine, schemaengine, pipe, consensus), protocol layer, client libraries, API layer
  • IDE setup: Generated source directories (Thrift, ANTLR)
  • Common pitfalls: Missing Thrift compiler workaround, pre-existing compilation errors, Spotless formatting discipline, Gson compatibility
  • Git commit: No Co-Authored-By trailer in commit messages

3. .claude/settings.json — Shared project hooks

Configures a PostToolUse hook that automatically runs mvn spotless:apply on 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

  • Verify .gitignore correctly ignores local files (settings.local.json, todos/, worktrees/, scheduled_tasks.json)
  • Verify CLAUDE.md and .claude/settings.json are tracked by git
  • Verify the PostToolUse hook triggers mvn spotless:apply when editing .java files
  • Verify the hook skips non-Java files

@sonarqubecloud
Copy link
Copy Markdown

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 39.82%. Comparing base (1c1cbca) to head (0cdf3a8).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant