I wrote a simpler version of this for Claude Code as open source if that's useful to you: https://github.com/smithy-ai/smithy-ai
It's doing context management in the same way, but adds a learning loop based on code reviews. Currently works with Gitlab, Forgejo and Gitea but happy to accept a PR for Github support or co-write it.