From ironclaude
Configure Ollama as the validation backend for professional mode hooks
npx claudepluginhub robertphyatt/ironclaude --plugin ironclaudeThis skill uses the workspace's default tool permissions.
Configure Ollama as the validation backend for professional mode hooks. This replaces the slow Claude Haiku CLI calls (~12-15s) with near-instant local Ollama calls (~1s).
Automates Ollama installation, hardware-based model selection, GPU setup, and client integration (Python/Node.js/REST) for local LLM inference on macOS/Linux/Docker.
Adds Ollama MCP server exposing local models as tools (list_models, generate) for Claude Code container agent to offload cheap/fast tasks like summarization, translation, queries.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Configure Ollama as the validation backend for professional mode hooks. This replaces the slow Claude Haiku CLI calls (~12-15s) with near-instant local Ollama calls (~1s).
Display:
๐ง Hook Validation Backend Setup
Professional mode hooks that use LLM validation (benefiting from Ollama):
- Checks if messages relate to the active plan (topic-change-detector) โ uses LLM
- Confirms task completion (task-completion-validator) โ uses LLM
Other professional mode hooks (rule-based, no LLM):
- Validates that code changes match plan scope (professional-mode-guard)
- Detects when subagents complete (subagent-drift-detector)
By default, this uses Claude Haiku via the CLI, but it's slow (~12-15 seconds per call)
due to CLI startup overhead.
Ollama runs locally with near-instant response times (<1 second).
This setup configures Ollama as your validation backend.
Run:
ollama --version
If command not found, display:
โ Ollama not found.
Install Ollama: https://ollama.com/download
After installing, run: ollama serve
Then retry this setup.
Then STOP.
If version < 0.5.0, display:
โ Ollama version X.X.X found, but 0.5.0+ required for JSON schema support.
Update Ollama: https://ollama.com/download
Then STOP.
Use AskUserQuestion:
Ollama detected. Is http://localhost:11434 the correct URL?
Options:
If B, prompt for custom URL.
Use AskUserQuestion:
Would you like to configure a fallback Ollama URL?
This is useful when your primary Ollama runs on a remote machine.
If the primary is unreachable (2s timeout), hooks will try the fallback.
Options:
If A: No fallback_url in config.
If B: Set ollama.fallback_url to http://localhost:11434.
If C: Prompt for custom fallback URL.
Run:
ollama list
Analyze the output and recommend the fastest model that's at least Haiku-quality.
Known good models (in order of preference for this task):
Models NOT recommended:
If no suitable models found, display:
โ ๏ธ No suitable models found for hook validation.
Recommended models:
โข ollama pull qwen3:8b (5.2 GB, recommended, reliable JSON)
โข ollama pull llama3.2:3b (2.0 GB, fast, good quality)
โข ollama pull gemma2:2b (1.6 GB, lightweight, good quality)
After pulling a model, run this setup again.
Then STOP.
Use AskUserQuestion to let user pick from available suitable models.
Run a test call:
curl -s --max-time 10 "$URL/api/generate" \
-d '{"model": "MODEL", "prompt": "Respond with only: {\"ok\": true}", "stream": false, "format": {"type": "object", "properties": {"ok": {"type": "boolean"}}, "required": ["ok"]}}'
Verify response contains valid JSON with "ok": true.
If test fails, display:
โ Configuration test failed.
Options:
A) Try a different model
B) Keep config anyway (may have parsing issues)
C) Cancel setup and keep Haiku default
Write to ~/.claude/ironclaude-hooks-config.json:
{
"validation_backend": "ollama",
"ollama": {
"url": "URL",
"fallback_url": "FALLBACK_URL (omit if not configured)",
"model": "MODEL_NAME"
},
"timeout_seconds": 60
}
Display:
โ
Ollama validation backend configured successfully!
Config saved to: ~/.claude/ironclaude-hooks-config.json
Backend: ollama
Model: MODEL_NAME
URL: URL
Fallback URL: FALLBACK_URL (or "none")
Hook validation will now use Ollama instead of Haiku.
Expected response time: <1 second (vs ~12-15 seconds with Haiku)
To revert to Haiku: rm ~/.claude/ironclaude-hooks-config.json