You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6638819
Browse filesBrowse the repository at this point in the historyBrowse files
Both agents have SessionStart hook support analogous to Claude
Code's; only OpenCode lacks it upstream
(anomalyco/opencode#5409).
- pkg/agents/session_start_hook.go: generalized the hook helper to
take load/save fn parameters and an agent-specific entry map.
Replaces the previous Claude-only claude_hook.go.
- pkg/agents/{claude,codex,gemini}.go: each Install (when not
--no-bg-sync) writes its agent-specific entry shape:
* Claude — minimal: just {type, command}
* Codex — TOML; adds matcher="startup|resume" + statusMessage;
prints a trust-ceremony note since Codex requires `/hooks` to
trust new entries before they fire
* Gemini — adds matcher="*", name="repocache-bg-sync", timeout=5000
- Each Uninstall removes hooks tracked in sidecar state.
README + SPEC §8.6 updated to document the three-agent matrix and
each agent's hook schema.
Verified end-to-end against all four agents with --agents=all:
✓ Codex TOML serializes correctly as [[hooks.SessionStart.hooks]],
✓ all three hook-supporting agents install + uninstall cleanly,
✓ user content (model/theme keys) preserved across install/uninstall,
✓ idempotent re-install.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
¹ Codex requires you to trust new hooks before they run. After `repocache init`, open Codex CLI once and run `/hooks` to trust the entry.
107
+
² OpenCode does not yet support a `SessionStart` hook ([upstream feature request](https://github.com/sst/opencode/issues/5409)).
105
108
106
109
All edits are idempotent and tagged with a `repocache:managed` marker so `repocache uninstall` removes only what repocache added, preserving any other entries you've set.
107
110
@@ -197,6 +200,7 @@ If `git clone <url>` works in your shell, repocache works.
197
200
-**Removing a repo doesn't free disk by itself.**`repocache repo rm <name>` removes the config entry but leaves the cache on disk. To free the disk: `chmod -R u+w ~/.local/share/repocache/repos/<name> && rm -rf ~/.local/share/repocache/repos/<name>`. The chmod is necessary because the cache tree is read-only.
198
201
-**Large repos.** Repocache does full clones. No sparse-checkout or partial-clone yet. Chromium/llvm-sized repos will feel it.
199
202
-**OpenCode project-shadow bug.** When a project-level `AGENTS.md` exists, OpenCode silently ignores the global one — including `@REPOCACHE.md`. Upstream issue; `init` prints a warning.
203
+
-**No bg-sync for OpenCode.** OpenCode doesn't have a `SessionStart` hook yet. Other three agents auto-refresh stale repos on session start.
200
204
-**No MCP server in v1.** The CLI is the only surface. MCP wrappers can be added later.
| OpenCode |`~/.config/opencode/` exists |`~/.config/opencode/REPOCACHE.md`, `~/.config/opencode/AGENTS.md`, `~/.config/opencode/opencode.json`| No |
354
+
| Codex CLI |`~/.codex/` exists |`~/.codex/REPOCACHE.md`, `~/.codex/AGENTS.md`, `~/.codex/config.toml`|Yes (requires user to run `/hooks` once to trust)|
@@ -427,20 +427,51 @@ The sidecar state file (`agents.state.json`) records, per agent:
427
427
428
428
Uninstall reads this file to know exactly what to remove. If the user has hand-edited the agent's config and our entries are gone, uninstall is a no-op for those.
429
429
430
-
### 8.6 SessionStart hook (Claude Code only)
430
+
### 8.6 SessionStart hook (Claude, Codex, Gemini)
431
431
432
-
Added to `~/.claude/settings.json` under `hooks.SessionStart`:
432
+
All three agents with a SessionStart-equivalent get the same wrapper
433
+
command (`repocache __bg-sync`) installed. The hook entry shape is
0 commit comments