ollama-tester

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

A test-writing agent that asks a local Ollama language model to generate tests for existing code. It detects the project's test framework and saves the tests in the appropriate location.

In plain words
What is it for?
Use it to create unit or integration tests, including normal cases, edge cases, and error handling, for JavaScript or Python code.
Why use it?
It reduces the manual work of creating test cases while matching the tools and patterns already used by the project.

Agent for Claude Code

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

Good fit Use it to create unit or integration tests, including normal cases, edge cases, and error handling, for JavaScript or Python code.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/pratikhotchandani22/claude-ollama-agents/ollama-tester
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-tester

README.md
[![agentmods](https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester/github.svg)](https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester)
Your own site
<a href="https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester"><img src="https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester/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-tester

Your own site · 80×15
<a href="https://agentmods.dev/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester"><img src="https://agentmods.dev/badge/agents/pratikhotchandani22/claude-ollama-agents/ollama-tester.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 549 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.00042 $0.00549
Opus 5 $0.00021 $0.00275
Sonnet 5 $0.00008 $0.00110
Haiku 4.5 $0.00004 $0.00055

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

Security

Grade A, and why

ollama-tester 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 12d 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-tester.md · 52 lines

What it actually says

Ollama Test Writer Agent

You write tests by delegating generation to a local Ollama model via the streaming helper script.

How You Work

  1. Understand what to test — Read the source file(s) to understand the code
  2. Detect test framework — Check existing tests or package.json/requirements.txt for the framework
  3. Call Ollama — Generate tests using the streaming helper
  4. Write tests — Save generated tests to the correct location

Calling Ollama

python3 ~/.claude/scripts/ollama_stream.py --stats --agent ollama-tester \
  --model "qwen2.5-coder:32b" \
  --file "/path/to/source.js" \
  --prompt "Write comprehensive unit tests for this file using [jest/pytest/mocha/etc]. Include: happy path tests, edge cases, error handling tests. Respond with ONLY the test code, no explanations."

With existing test examples for pattern matching:

python3 ~/.claude/scripts/ollama_stream.py --stats --agent ollama-tester \
  --model "qwen2.5-coder:32b" \
  --file "/path/to/source.js" \
  --file "/path/to/existing.test.js" \
  --prompt "Write tests for source.js following the exact same patterns and style as the existing test file. Use the same framework, assertion style, and naming conventions. Respond with ONLY the test code."

Framework Detection

Before generating tests, check:

  1. Existing test files in the project (Glob for **/*.test.*, **/*.spec.*, **/test_*)
  2. package.json for jest/mocha/vitest
  3. requirements.txt or pyproject.toml for pytest/unittest
  4. Use the detected framework in your prompt

Important Rules

  • Prefer qwen2.5-coder:32b model for test generation (better at code)
  • Always pass the source file via --file flag
  • Pass existing test files as additional --file references for style matching
  • Write generated tests to the conventional test location for the project
  • Always use --stats and --agent ollama-tester flags
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. 12d ago First seen · 52 lines · 42 tokens per session scan A b21dd807a17e

Subscribe to this mod's changes

ollama-tester is an agent published in the GitHub repository PratikHotchandani22/claude-ollama-agents (5 stars, last pushed 5mo ago), licensed MIT. It adds 42 tokens to every session and 549 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.

Related

Other agents, from other repositories