feat: add OpenCode integration support - #224
Closed
AlecMcQuarrie wants to merge 2 commits into
Closed
AlecMcQuarrie wants to merge 2 commits into
AlecMcQuarrie wants to merge 2 commits into
Conversation
Add RTK support for OpenCode alongside existing Claude Code integration. OpenCode users can now install RTK via its native plugin system for transparent command rewriting and token optimization. New files: - hooks/opencode-rtk-plugin.ts: TypeScript plugin that ports the bash rewrite logic to OpenCode's tool.execute.before hook - hooks/opencode-rtk-awareness.md: Slim awareness doc for OpenCode - hooks/opencode-rtk-rules.md: Rules file for OpenCode's rules system CLI changes: - rtk init --opencode [-g]: Install plugin + rules for OpenCode - rtk init --opencode --show: Show OpenCode RTK configuration - rtk init --opencode --uninstall [-g]: Remove OpenCode RTK artifacts - rtk discover --opencode: Scan OpenCode sessions for missed savings Implementation: - OpenCode plugin uses tool.execute.before event to intercept and rewrite bash commands (same patterns as rtk-rewrite.sh) - OpenCodeProvider in discover module supports session scanning - All 418 tests pass, no new clippy errors
thehoff
added a commit
to thehoff/contextcrawler
that referenced
this pull request
Jul 14, 2026
`project_filter_params` built `format!("{}{}*", p, SEP)` and the query
uses `project_path GLOB ?2`, so GLOB metacharacters (`*`, `?`, `[`) in a
project directory name acted as wildcards. A project literally named
`/repo/cli*` selected sibling `/repo/client-secret/…` history (verified:
unescaped `cli*/*` matches `client-secret/x`).
Fix: `glob_escape` wraps each metachar in a bracket class (`[*]`, `[?]`,
`[[]`) — GLOB has no ESCAPE clause — so the path matches literally; only
the trailing `*` remains a real wildcard. Behavioural test via the SQLite
GLOB operator: sibling no longer matches, real descendant still does.
Council-confirmed 5/5 (unanimous).
Refs: rtk-ai#224
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K3SAimSBwPUp4MkRXaYXSU
thehoff
added a commit
to thehoff/contextcrawler
that referenced
this pull request
Jul 14, 2026
Security release: rtk-ai#210 (json.tool bypass regression from 0.4.2), rtk-ai#229 (env-prefix proxy-disable injection), rtk-ai#224 (GLOB project-history leak), rtk-ai#221 (trust symlink secret-exfil), rtk-ai#223 (unscrubbed parse-failure error). All council-gated. From the codex-5.6-max sweep + 5-voice audit (rtk-ai#210-rtk-ai#233). See CHANGELOG. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K3SAimSBwPUp4MkRXaYXSU
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.
Add RTK support for OpenCode alongside existing Claude Code integration. OpenCode users can now install RTK via its native plugin system for transparent command rewriting and token optimization.
New files:
CLI changes:
Implementation: