Skip to content

feat(agents): make Claude Code, Hermes, omp, pi and opencode use cora's code search on every prompt #753

Closed

Description

@ajianaz

What problem does this solve?

cora install registers cora mcp in a few agents' MCP config files, installs one skill (cora-review, for reviews) in Claude Code, and documents a Claude Code commit guard. Nothing makes an agent use code intelligence (brain, explore, callers, impact) while it works, and for most agents registering the MCP server is not enough. Research of the current docs of the five agents (Claude Code, Hermes Agent, omp / oh-my-pi, pi, opencode) found:

  • MCP tools are hidden by default in four of five agents. Claude Code defers them behind tool search (per-server alwaysLoad: true exempts a server), opencode's default Code Mode hides them (codemode: false), pi defaults to exposure: "codemode" ("direct" declares them like built-ins), and omp bridges them as deferred tools (unverified). Hermes registers everything unless filtered.
  • Skills are the weakest lever everywhere: they depend on the model matching the description.
  • The deterministic lever is a pre-prompt hook that runs before the model sees the prompt and injects context: Claude Code UserPromptSubmit (command, stdout or additionalContext), Hermes pre_llm_call shell hook (stdout {"context": ...}, appended to the user message, needs a one-time user consent), pi and omp extension before_agent_start (with pi.exec to run a command), opencode plugin hooks (V2 session.hook("prompt") or "context", V1 chat.message / experimental.chat.system.transform).
  • MCP server instructions are added to the system prompt by omp (capped at 4,000 characters) and opencode (<mcp_instructions>), so one text in cora mcp helps every client that reads it.
  • Hooks run before MCP servers are available (Claude Code SessionStart), so the hook has to be a plain command, not an MCP call.
  • Details that bite: opencode docs describe V2 config (mcp.servers, plugins) while installed copies may be V1; Hermes loads only the first of .hermes.md, AGENTS.md, CLAUDE.md, scans context files for injection phrases and needs hooks approved once (~/.hermes/shell-hooks-allowlist.json); omp user-level foreign skill dirs (~/.claude/skills) are opt-in while ~/.agents/skills is native for omp, pi and opencode; opencode's explore sub-agent denies every tool but shell and read ones.

Proposed solution

  1. cora hook context: reads the prompt (hook JSON on stdin, or --prompt), finds the project from cwd, runs brain in natural-language mode and prints a short block (a handful of symbols with file, line and signature, plus how to dig deeper: cora_brain_search, cora_find_callers, cora_find_impact). It never fails loudly (empty output on any problem), never downloads the model, is bounded in time and size, skips prompts that are not about code, and has formats for each agent (--agent claude|hermes|plain). cora hook session prints a one-paragraph reminder for session start.
  2. cora mcp server instructions in initialize, and sharper tool descriptions.
  3. A cora-code skill (when to use brain, explore, callers, impact, affected before editing) installed in the skill directories the agents read.
  4. cora install for the five agents, idempotent and reversible (--remove), writing: Claude Code (claude mcp add-json with alwaysLoad, UserPromptSubmit and SessionStart hooks merged into ~/.claude/settings.json, skill, a managed block in ~/.claude/CLAUDE.md), Hermes (mcp_servers and hooks.pre_llm_call in ~/.hermes/config.yaml with a backup, skill, a note about the one-time hook approval), omp and pi (mcp.json with direct exposure, a before_agent_start extension), opencode (MCP entry for the detected config version with codemode: false, a plugin with the V1 and V2 entry points, cora_* allowed for sub-agents), and the shared ~/.agents/skills/cora-code.
  5. cora install --status shows, per agent, what is installed and what a user still has to do (Hermes hook approval, Claude project MCP approval).
  6. Docs with a table of what was verified against each agent's docs and what could not be.

Alternatives considered

Only a skill and MCP registration (the current state): depends on the model choosing to search. Only instruction-file rules: weaker than a hook and some agents load only one instruction file.

Before submitting

  • Research notes with sources for all five agents are kept with the work; unverified facts are listed and tested at runtime where the agent can be installed without an LLM key.

Activity

  1. added
    enhancement
    scope:code-intel
    epic:code-intelligence
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepic:code-intelligencepriority:highscope:code-intel

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions