chore: add Claude Code safeguards and track CLAUDE.md#30
Merged
Conversation
- Add .claude/settings.json with permission rules: - Deny PR approval/merge/close, force push, push to main/master - Deny destructive commands (rm -rf, sudo, git reset --hard) - Deny editing sensitive paths (~/.ssh, ~/.aws, ~/.gnupg) - Allow non-destructive tools, cargo build/test, git workflow - Allow push --force-with-lease to work branches - Default "ask" mode for anything not explicitly allowed/denied - Track CLAUDE.md and .claude/settings.json in git - Remove CLAUDE.md and .claude/settings.json from .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds agent safeguards and configuration for Claude Code sessions by introducing two new tracked files: CLAUDE.md (comprehensive AI agent instructions) and .claude/settings.json (permission rules). These files establish operating principles, quality gates, security constraints, and execution rules for AI agents working with this repository.
Changes:
- Added
CLAUDE.mdwith 20 operating principles covering code quality, testing, documentation, security, and change management - Added
.claude/settings.jsonwith layered permission rules (deny/allow/ask modes) for Claude Code sessions - Removed
CLAUDE.mdand.claude/settings.jsonfrom.gitignoreto track them in version control
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| CLAUDE.md | Comprehensive agent instructions covering operating principles, quality gates, robustness, security, change management, and execution constraints |
| .gitignore | Removed entries for CLAUDE.md and .claude/settings.json to enable version tracking |
| .claude/settings.json | Permission configuration with deny rules for dangerous operations, allow rules for safe operations, and default ask mode for everything else |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CLAUDE.md: - Fix "seems" → "seem" (subject-verb agreement) + add missing period - Add missing period on line 86 - Fix "Fetch the git origin" → "Fetch from origin" - Fix "errors was" → "errors were" + "ooriginating" → "originating" .claude/settings.json: - Add comprehensive force push deny patterns (+branch, mid-command --force/-f) - Simplify Edit/Write allow rules (deny rules take precedence for sensitive paths) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/settings.jsonwith layered permission rules enforcing safe defaults for all Claude Code sessionsCLAUDE.md(agent instructions) and.claude/settings.jsonin git so they apply to all collaborators and automated agents.gitignorePermission model
--force-with-leasepush to work branches, make, docker, harmless shell utilitiesHow to verify
🤖 Generated with Claude Code