Apply these rules when touching .rs files. Full rationale: .claude/rules/rust-llm-failures.md.
- No
#[allow(clippy::*)]without// reason: .... Fix the lint first; suppress only with documented justification next to the attribute. - No
.clone()to escape the borrow checker. Try&T, lifetime restructuring, ownership change,Cow<T>, orArc<T>first. "Compiler complained" is not a reason. - No
.unwrap()/.expect()outside#[cfg(test)]ortests/. Use?andResult<T, E>. Exceptions: provably impossible invariant with// reason:comment, or initialization-time unrecoverable failure (intentional panic). Performance-critical and safety-critical code: zero tolerance.
If tempted to break any rule, stop and ask the user. Do not silently bypass with a suppression.
Source: junhjang/claude-harness — distributed by TomeVault.