Repository navigation
feat(agents): prompt hooks, MCP instructions and native Claude Code install - #754
Merged
Merged
Conversation
…nstall cora hook context/session inject code-search results into agent prompts. cora install now sets up Claude Code natively (hooks, MCP alwaysLoad, cora-code skill, CLAUDE.md block). The MCP server sends instructions. Refs #753.
…ess MCP permissions Verified against Claude Code 2.1.325: both hooks run and inject context, and the model calls the alwaysLoad MCP tool directly. Refs #753.
# Conflicts: # src/embed/mod.rs
…ttings.json Indexing a serde_json Value mutably inserts null for a missing key; use get_mut. Found by Cora Review on the pull request. Refs #753.
Only a missing file counts as empty; permission, encoding and I/O errors stop the install before it can overwrite the user's settings or instruction file. Found by Cora Review on the pull request. Refs #753.
…instead of panicking Found by Cora Review on the pull request. Refs #753.
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.
What
cora hook contextreads an agent's prompt (Claude Code / Hermes hook JSON on stdin, or--prompt), searches the project's index (keyword + meaning + call graph) and prints a short block of matching symbols plus the cora tools to use. It never downloads the model, is time-boxed, stays silent for chit-chat and unindexed projects, and always exits 0.cora hook sessionprints a one-line reminder at session start.instructionssaying when to use each tool.cora installsets up Claude Code natively:UserPromptSubmitandSessionStarthooks merged into~/.claude/settings.json, MCP registration withalwaysLoad, thecora-codeskill and a managed block in~/.claude/CLAUDE.md. Idempotent,--dry-run,--remove,--no-instructions; a settings file that is not JSON is never overwritten.src/commands/agents/for the other agents, plus the research notes indocs/design/agent-integration-research.md.Why
Agents only use code search when the model remembers a tool exists. Injecting results at prompt time, and telling the model how to use the tools, makes the index used by default. Refs #753 (Hermes, pi/omp and opencode follow in separate PRs).
Testing
cargo fmt --all -- --check,cargo clippy --all-targets --features tree-sitter -- -D warnings,cargo test --features tree-sitterpass locally.tests/hook_context.rsruns the real binary with the tiny fixture model (code question, chit-chat, unindexed project, garbage stdin, Hermes envelope,--prompt).Generated by Claude Code