Skip to content

Restructure & document the shared Claude config (project/ code-guide)#4035

Open
Leiyks wants to merge 10 commits into
masterfrom
leiyks/claude-config-consolidation
Open

Restructure & document the shared Claude config (project/ code-guide)#4035
Leiyks wants to merge 10 commits into
masterfrom
leiyks/claude-config-consolidation

Conversation

@Leiyks

@Leiyks Leiyks commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

What & why

Cleans up and documents the repo's shared .claude/ Claude Code config. The
.claude/ tree is now purely shared team config — personal, per-developer
config is kept out of the repo entirely (each dev keeps it in their own
~/.claude), so there's no in-repo personal machinery to maintain.

Changes

Entry point (CLAUDE.md)

  • @imports the always-on shared config (general.md, project/index.md) and
    links ci/index.md (large, on-demand). Only @imports are auto-loaded by
    Claude Code — plain links are not — so the always-needed docs are imported
    while the big CI reference stays on-demand. Personal config is explicitly out
    of the repo.

New project/ code-guide (a ci/-style folder)

  • project/index.md — concise, always-imported hub: overview, layout,
    subsystem map, architecture summary, config/INI, conventions, pointers.
  • One terse orientation file per subsystem — ext, tracer, userland
    (src/), components (+ components-rs/ + ZAI), sidecar, appsec,
    profiling — each with what it is / key files & dirs / how it fits /
    gotchas
    , plus an explicit data-flow for the trace / ext / sidecar paths.
  • Build/CI/debug content is linked out (to ci/, debugging/), not
    duplicated. Reflects the ext/tracer/ split (Split the tracer parts off from ext directory #3912); versions are
    referenced by source-of-truth (VERSION, Cargo.toml,
    profiling/rust-toolchain.toml) — no hardcoded versions or source line
    numbers. Links the deep docs (architecture.md, CONTRIBUTING.md).

Folder cleanup

  • Debugging docs grouped under debugging/ with an index (gdb.md,
    appsec-integration.md, system-tests.md).
  • Shared helper scripts grouped under scripts/ (dd_php_release_url,
    find_map_region.py, parse_ucontext.py); references updated.

How the code-guide was built

The project/ docs were generated by reading the actual source: a
per-subsystem analysis pass → drafting → an independent source-accuracy +
house-style review pass. That review caught and fixed real issues (e.g. a wrong
"MSHUTDOWN tears down in reverse of MINIT" claim, and a reference to a
deleted file).

Verified

  • Every internal doc link resolves; every referenced source path exists (no
    hallucinated paths); no hardcoded versions or source line numbers.
  • Terse house style (≤80-char lines, tables exempt).
  • .claude/ contains only shared team config — no personal files.

Add a portable, repo-side convention so each developer can keep personal
Claude config alongside the shared team config without committing it, and
fold project-level knowledge into the committed common config.

- .claude/.gitignore: ignore per-developer paths (personal/, commands/,
  scripts/, skills/omc-reference/, settings.local.json, worktrees/, .omc/)
  in place; keep personal/README.md committed. Previously this relied on
  each developer's global gitignore, which isn't portable and silently
  hid new shared files.
- .claude/personal/: git-ignored drop zone for per-developer config;
  CLAUDE.md optionally imports personal/CLAUDE.md if present.
- .claude/project.md: project knowledge (overview, layout, architecture,
  INI, conventions) in the terse house style, cross-referencing the
  existing build/CI/debug docs instead of duplicating them. Reflects the
  ext/ -> tracer/ split (#3912); versions reference VERSION / Cargo.toml
  / rust-toolchain.toml rather than being pinned inline.
- CLAUDE.md: link general.md, project.md, ci/index.md and import personal.
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 8, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 4 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [7.0]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | PHP language tests: [8.5, amd64, zts]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | Loader test on amd64 libc: [5.6, nts, buster]   View in Datadog   GitLab

View all 4 failed jobs.

3 Test performance regressions detected

testScenarioGetWithView from tests/Integrations/WordPress/V6_1.DDTrace\Tests\Integrations\WordPress\V6_1\CommonScenariosCallbacksTest — 8.25s (+7.45s, +938%)   View in Datadog

testDynamicRouteWithOptionalsFilled from symfony-44-test.DDTrace\Tests\Integrations\Symfony\V4_4\PathParamsTest — 2.87s (+2.3s, +406%)   View in Datadog

testScenarioGetWithException from tests/Integrations/WordPress/V6_1.DDTrace\Tests\Integrations\WordPress\V6_1\CommonScenariosTest — 5.96s (+5.2s, +682%)   View in Datadog

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 2 jobs - 1 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.08% (-0.04%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 348677d | Docs | Datadog PR Page | Give us feedback!

Plain markdown links in CLAUDE.md are not injected into context by Claude
Code — only @-imports are. Import general.md and project.md so the shared
operating rules and project knowledge are always loaded alongside each
developer's personal config. ci/index.md stays a link (large on-demand CI
reference).
@Leiyks Leiyks force-pushed the leiyks/claude-config-consolidation branch from b315fbb to 71979cc Compare July 8, 2026 13:58
Leiyks added 2 commits July 8, 2026 17:24
… commands

Addresses PR review feedback:

- .claude/.gitignore: commands/ is now personal-by-default via `/commands/*`
  (instead of ignoring the whole dir), so the team CAN commit shared commands
  by un-ignoring them while personal ones stay ignored. Claude Code discovers
  commands by filesystem regardless of git status, so both coexist.
- Scripts: shared helper scripts moved into .claude/scripts/ (dd_php_release_url,
  find_map_region.py, parse_ucontext.py); personal scripts go in
  .claude/scripts/local/ (git-ignored). crash-analysis skill refs updated.
- Debugging docs grouped under .claude/debugging/ with an index.md (like ci/):
  gdb.md, appsec-integration.md (was debugging.md), system-tests.md (was
  debugging-system-tests.md). All inbound/outbound links updated.

Note: ci/ keeps its own co-located tooling (dockerh, check-ci, ...) since those
are referenced throughout the ci/ docs as a self-contained module.
Personal skills live in .claude/skills/ alongside shared ones (Claude Code
discovers by filesystem, ignoring git status). Their dir name is the skill
name, so there's no generic pattern; document that each dev ignores their own
personal skill dirs in .git/info/exclude (per-clone) instead of publishing
personal skill names into the committed shared config.
@Leiyks Leiyks force-pushed the leiyks/claude-config-consolidation branch from 0f7c2a6 to 35d2e26 Compare July 9, 2026 12:26
Leiyks added 4 commits July 9, 2026 15:17
Personal Claude config now lives entirely in ~/.claude (global), so the repo's
.claude/ is purely shared team config:

- Remove .claude/personal/ (README) and the @.claude/personal/CLAUDE.md import
  from CLAUDE.md.
- Slim .claude/.gitignore to just local/runtime artifacts (settings.local.json,
  worktrees/, .omc/); document that personal config goes in ~/.claude.
The repo .claude/ carries no ignore file now — it's purely shared config.
Local/runtime artifacts are handled outside the shared config: settings.local.json
via the repo root .gitignore, and per-developer tooling output (OMC .omc/, Claude
Code agent worktrees/checkpoints/etc.) via each dev's own global ~/.gitignore.
Turn the single project.md into a ci/-style folder: a concise always-imported
index.md (overview, layout, subsystem map, architecture summary, config,
conventions, pointers) plus one terse orientation file per subsystem —
ext, tracer, userland (src/), components (+components-rs/ZAI), sidecar, appsec,
profiling. Each covers what it is / key files & dirs / how it fits / gotchas,
cross-linked, with build/CI/debug content linked out (not duplicated).

Produced via an analyze→write→review pass over the actual source: per-subsystem
code analysis, drafting, then a source-accuracy + house-style review. Versions
are referenced by source-of-truth (VERSION, Cargo.toml, rust-toolchain.toml);
no hardcoded versions or source line numbers. CLAUDE.md now imports
project/index.md.
…NTRIBUTING

Targeted depth-increase (on-demand area files only; index stays lean):
- tracer.md: ordered span→upload data-flow (RINIT → headers → span create →
  uhook → close → sampling → serializer → auto_flush → sidecar/coms → agent).
- ext.md: fix the incorrect "MSHUTDOWN tears down in reverse" claim — it isn't
  (sidecar shuts down late, after config is freed); tighten MINIT/RINIT/RSHUTDOWN
  ordering (logging-first, zend_extension registration, dd_rinit_once).
- sidecar.md: submit→upload flow (serialize → send_traces_to_sidecar → IPC →
  TraceFlusher batches ~5s/~1MB → agent upload; fork preserves session ID).
- index.md: link architecture.md (background sender / components / version code)
  and CONTRIBUTING.md (setup/testing) from Pointers.

Produced via the OMC analyze→write→review pipeline over live source; verified
accurate (flush thresholds, ordering, function anchors). No line numbers.
@Leiyks Leiyks changed the title Consolidate Claude config: shared vs personal split + project.md Restructure & document the shared Claude config (project/ code-guide) Jul 9, 2026
@Leiyks Leiyks marked this pull request as ready for review July 9, 2026 15:00
@Leiyks Leiyks requested a review from a team as a code owner July 9, 2026 15:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95476d8465

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .claude/project/appsec.md Outdated
Comment thread .claude/project/tracer.md Outdated
Comment thread .claude/project/appsec.md Outdated
Comment thread .claude/project/components.md Outdated
All four verified against live source:
- appsec.md: C++ helper client/runner/engine/service are .cpp/.hpp files, not
  dirs (only network/, remote_config/, subscriber/ are dirs).
- appsec.md: the helper is enabled via the sidecar — ext/sidecar.c calls the
  appsec module's dd_appsec_maybe_enable_helper -> ddog_sidecar_enable_appsec
  (resolved Rust/C++ path) before ddappsec's first RINIT — not spawned by
  ddappsec MINIT/RINIT.
- tracer.md + index.md: the sidecar sender is only the default on PHP 8.3+ /
  Windows (DD_SIDECAR_TRACE_SENDER_DEFAULT); on PHP 7.0-8.2 the in-process
  coms.c sender is the default.
- components.md: drop container_id from the component list — it's a stale
  build-artifact dir with no source; container ID is in the Rust bridge
  (ddtrace_get_container_id).
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