2.4 KiB
2.4 KiB
| id | type | title | tags | importance | confidence | created | updated | relations | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| a2d02aea-07fd-4528-8158-f2f42a23a2dd | configuration | Cargo check post-edit hook for Rust files in Claude Code |
|
0.65 | 0.8 | 2026-03-02T00:33:26.804471+00:00 | 2026-03-02T02:20:38.872040+00:00 |
|
Cargo Check Post-Edit Hook Configuration
File
rust/.claude/settings.json
Purpose
Runs cargo check --message-format=short automatically after any Edit or Write to .rs files during a Claude Code session. Provides fast feedback without waiting for a manual build.
Why cargo check (not clippy)
cargo clippyis too slow for every single edit (takes several seconds)cargo checkis faster — catches type errors and borrow checker issues quickly- Clippy should be run manually at logical checkpoints:
- Before commits
- After finishing a feature
- After batch edits to multiple files
Settings JSON Structure
{
"hooks": {
"PostToolUse": [
{
"matcher": { "tool_name": ["Edit", "Write"], "file_paths": [".*\\.rs$"] },
"hooks": [
{ "type": "command", "command": "cargo check --message-format=short" }
]
}
]
}
}
Documentation
Also documented in rust/CLAUDE.md for future session context.