mirror of
https://github.com/lWolvesl/claw-code.git
synced 2026-04-02 18:41:53 +08:00
Git-aware CLI flows already existed, but branch detection depended on status-line parsing and /diff hid local policy inside a path exclusion. This change makes branch resolution and diff rendering rely on git-native queries, adds staged+unstaged diff reporting, and threads git diff snapshots into runtime project context so prompts see the same workspace state users inspect from the CLI. Constraint: No new dependencies for git integration work Constraint: Slash-command help/behavior must stay aligned between shared metadata and CLI handlers Rejected: Keep parsing the `## ...` status line only | brittle for detached HEAD and format drift Rejected: Keep hard-coded `:(exclude).omx` filtering | redundant with git ignore rules and hides product policy in implementation Confidence: high Scope-risk: moderate Reversibility: clean Directive: Preserve git-native behavior for branch/diff reporting; do not reintroduce ad hoc ignore filtering without a product requirement Tested: cargo fmt; cargo clippy --workspace --all-targets -- -D warnings; cargo test --workspace Not-tested: Manual REPL /diff smoke test against a live interactive session