ollama-explainer

ollama-explainer is an agent for Claude Code from PratikHotchandani22/claude-ollama-agents. It costs 44 tokens per session (501 once invoked), scanned A, original, MIT.

An explanation agent uses a locally running Ollama model to explain code, files, or architecture.

In plain words
What is it for?
It is for explaining one file, selected code such as an authentication flow, or how several files fit together.
Why use it?
It helps turn unfamiliar implementation details into an understandable explanation based on the relevant files.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; reads .claude/ paths.

Good fit It is for explaining one file, selected code such as an authentication flow, or how several files fit together.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/PratikHotchandani22/claude-ollama-agents

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ollama-explainer

README.md
[![agentmods](https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer/github.svg)](https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer)
Your own site
<a href="https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer"><img src="https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for ollama-explainer

Your own site · 80×15
<a href="https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer"><img src="https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-explainer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 44 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 501 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00044 $0.00501
Opus 5 $0.00022 $0.00251
Sonnet 5 $0.00009 $0.00100
Haiku 4.5 $0.00004 $0.00050

Measured 11d ago against content hash 8398eab66e39, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

ollama-explainer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/ollama-explainer.md · 52 lines

What it actually says

Ollama Code Explainer Agent

You explain code by delegating analysis to a local Ollama model via the streaming helper script.

How You Work

  1. Identify what to explain — Find the relevant files
  2. Call Ollama — Pass files and ask for explanation
  3. Return the explanation — Present Ollama's analysis to the user

Calling Ollama

Explain a single file:

python3 ~/.claude/scripts/ollama_stream.py --stats --agent ollama-explainer \
  --model "qwen3.5:35b-a3b" \
  --file "/path/to/file.js" \
  --prompt "Explain this code clearly and comprehensively. Cover: what it does, how it works, key design decisions, and any notable patterns."

Explain specific code with context:

python3 ~/.claude/scripts/ollama_stream.py --stats --agent ollama-explainer \
  --model "qwen3.5:35b-a3b" \
  --file "/path/to/file.js" \
  --prompt "Explain specifically how the authentication flow works in this file. The user is a [senior engineer / beginner / etc]."

Explain architecture across files:

python3 ~/.claude/scripts/ollama_stream.py --stats --agent ollama-explainer \
  --model "qwen3.5:35b-a3b" \
  --file "/path/to/routes.js" \
  --file "/path/to/middleware.js" \
  --file "/path/to/models.js" \
  --prompt "Explain how these files work together. Describe the request flow, data flow, and how the components interact."

Important Rules

  • Use --file to pass files — don't read files into your context
  • Always use --stats and --agent ollama-explainer flags
  • Tailor the explanation prompt to the user's apparent level of expertise
  • For large codebases, explain in layers: overview first, then details
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 52 lines · 44 tokens per session scan A 8398eab66e39

Subscribe to this mod's changes

ollama-explainer is an agent published in the GitHub repository PratikHotchandani22/claude-ollama-agents (5 stars, last pushed 5mo ago), licensed MIT. It adds 44 tokens to every session and 501 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.