[wip]chore: optimize Claude Code config for context efficiency#190
Closed
[wip]chore: optimize Claude Code config for context efficiency#190
Conversation
Troublor
reviewed
Mar 16, 2026
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "osascript -e 'display notification \"$NOTIFICATION_MESSAGE\" with title \"Claude Code\"'" |
Collaborator
There was a problem hiding this comment.
osascript? only applicable on MacOS. I don't think such command should be pushed to git.
| "type": "command", | ||
| "command": "cargo check -p mega-evm 2>&1 | head -30", | ||
| "timeout": 30000, | ||
| "statusMessage": "Running cargo check..." |
Collaborator
There was a problem hiding this comment.
Sometimes the agent is in the middle of a large refactor/implementation and one edit only modifies parts of the code. At this point, the project may be not compilable. I think this hook is unnecessary. We can just ask the agent to always check compilation after edit (the logical multi-file edits, not a single edit) in the AGENTS.md or similar system prompts.
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
Optimize Claude Code configuration for context efficiency, reducing always-loaded token overhead by ~60%.
rust.md(coding conventions) andarchitecture.md(domain knowledge), loaded on demandcargo checkon.rsedits) + Notification (desktop alert)AGENTS.md changes
environment) to
.claude/rules/architecture.md.no_std,cargo sort,default-features) to.claude/rules/rust.md.NEVER/ALWAYS/Verification/Compact Instructionssections.Context overhead comparison