Skip to content

[repo] init claude config#416

Closed
everettbu wants to merge 1 commit into
mainfrom
claude-setup
Closed

[repo] init claude config#416
everettbu wants to merge 1 commit into
mainfrom
claude-setup

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35617
Original author: rickhanlonii


Overview

Adds a claude setup that works with the nested /compiler setup.

The constraints are:

  • when working in the root repo, don't use the compiler configs (easy)
  • when working in the compiler/ don't use the parent contigs (hard)

The first one is easy: there's a claude.md and .claude directory in /compiler that is only loaded when you start a session from /compuler. The second one is hard, because if you start a session from /compiler, the parent claude files and skills are loaded.

I was able to deny the permissions to the parent skills in settings.json, but the descriptions are still loaded into context and I don't think that's avoidable.

To keep the parent claude file out of context, I created a hook hack: I moved all the non-compiler claude file context to instructions.md and added a SessionStart hook to cat the file into context if the cwd isn't the /compiler. Works well, but won't show it as part of the /context slash command.

Skills

I also added a number of skills specific to the React repo:

Skill Description
/extract-errors yarn extract-errors
/feature-flags how feature flags work and @gate
/fix linc and prettier
/flags yarn flags
/flow yarn flow <variant>
/test yarn test-*
/verify run all the lints/tests/flow to verify

Example: Flow

before after
flow-before flow-after

Example: Tests

before after
test-before test-after

@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 23, 2026
@greptile-apps

greptile-apps Bot commented Jan 23, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds comprehensive Claude Code configuration to the React repository with a clever solution for managing nested /compiler workspace isolation.

Key Changes:

  • Created root-level Claude configuration with instructions, settings, and 7 custom skills (/extract-errors, /feature-flags, /fix, /flags, /flow, /test, /verify)
  • Implemented SessionStart hook that conditionally loads instructions based on working directory to prevent compiler sessions from loading parent context
  • Added permission controls to explicitly deny parent skills when working in the compiler directory
  • All referenced yarn commands (extract-errors, linc, prettier, flow, flags, test-*) exist in package.json:132-157

Technical Approach:
The hook uses if [[ "$PWD" != */compiler* ]]; then cat .claude/instructions.md to conditionally inject context only when not in the compiler directory. This maintains separation while keeping skills available at the root level.

Impact:
Enhances developer experience by providing context-aware shortcuts for common React development workflows like running tests across channels, checking feature flags, and running Flow type checking.

Confidence Score: 5/5

  • Safe to merge - configuration-only changes with no runtime impact
  • All changes are documentation and configuration files for Claude Code tooling. Commands referenced in skills are verified to exist in package.json. The nested workspace isolation approach is well-designed with proper permission controls.
  • No files require special attention

Important Files Changed

Filename Overview
.claude/instructions.md Comprehensive instructions for working with React codebase - well-structured with clear guidance on packages, requirements, and commands
.claude/settings.json Configures SessionStart hook to conditionally load instructions and sets up permissions for skills and yarn commands
compiler/.claude/settings.json Updated to explicitly deny parent skills when working in compiler directory
.claude/skills/test/SKILL.md Comprehensive skill for running tests across different channels with proper flags

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Jan 24, 2026
@everettbu
everettbu deleted the claude-setup branch January 24, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants