Polaris now auto-indexes and auto-searches your docs
You edit a doc, your index goes stale, your agent gets outdated results.
Starting today, polaris setup installs
two Claude Code hooks that fix this automatically — one keeps the index fresh, the other grounds every prompt with relevant docs.
Auto-index hook
A PostToolUse hook that fires after every Write, Edit, or MultiEdit.
When the changed file is a .md file
under an indexed directory, Polaris reindexes it on the spot.
- ~5 ms gate check — SHA-256 comparison skips unchanged files instantly
- ~300 ms reindex — when a file did change, re-chunking and re-embedding takes under a third of a second
- Non-fatal — errors log to stderr and exit 0, so a transient hiccup never surfaces a warning in Claude Code
- Installed by default —
polaris setupwrites this hook automatically
The hook entry in .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{ "type": "command", "command": "polaris hook index" }
]
}
]
}
} Auto-search hook
A UserPromptSubmit hook that searches the index on every qualifying prompt and injects the top result as context — before the model even starts thinking.
- Two gates — prompt must be 5–150 words (filters out "yes" and code dumps), and the top result must exceed a 0.02 RRF score threshold
- ~1 s latency — the ONNX embedding model adds about a second per qualifying prompt
- Opt-in — install with
polaris setup --search-hook
The hook entry (added alongside the index hook):
{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{ "type": "command", "command": "polaris hook search" }
]
}
]
}
} How to get it
One command installs everything — MCP config, agent instructions, and both hooks:
Don't want hooks? Pass --no-hooks to skip (or remove) them. Full install guide →
What's next
We're working on polaris-ingest — code, PDF, and .docx ingestion for Polaris Pro — and a web UI for browsing the index without an agent. Join the waitlist for early access and 50% off at launch.