diff --git a/graph/configurations/cargo-check-post-edit-hook-for-rust-files-in-claude-code-a2d02a.md b/graph/configurations/cargo-check-post-edit-hook-for-rust-files-in-claude-code-a2d02a.md new file mode 100644 index 00000000000..40eeec4ae2f --- /dev/null +++ b/graph/configurations/cargo-check-post-edit-hook-for-rust-files-in-claude-code-a2d02a.md @@ -0,0 +1,45 @@ +--- +id: a2d02aea-07fd-4528-8158-f2f42a23a2dd +type: configuration +title: "Cargo check post-edit hook for Rust files in Claude Code" +tags: [sba-scouting, rust, claude-code, hooks, linting, cargo, configuration, developer-experience] +importance: 0.65 +confidence: 0.8 +created: "2026-03-02T00:33:26.804471+00:00" +updated: "2026-03-02T00:33:26.804471+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 clippy` is too slow for every single edit (takes several seconds) +- `cargo check` is 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 +```json +{ + "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.