Skip to content

Add critical instructions and hooks for Claude Code#8715

Open
dapplion wants to merge 2 commits intosigp:unstablefrom
dapplion:claude-md-improvements
Open

Add critical instructions and hooks for Claude Code#8715
dapplion wants to merge 2 commits intosigp:unstablefrom
dapplion:claude-md-improvements

Conversation

@dapplion
Copy link
Collaborator

@dapplion dapplion commented Jan 28, 2026

Summary

  • Add CRITICAL section at top of CLAUDE.md to ensure Claude always runs formatting and linting after code changes
  • Add .claude/settings.json with post-tool-call hook to remind about formatting and linting after Edit/Write operations

This helps ensure Claude Code consistently follows the project's code quality requirements.

Test plan

  • Verify CLAUDE.md changes are visible
  • Verify hook configuration is valid JSON

🤖 Generated with Claude Code

(Lion here)

Claude recognizes that it ignored Claude.md most of the time, and recommends this edits to actually lint and format when doing changes.

- Add CRITICAL section at top of CLAUDE.md to ensure Claude always runs
  `cargo fmt --all && make lint-fix` and `cargo check` after code changes
- Add .claude/settings.json with post-tool-call hook to remind about
  formatting and linting after Edit/Write operations

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dapplion dapplion requested a review from jimmygchen January 28, 2026 19:23
"post-tool-call": [
{
"matcher": "Edit|Write",
"command": "echo '\n[Reminder] Run: cargo fmt --all && make lint-fix && cargo check'"
Copy link
Member

Choose a reason for hiding this comment

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

I can't find post-tool-call on claude documentation, is this documented somewhere else?

https://code.claude.com/docs/en/hooks#common-json-fields

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm should be post-tool-use?

@michaelsproul
Copy link
Member

I thought the plan was to add a commit hook that checks cargo fmt, so this is enforced by Git and not vibes

@dapplion
Copy link
Collaborator Author

dapplion commented Feb 5, 2026

I thought the plan was to add a commit hook that checks cargo fmt, so this is enforced by Git and not vibes

Do we want to have git hooks that apply to everyone?

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.

4 participants