Original Reddit post

Hi all, Recently I have been locking down the branches on my GitHub project and the traditional way is rules and branch protection like locking down a branch. The intent is that human engineers should create a PR to merge into staging or main branch which requires code owner approval. That works. What doesn’t work is that Claude code, it directly can commit to any branch and by default bypasses the rules. How to prevent this bypass from happening by an Ai agent like Claude code? Any advice? submitted by /u/Whyme-__-

Originally posted by u/Whyme-__- on r/ClaudeCode