Repository navigation
feat(claude): first-touch design-system context - #72
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The SessionStart context entry runs entry.py --session-start from the git root of the cwd, and a PreToolUse entry gives the index once per session, agent and root on the first touch of a consumer repository. The script reads the event with the C scanner so a call that finds its marker does not import json. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of the hook: output that is not UTF-8 no longer leaves the marker claimed, a failure reports the command's last stderr line, trailing data after the event is refused, the failure counter and the log trim are written safely, and both settings entries pin the CLI floor to 7.6.0 so an older cached release cannot serve the whole catalog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The push guard names this repository chezmoi; the pointer's code review line used the plan's name for it, dotfiles. The profiles are the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What
Gives a Claude Code session the design-system index once, when its work first touches a repository that uses the design system, and stops giving the catalog at session start in a folder that holds no repository.
dot_claude/tools/greenrack-entry/entry.py: a hook script. It reads the hook event, finds the git root of the touched path (the cwd for Bash), and returns the context once per session, agent and root. A marker claimed withO_CREAT|O_EXCLmakes it once even for parallel tool calls; a failure releases the marker so the next call retries, and three failures in a row back off for ten minutes. It always exits 0, and prints nothing or one JSON object for a tool call, or plain text at session start.settings.json.tmpl: the SessionStart entry now runsentry.py --session-start, and a new PreToolUse entry runs it onRead|Edit|Write|MultiEdit|NotebookEdit|Bash. Both call the CLI at^7.6.0, which prints a short index instead of the 34 KB catalog..chezmoiignore: the test file stays out of~/.claude.The script names no tool of its own: the command, the package names to look for, the label and the per-repository hook paths all arrive as arguments. It is a stopgap until grh has a manifest key for lazy entry (ADR-0075).
The plan is Phase 4 of the one in the design-system repository, which shipped Phases 1 to 3 as release 7.6.0. This branch's pointer plan holds the review record.
Verification
jsonnorre.claude -psessions started in a parent folder: nothing at start; the first read in a consumer gave the index, the second gave nothing, and a read in a non-consumer gave nothing.~/.claude/settings.jsonis empty ondiff; the template has the same number of directives as before.Review
Implementation review, backend, lang:python, platform and architect approve after a delta round. Two choices are recorded as deliberate in the pointer plan: the options stay a dict, and the version range is
^7.6.0rather than~7.6.0, so the index can list components that later 7.x releases add.Carried
A hook killed at its 15 s limit between claiming and releasing a marker leaves the root without its index for that session. A denied sibling tool call may drop the context after the marker is claimed. Neither has been seen.
🤖 Generated with Claude Code