init-ocaml

init-ocaml is a command for Claude Code from avsm/ocaml-claude-marketplace. It costs 17 tokens per session (899 once invoked), scanned A, original, ISC.

A command that starts a new OCaml project with Dune, opam, standard configuration files, documentation, and continuous-integration setup. Dune builds OCaml projects, opam manages OCaml packages, and CI runs automated checks.

In plain words
What is it for?
Use it to create the project files, license, README, formatting rules, Git ignores, package configuration, and CI workflow based on the chosen author, license, hosting, platform, and OCaml version.
Why use it?
It removes the repetitive setup work needed before writing code in a new OCaml repository.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths.

Part of the ocaml-dev plugin — 21 skills, 5 commands shipped together

Good fit Use it to create the project files, license, README, formatting rules, Git ignores, package configuration, and CI workflow based on the chosen author, license, hosting, platform, and OCaml version.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/avsm/ocaml-claude-marketplace/init-ocaml
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/avsm/ocaml-claude-marketplace

Made for: Claude Code.

Or install ocaml-dev, the plugin that ships this one along with the rest of its 21 skills, 5 commands.

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 init-ocaml

README.md
[![agentmods](https://agentmods.dev/badge/commands/avsm/ocaml-claude-marketplace/init-ocaml/github.svg)](https://agentmods.dev/commands/avsm/ocaml-claude-marketplace/init-ocaml)
Your own site
<a href="https://agentmods.dev/commands/avsm/ocaml-claude-marketplace/init-ocaml"><img src="https://agentmods.dev/badge/commands/avsm/ocaml-claude-marketplace/init-ocaml/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 init-ocaml

Your own site · 80×15
<a href="https://agentmods.dev/commands/avsm/ocaml-claude-marketplace/init-ocaml"><img src="https://agentmods.dev/badge/commands/avsm/ocaml-claude-marketplace/init-ocaml.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 17 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 899 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.00017 $0.00899
Opus 5 $0.00009 $0.00449
Sonnet 5 $0.00003 $0.00180
Haiku 4.5 $0.00002 $0.00090

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

Security

Grade A, and why

init-ocaml 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 6d 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.

plugins/ocaml-dev/commands/init-ocaml.md · 113 lines

How it starts

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

Initialize OCaml Project

This command creates a new OCaml project with all standard files and configuration.

Arguments

Project name: $ARGUMENTS (defaults to current directory name if not provided)

Configuration

Read user configuration from ~/.claude/ocaml-config.json. If it doesn't exist, prompt the user for:

  • Author name
  • Author email
  • Preferred license (ISC, MIT, Apache-2.0)
  • CI platform (github, tangled, gitlab)
  • Git hosting (github.com/user, tangled.org/@user, gitlab.com/user)
  • OCaml version minimum (default: 5.2.0)

Offer to save configuration to ~/.claude/ocaml-config.json for future use.

Files to Create

Essential Files

  1. dune-project - Build configuration with opam generation
  2. dune (root) - With (data_only_dirs third_party)
  3. .opam - Generated by dune (do not create manually)
  4. .ocamlformat - Code formatting (version 0.28.1)
  5. .gitignore - Standard OCaml ignores + third_party/
  6. LICENSE.md - Based on configured license
  7. README.md - Project documentation template

CI Configuration (based on ci_platform setting)

  • github: .github/workflows/build.yml
  • tangled: .tangled/workflows/build.yml
  • gitlab: .gitlab-ci.yml

Source Files

  1. lib/dune - Library stanza
  2. lib/.ml - Main module with license header
  3. lib/.mli - Interface with documentation, written under the doc-style skill, which you should invoke before writing any doc comment

Test Files

  1. test/dune - Test configuration
  2. test/test_.ml - Basic test skeleton with Alcotest

Workflow

  1. Check if directory is empty or confirm overwrite
  2. Read or prompt for configuration
  3. Determine project name from argument or directory
  4. Create all files using templates from the ocaml-project-setup skill
  5. Run dune build @check to verify setup
  6. Report success and suggest next steps

Template Variables

Replace these in templates:

  • {{PROJECT_NAME}} - Project name (snake_case)
  • {{PROJECT_NAME_KEBAB}} - Project name (kebab-case)
  • {{AUTHOR_NAME}} - From config
  • {{AUTHOR_EMAIL}} - From config
  • {{YEAR}} - Current year
  • {{LICENSE}} - License identifier
  • {{OCAML_VERSION}} - Minimum OCaml version
  • {{GIT_URL}} - Full git URL based on hosting config
  • {{SOURCE_STANZA}} - dune source stanza based on hosting:
    • tangled: (source (tangled handle/{{PROJECT_NAME_KEBAB}}))
    • github: (source (github user/{{PROJECT_NAME_KEBAB}}))
    • gitlab: (source (gitlab user/{{PROJECT_NAME_KEBAB}}))

Read the full file on GitHub · 113 lines

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. 6d ago Changed · +1 lines 21a70df3ffef
  2. 10d ago First seen · 112 lines · 17 tokens per session scan A 358593810890

Subscribe to this mod's changes

init-ocaml is a command published in the GitHub repository avsm/ocaml-claude-marketplace (35 stars, last pushed 8d ago), licensed ISC. It adds 17 tokens to every session and 899 once invoked, about $0.0001 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-30.