Skip to content

About

OpenCode plugin that adds ancestor instruction files above git worktrees and sorts directory-chain blocks outermost-first.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

opencode-agents-cascade

Code checks Lint License: MIT

Keep directory-specific instructions available when you work inside a git repository. OpenCode may omit instruction files above its worktree root. This plugin adds those files and places ancestor instruction blocks from outermost to innermost.

For example, consider a session inside my-repo/sub:

/Users/
├── AGENTS.md
└── you/
    ├── AGENTS.md
    └── projects/
        ├── AGENTS.md
        └── my-repo/            ← git worktree
            ├── AGENTS.md
            └── sub/            ← current directory
                └── AGENTS.md

The plugin looks for missing files above my-repo, then orders the ancestor chain: /Users, /Users/you, /Users/you/projects, my-repo, my-repo/sub. It checks AGENTS.md first and falls back to CLAUDE.md in each directory. Other prompt blocks may remain ahead of this chain. The resulting order does not enforce instruction priority or guarantee model compliance.

The plugin depends on OpenCode's experimental system transform hook and instruction-header format. A header inside file content can confuse parsing; some appended system text cannot be separated. See how it works and its limitations before relying on a specific order.

Next steps

License

MIT

About

OpenCode plugin that adds ancestor instruction files above git worktrees and sorts directory-chain blocks outermost-first.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages