Context for a prompt
ragdown_contextInject relevant Markdown context into user prompts as a hook-ready block, filtering low-similarity matches and skipping sections already sent in a session.
Instructions
For hooks that run before a turn: the documents related to a user prompt, as a ready-to-inject block, or empty text when nothing is similar enough. Unlike ragdown_recall it filters by min_score, skips short prompts and slash commands, and never returns a section twice for the same session_id. reset: true first forgets what that session was given; call it with an empty prompt after the client compacts or clears its context. format: 'claude-code' wraps the block as the JSON a Claude Code UserPromptSubmit hook adds to the prompt.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reset | No | Forget the sections already returned for session_id before answering, because the client no longer has them | |
| top_k | No | Default RAGDOWN_HOOK_TOP_K | |
| format | No | 'text' is the block itself. 'claude-code' is the block as a Claude Code hook's additionalContext, for an mcp_tool hook on UserPromptSubmit, which does not pass plain text on to the model | text |
| prompt | Yes | The user's prompt, verbatim | |
| max_chars | No | Most characters in the block. Default RAGDOWN_HOOK_MAX_CHARS | |
| min_ratio | No | Lowest share of the best hit's similarity a hit may have and still be included; 0 keeps every hit above min_score. Default RAGDOWN_HOOK_MIN_RATIO | |
| min_score | No | Lowest cosine similarity to include. Default RAGDOWN_HOOK_MIN_SCORE | |
| session_id | No | Stable id of the conversation; sections already returned for it are skipped |