/clio-core-skills:chimod-devfrom clio-core-skills
Guides writing a CLIO Core runtime module (ChiMod) outside the clio-core repo: install with headers, clio_mod.yaml, tasks, runtime, client, codegen, CMake, loading, testing, or a CTE interposer layer.
Ships in clio-core-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A ChiMod is a shared library that the Context Runtime loads at startup. Each
instance of it is a pool, with one container per node when composed
local. Clients send tasks: structs that name a method id and carry IN
and OUT fields. The runtime routes each task to a container, which runs the
matching handler as a coroutine on a worker thread.
This skill is self-contained: you do not need a clio-core checkout. Facts were
checked against clio-core dev (bd1dc3183); source paths in parentheses are
provenance for maintainers only.
| file | read when |
|---|---|
| TEMPLATE.md | creating a module: every file of a compilable out-of-tree module (clio_repo.yaml, clio_mod.yaml, tasks, client, runtime, CMake, test, compose), the generated code, the build commands |
| REFERENCE.md | writing handler or client code: Task fields, PoolQuery kinds, Future, coroutine macros, yield, locks, return codes, bulk transfers, periodic tasks, Monitor, loading rules, CMake functions |
| INTERPOSER.md | the module sits in the CTE data path and speaks the core's Put/Get interface (cache, encoding, accounting, replication-like layers) |
The pip wheel (pip install iowarp-core) ships the libraries, the clio-run
CLI (including clio-run refresh, the code generator) and the Python
bindings, but no C++ headers and no CMake package. You cannot compile a
module against it. Use one of these, which run a full cmake --install and so
ship include/clio_runtime/..., include/clio_ctp/..., the admin and CTE
headers, and lib/cmake/clio-core/clio-coreConfig.cmake:
| route | command | notes |
|---|---|---|
| conda | conda install -c iowarp -c conda-forge iowarp-core | Linux, macOS. Use $CONDA_PREFIX as the prefix |
| Spack | spack install iowarp (package from the repo's installers/spack repo) | variants select optional parts |
| .deb / .rpm | release assets of github.com/iowarp/clio-core | installs to /usr; pulls libzmq3-dev, libyaml-cpp-dev, libmsgpack-dev, libsodium-dev |
| source | cmake --preset=release -DCLIO_CTP_ENABLE_LIBPRESSIO=OFF && cmake --build build && cmake --install build --prefix <p> | the only route on Windows (preset windows-release). Keep the LibPressio flag: without it a build without compression installs a broken package config (see Debugging) |
The iowarp/deploy-cpu Docker image is not enough: it copies
/usr/local/lib, bin and share but not /usr/local/include. Use
iowarp/deps-cpu (dependencies only) and a source install inside it.
One install for both build and run. A module records a fingerprint of the
runtime headers and coroutine/GPU options it was compiled against, and a
runtime with a different fingerprint refuses to load it. So run the module
with the clio-run from the same install whose headers you compiled against,
not with a pip clio-run beside a conda install.
myorg/counter. Keep the directory name,
module_name and header stem identical.clio_mod.yaml: top-level k<Name>: <id> keys. Ids 0-9 are
inherited (kCreate: 0, kDestroy: 1, kMonitor: 9, unused ones -1);
yours start at 10. An interposer's own verbs start at 100.clio-run refresh <dir with clio_repo.yaml>. It writes
include/<ns>/<mod>/autogen/<mod>_methods.h and
src/autogen/<mod>_lib_exec.cc. CMake never runs it: re-run after every
clio_mod.yaml change, and commit the output. Then apply the one-line
sed fix of TEMPLATE.md section 13 (step 1b): releases whose generator
predates clio-core PR #1418 write four signatures that do not match the
Container base. The fix is harmless on a fixed generator.CreateParams (with chimod_lib_name,
serialize, LoadConfig), CreateTask/DestroyTask/MonitorTask
aliases, and one struct per method with a default constructor,
SerializeIn, SerializeOut, Copy and AggregateOut.clio::run::TaskResume, a Client client_ member, using CreateParams,
GetWorkRemaining(), the autogen override declarations, and
CLIO_TASK_CC(<ns>::<mod>::Runtime) at the end of the .cc.AsyncCreate sent to clio::run::kAdminPoolId, one
Async<Name> per method returning a Future. Define them in a .cc.find_package(clio-core CONFIG REQUIRED), then
add_clio_module_client / add_clio_module_runtime, linking
clio::run::admin_client / clio::run::admin_runtime yourself.main() (TEMPLATE.md section 11): CLIO_INIT(kClient, true), check Create's rc is 0 before anything else, then call your
methods. Run it with CLIO_REPO_PATH = your library directory,
CLIO_TEST_MODE=1, a private CLIO_PORT. Repeat with CLIO_FORCE_NET=1.clio-run start with
CLIO_REPO_PATH set (or install the library next to the runtime library),
then clio-run compose start <file.yaml>.PoolQuery::Null() (the task fails with rc -1001).
Use Local() when unsure and Dynamic() for Create. Create goes to
kAdminPoolId, takes an explicit non-null pool id and a caller-chosen pool
name, and is get-or-create by that name.Init, Run, SaveTask,
LoadTask, AllocLoadTask, Local*Task, NewTask, NewCopyTask,
AggregateOut/AggregateIn dispatch), except in an interposer, whose
forwarding dispatch is hand-written and kept out of clio_repo.yaml.AggregateOut touches OUT/INOUT fields only and never calls Copy().
Copy overwrites the origin's identity and corrupts a live runtime.CreatePoolFields:
task.template Cast<clio::run::admin::CreatePoolFields>()->GetParamsAs<CreateParams>().
Calling task->GetParams() is undefined for composed pools.CLIO_TASK_BODY_BEGIN/END and use
CLIO_CO_AWAIT/CLIO_CO_RETURN, never raw co_await, so both coroutine
back ends build.CLIO_CO_AWAIT(clio::run::yield(us)) with us > 0. Put long
blocking I/O on a thread pool you own.CoMutex/CoRwLock via their scoped guards; short sections; not
held across an await; never log inside lock/unlock.Client, stored as a member.main() or your own; never Catch2 with runtime
initialization (it segfaults). The runtime's simple_test.h is not installed.| symptom | cause | fix |
|---|---|---|
Create rc 22 (EINVAL), log ChiMod '<name>' not found | library not found, or chimod_lib_name != compose mod_name | put the dir on CLIO_REPO_PATH before the runtime starts; check the name; CTP_LOG_LEVEL=debug shows the scan |
log Skipping ChiMod ...: ABI fingerprint ... does not match | built against headers of another version or build options | rebuild against the install whose clio-run you run |
log Skipping duplicate ChiMod | an older copy earlier in the search path wins | remove it, or put your dir first |
Windows: rc 22 although the DLL is on CLIO_REPO_PATH | a DLL it imports (for example your *_client.dll) is not on the DLL search path | add the dir to PATH too, or install next to clio_run_cxx.dll |
CMake: no declaration matches '...Runtime::SaveTask(...)' (also LoadTask, LocalLoadTask, LocalSaveTask) | generator bug before clio-core PR #1418: task_ptr by value | the sed fix after every refresh (TEMPLATE.md section 13) |
Windows CMake: Could not find ... "yaml-cpp" | the install has the dependency DLLs but not their CMake packages | add <clio-core build>/vcpkg_installed/x64-windows to CMAKE_PREFIX_PATH |
| Windows: test exits 127 at once | Debug build against a Release install, or <prefix>/bin not on PATH | build --config Release; add <prefix>/bin to PATH |
CMake: if given arguments: "AND" "NOT" "TARGET" "LibPressio::libpressio" ... Unknown arguments in iowarp-coreConfig.cmake | the install was configured without compression and without -DCLIO_CTP_ENABLE_LIBPRESSIO=OFF | reinstall with that flag, or edit that line of the installed file to read if(OFF AND NOT TARGET LibPressio::libpressio |
CMake: Missing clio_mod.yaml or wrong target names | file missing, or namespace:/module_name: appears in a comment first | remove those words from comments |
CMake: src/autogen/..._lib_exec.cc not found | generator not run | clio-run refresh <dir> before configuring |
| handler never runs, task returns rc 0 at once | method missing from the generated dispatch | re-run clio-run refresh after editing clio_mod.yaml |
| link error: undefined handler or task method | struct/handler name does not match k<Name> | kFoo needs FooTask and Runtime::Foo |
| OUT field zero or garbage | not in SerializeOut, or half-rebuilt tree | add it; rebuild everything |
| right on one node, wrong across nodes | field missing from SerializeIn (the local path skips serialization) | add it; test with CLIO_FORCE_NET=1 |
| broadcast result has one container's data | AggregateOut overwrites instead of merging | reduce (sum, max, concat) |
| test hangs or attaches to the wrong runtime | a runtime already listens on CLIO_PORT without your module | use a private CLIO_PORT and CLIO_TEST_MODE=1 |
| hang inside a handler | worker blocked, a lock held across an await, or a pool awaited that was composed after yours | see Rules |
Only for a module that will live inside the clio-core repository. There,
modules sit under a component directory (for example
context-transfer-engine/<mod>/) listed in that component's clio_repo.yaml
and added with add_subdirectory; the in-tree build links admin and bdev
automatically. Every C/C++ file gets the repository's BSD-3 license header and
doxygen docstrings, functions stay under 100 lines, and tests use the
in-tree simple_test.h registered with CLIO_REPO_PATH and a
clio_add_force_net_test variant. If the module has compose keys, add its
default entry (or the keys, commented out) to
context-runtime/config/clio_default.yaml, and document every key on its page
under site/pages/modules/. An out-of-tree module needs none of this.
What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/clio-bdevUse when configuring CLIO Core block devices: a clio_bdev pool (ram, file, hbm, pinned, noop, s3, gcs, daos), a CTE storage tier entry, capacity, persistence_level, alloc_log and --fresh, or a clio_safe_bdev erasure-coded array (members, parity, max_failures, rebuild). Triggers on "bdev_type", "capacity_limit", "alloc_log", "persistence_level", "safe_bdev", "parity disk", "S3 tier". Not for designing the whole chain (use storage-compose) or CTE core keys (use clio-cte-core)./clio-caeUse when importing external data into CLIO Core with the Context Assimilation Engine: writing OMNI files, running clio-cae, calling ParseOmni or clio_cee context_bundle from Python/C++, choosing sources (file, HDF5, HTTP, S3, GCS, Globus), allowed_roots, or composing the LLM summarizer (401.0). Triggers on "OMNI file", "clio-cae", "assimilate", "ParseOmni", "context_bundle", "label_matches", "summarizer". Not for searching imported data (use clio-indexer) or chain ordering (use storage-compose)./clio-compressorUse when enabling, configuring or debugging clio_cte_compressor (pool 562.0): building with CLIO_CTE_ENABLE_COMPRESS or Spack +compress, default_compress and presets, static vs dynamic (model-chosen) codecs, GPU codecs, chain placement, and stored vs logical size. Triggers on "compress my blobs", "default_compress", "zstd", "lz4", "kCompressDynamic", "562.0", "compression ratio". Not for choosing or ordering the whole chain; use storage-compose. Not for the blob API itself; use clio-cte-core./clio-cte-cachesUse when choosing, composing, tuning or debugging a CLIO Core CTE cache module: write-back (567.0), write-thru, the shared-memory cache (568.0) or the node-copy cache (563.0). Covers keys, chain order, ack and fsync semantics, staleness and loss per failure. Triggers on "write-back cache", "flush_period_ms", "fsync is slow", "lost writes after crash", "md_only", "invalidate_on_flush", "stale size on another node". Not for the core or chain design; use clio-cte-core or storage-compose./clio-cte-coreUse when configuring, calling or debugging the Context Transfer Engine core (clio_cte_core): the persistent core at 512.0, the volatile core at 540.0, tiers, scores, the metadata WAL and the C++/Python blob API (Tag, PutBlob, GetBlob, TagQuery, SyncTag) every chain speaks. Triggers on "clio_cte_core", "512.0", "540.0", "PutBlob rc=11", "metadata_log_path", "clio_cte_core_ext", "persistence_level". Not for choosing or ordering the chain; use storage-compose. Not for bdev keys; use clio-bdev./clio-fsUse when mounting, configuring or debugging the CLIO Core POSIX file layer: the filesystem ChiMod (560.0), the stream ChiMod (565.0), the clio_cte_fuse mount on Linux/Windows/macOS, the checkpoint fault handler (566.0), and the LD_PRELOAD/MPI-IO/HDF5/ADIOS2 adapters. Triggers on "clio_cte_fuse", "mount CLIO", "metadata_log_path", "CLIO_FUSE_", "fsync EIO", "case_insensitive", "stream pool". Not for chain design or blob APIs; use storage-compose or clio-cte-core.npx claudepluginhub iowarp/clio-kit --plugin clio-core-skillsOther plugins' skills for the same job