fix(mcpinit): atomic settings write, allowlist sanitizer, hook consistency#111
fix(mcpinit): atomic settings write, allowlist sanitizer, hook consistency#111
Conversation
…tency - settings.go: replace os.WriteFile with temp file + os.Rename for POSIX atomicity; make backup failure a hard error instead of silent - init.go: switch sanitizeName from denylist (strip backticks/newlines) to allowlist [a-zA-Z0-9 -_.] to prevent prompt injection via project names interpolated into MEMORY.md - hook.go: add ghost_list_projects as step 1 in SessionStart hook output, matching the MEMORY.md redirect instructions
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe PR updates session-start instructions to prioritize Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
os.WriteFilewith temp file +os.Renamefor POSIX atomicity on~/.claude/settings.json. Backup failure is now a hard error.sanitizeNamefrom denylist (strip backticks/newlines) to allowlist[a-zA-Z0-9 -_.]— prevents prompt injection via project names interpolated into MEMORY.md files that Claude Code auto-loads.ghost_list_projectsas step 1 in SessionStart hook output to match MEMORY.md redirect instructions.Test plan
go vet ./...cleango test ./internal/mcpinit/...passesSummary by CodeRabbit
Bug Fixes
Documentation