Repository navigation
Description
Scenario
A project has a small read-only script that prints a short status when there is something to act on, and prints nothing otherwise. I want every Agent I use in that project (Claude, Codex, Antigravity, Pi and OpenCode) to run it at session start and put its output in the session context, managed from one hooks.projects Entry in the global config.
What already works
hooks.projectsmaps the project root to itsentries, with the same shape ashooks.entries(reference/commands/hooks.md, "Projects, conflicts and recovery").- Claude, Codex and Antigravity have
SessionStartin the event catalog (internal/hooks/catalog.go), so a command binding covers them:
hooks:
projects:
~/path/to/project:
entries:
session-status:
description: Project status at session start
bindings:
claude: {events: {SessionStart: [{hooks: [{type: command, command: "node scripts/status.mjs", timeout: 30}]}]}}
codex: {events: {SessionStart: [{hooks: [{type: command, command: "node scripts/status.mjs", timeout: 30}]}]}}
antigravity: {events: {SessionStart: [{hooks: [{type: command, command: "node scripts/status.mjs", timeout: 10}]}]}}What is missing
- Pi and OpenCode. They need native code (
code,codeFileor an OpenCode v2package). The docs say Skillshare does not generate a universal hook runtime, and the dashboard supplies no OpenCode starter code because the APIs differ. I agree with both. What I could not find is an example of a Pi extension and an OpenCode plugin (v1 file and v2 package) that run one command at session start and pass its stdout to the session. The only pointers are the events used inscripts/hooks/real-agents.sh(pi.on("session_start"),session.created). - Working directory. I could not find from which directory each Agent runs a project hook command. If it is not the project root, a relative command like the one above breaks. It is unclear whether the recipe should use a
{files}wrapper that changes to the project root first. - Where the output goes. For each Agent it is unclear whether a session-start command's stdout reaches the model's context, is only shown to the user, or is dropped.
- Trust. Codex needs the project trusted and its new hooks reviewed in
/hooks(see issue Proposal: opt-in trust for Skillshare-managed Codex project hooks #951 for the project-scoped trust proposal). The real-agents runbook says Antigravity loads.agents/hooks.jsononly for a folder trusted in an interactive session. - Versioned settings. In a project, the Claude hook is written to
.claude/settings.json, which some repos version for other settings. Sync merges and keeps unrelated settings, and "Matching content alone does not establish ownership". A note on whether the managedhookskey should stay uncommitted would help, so a second clone does not see it as an unowned hook.
Request
A recipe under how-to/recipes/, like the Git hooks one: one project command at session start in every Agent. It would contain one Entry with each Agent's native binding: command bindings for Claude, Codex and Antigravity, a Pi extension, and an OpenCode v1 file and v2 package. Around that Entry, it would cover the working directory, where the output goes in each Agent, the trust steps, and what to commit. I am not asking for a universal runtime or for event translation between Agents.
Environment: Linux, skillshare v0.30.11.
Activity
[-]docs(recipes): one project command at session start in every Agent[/-][+]Recipe: one project command at session start in every Agent[/+]runkids commentedon Nov 24, 2026
Thanks for the detailed write-up, it made this easy to test.
#1002 adds the recipe for Claude Code, Codex, Pi and OpenCode (v1 file and v2 package). Each binding was run against a local endpoint that captured the model request, so the "where does the output go" answers come from what each Agent actually sent, not from their docs. A few things that came out of it:
cds to the Git root first.{files}only expands in Git bindings, so it can't help here.PreInvocationruns before every model call), so theSessionStartbinding in your example won't fire. I left it out of the recipe for now..opencode/opencode.jsonis an absolutefile://path, so it won't carry over to another clone as-is.Do you version
.claude/settings.jsonfor other settings in the repo you have in mind? That would help decide what the recipe should recommend.docs(hooks): add a recipe for one project command at session start (#…