ollama-sync

ollama-sync is a skill for Claude Code, Codex from mskadu/opencode-agent-skills. It costs 45 tokens per session (679 once invoked), scanned A, original, MIT.

A synchronizer for the Ollama model list in an opencode.json configuration file. Ollama is software that runs language models on a local computer.

In plain words
What is it for?
Use it to read the current configuration, retrieve locally available Ollama models, extract their names, and update the Ollama provider's model list.
Why use it?
The configuration can become outdated when models are added or removed from the computer. This keeps its listed models aligned with the result of the ollama list command.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/mskadu/opencode-agent-skills/ollama-sync
Any agent
npx skills add mskadu/opencode-agent-skills --skill ollama-sync
Clone the repo
git clone --depth 1 https://github.com/mskadu/opencode-agent-skills

Made for: Claude Code, Codex.

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-sync

README.md
[![agentmods](https://agentmods.dev/badge/skills/mskadu/opencode-agent-skills/ollama-sync.svg)](https://agentmods.dev/skills/mskadu/opencode-agent-skills/ollama-sync)
Your own site
<a href="https://agentmods.dev/skills/mskadu/opencode-agent-skills/ollama-sync"><img src="https://agentmods.dev/badge/skills/mskadu/opencode-agent-skills/ollama-sync.svg" alt="Measured on agentmods" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 679 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00045 $0.00679
Opus 5 $0.00023 $0.00340
Sonnet 5 $0.00009 $0.00136
Haiku 4.5 $0.00005 $0.00068

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

Security

Grade A, and why

ollama-sync 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 5d 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.

skills/ollama-sync/SKILL.md · 63 lines

How it starts

The opening of the file, as written. The whole thing — 63 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Ollama Model Synchronizer

Your Task

When asked to synchronize the local Ollama configuration, your primary goal is to ensure that the model list in the opencode.json file is an accurate reflection of the models available on the host system.

The process must involve three main steps:

  1. Fetch Live List: Execute ollama list via the bash tool to retrieve all currently available model names and tags on the machine.
  2. Parse and Extract: Parse the output of ollama list to extract only the clean list of model names (e.g., llama2, mistral).
  3. Update Config: Use the edit tool to replace the existing model list in opencode.json (specifically the ollama provider section) with the newly fetched, accurate list.

Workflow Details

  1. Primary Command Execution:
    • Run ollama list using the bash tool.
  2. Parsing Logic (Internal):
    • The output of ollama list needs to be parsed to isolate model names. Assume the output format is reliable enough to grep for model names.
  3. File Manipulation:
    • Use the read tool on opencode.json to understand the current structure.
    • Use the edit tool to modify the specific section containing the model list.

Step-by-step Logic

  1. Check Dependency: Confirm if the ollama command is available in the execution environment.
  2. Get System Models: Execute ollama list to get the current list of models.
  3. Isolate Names: Programmatically parse the output to create a comma-separated string of model names.
  4. Write Back: Use the edit tool to replace the old model list with the new comma-separated list in opencode.json.

Examples & Edge Cases

  • Empty List: If ollama list returns no models, the opencode.json model list should be cleared or set to an empty array, and the user should be warned.
  • Error Handling: If the ollama command fails or is not found, the process must stop, and the user should be informed that the synchronization failed due to environment issues.

Read the full file on GitHub · 63 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 63 lines · 45 tokens per session scan A ef464b584f18

Subscribe to this mod's changes

ollama-sync is a skill published in the GitHub repository mskadu/opencode-agent-skills (1 stars, last pushed 3mo ago), licensed MIT. It adds 45 tokens to every session and 679 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 skills, from other repositories

google-cloud-solution-guided-gke-ai-migration

Guides the migration of existing AI workloads (Cloud Run, Gemini API, Gemini Enterprise Agent Platform) to self-hosted GKE inference using gcloud and kubectl. Use when the user has an existing AI inference workload (on Cloud Run, the Gemini API, Gemini Enterprise Agent Platform, or a custom VM) and wants to move it to…

google/skills · 157 tokens

agent-platform-tuning

Agent Platform Model Tuning. Use when you need to fine-tune open models or Gemini models using Agent Platform infrastructure. Don't use for model training outside Agent Platform, model deployment to endpoints (use agent-platform-deploy), or managing serving endpoints (use agent-platform-endpoint-management).

google/skills · 64 tokens

developing-genkit-js

Develop AI-powered applications using Genkit in Node.js/TypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript/TypeScript, or when encountering Genkit errors, validation issues, type errors, or API problems.

google/skills · 60 tokens

agent-platform-prompt-management

Manages and orchestrates prompts in Agent Platform. Use when you need to create, list, retrieve, version, or delete managed prompts in Agent Platform. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform prompts.

google/skills · 55 tokens

agent-platform-rag-engine-management

Manage and query Agent Platform RAG Engine Corpora and retrieve grounded contexts using the Google GenAI SDK. Use when listing RAG corpora or files, inspecting a corpus, retrieving contexts, or generating content grounded in a RAG corpus. Do not use for standard database queries (use SQL/Spanner skills), Google…

google/skills · 85 tokens

gke-inference

Deploys and optimizes AI/ML inference workloads on GKE, using GPUs, TPUs, and model servers. Use when deploying GKE inference servers, configuring GKE GPU resources for inference, or deploying LLMs on GKE. Don't use for generic batch jobs or HPC task queues (use gke-batch-hpc instead).

google/skills · 74 tokens