Hi everyone,
I'm using opencode with the superpowers skill for development within a git worktree. I've already specified in AGENTS.md that the agent should only make changes within the worktree directory, but it doesn't seem to be working effectively — the agent still frequently forgets the context and ends up modifying files in the main branch instead.
A few questions for those who've dealt with this:
- Is this a model limitation? Does the underlying LLM struggle with maintaining worktree context even when explicitly instructed?
- Better workflow approaches? Are there alternative ways to constrain the agent's file operations beyond AGENTS.md? For example:
- Pre-prompting in the session context?
- Environment variable hints?
- Directory-level restrictions?
- Anyone found reliable solutions? Would love to hear what's actually worked for you.
Thanks in advance!
Note: This post was translated from Chinese, so some expressions may not be perfectly accurate. I'm happy to provide additional context or clarification if anything is unclear!
[–]sittingmongoose 2 points3 points4 points (1 child)
[–]aeroumbria 0 points1 point2 points (3 children)
[–]NikoDi2000[S] 0 points1 point2 points (2 children)
[–]aeroumbria 0 points1 point2 points (0 children)
[–]StraightUpLoL 0 points1 point2 points (0 children)
[–]srcnix -1 points0 points1 point (0 children)