/basal:basalfrom basal
Makes typed decisions (route, triage, classify, moderate, guard, pick a tool) with a local basal server, returning calibrated probabilities and an abstain-to-human rule instead of free text.
Ships in basal. 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.
None: SKILL.md is the whole skill.
basal does not generate text. You send one state (the data) and named questions; it answers every question in one pass with a typed answer and calibrated probabilities. Use it where the output is a choice, not prose.
A server is assumed running (basal-serve --model <model> --port 8000; see docs/SERVING.md). Then:
curl -s localhost:8000/v1/systemone -H 'content-type: application/json' -d '{
"state": "Order 4471 arrived damaged. Customer wants money back, today.",
"questions": {
"intent": {"type": "choice", "instructions": "What does the customer want?",
"criteria": {"refund": "money back", "replace": "a new item", "info": "information only"}},
"urgent": {"type": "noul", "instructions": "Is this urgent?"},
"tone": {"type": "score", "instructions": "How angry is the customer?", "criteria": ["calm", "annoyed", "angry"]}}}'
Python: Basal("http://127.0.0.1:8000").decide(state, questions) (from basal_sdk import Basal). TypeScript:
new Basal({url}).decide(state, questions) (clients/typescript).
"lang": "pl" | "en").instructions is one clear sentence about the state. Ask about one thing.criteria) must be mutually exclusive and exhaustive. Always include an other option when the
options do not cover everything. Describe each option in a few words: the model sees key: description.choice over many yes/no questions when exactly one thing is true; prefer multi when several can be.| type | use it for | read |
|---|---|---|
choice | exactly one of 2-255 options | choice, probabilities |
noul | yes / no | noul = P(yes) |
score | an ordered scale (urgency, severity, complexity) | score (expected level, 0 = first) |
multi | any number of labels apply | selected, a probability per label |
act | pick the action with the lowest expected cost, or defer | action, deferred |
tool | the next tool of an agent from tool definitions | tool, call |
classify, verify, compress, extract | rubric labels, claim checking, context compression, JSON fill | docs/QUESTION_TYPES.md |
ask_if / depends_on skip a question unless an earlier answer matches (the skipped answer is null).
Ready question sets (Polish and English): triage, moderation, compliance, guard_input, guard_output,
route_intent. basal-run --list-presets, Basal(url).preset(state, "triage").
b.guard(text, kind="input" | "output", policy="strict" | "permissive") returns action: pass | review | block | support (fixed precedence support > block > review > pass; a missing answer is a review).b.route(text) returns the intent, or "human" on low confidence or abstain.confidence (the top probability). It is calibrated by question type and option count."max_error": 0.05 on a question adds abstain: true when the confidence is below the threshold certified for
that error rate and type. Abstain means "send to a person", not "the answer is wrong". Without a certified threshold
every answer abstains (the answer says so): pick a target the model's calibration file certifies (the keys of its thresholds, docs/CALIBRATION.md)
or calibrate yourself."coverage": 0.9 adds answer_set: the options kept so that the right one is inside for about 90% of requests like
the calibration data. A one-element set is a confident answer; a larger set is honest uncertainty.Shipped thresholds were fitted on other data. If your texts, labels or options differ (and for any use that acts automatically), calibrate:
basal-calibrate labelled.jsonl --model <model> --mode fast writes CALIBRATION.custom.json with the leave-one-family-out
ECE and the share automated at each certified threshold. Format and options: docs/CALIBRATION.md.basal-serve ... --calibration CALIBRATION.custom.json. A target the file cannot certify is marked, and those
questions abstain.review, human). That is the design, not a failure.act or max_error so automatic action needs a certified
threshold, and keep a person in the loop for the rest.basal-router --replicas <small> --escalate <big> --escalate-below 0.8 asks the bigger replica again where the small one is unsure (docs/SERVING.md).max_error to make the abstain rate look better; the share that goes to a person is the cost of the
guarantee. Report the error rate and the automated share together.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub rkinas/basal --plugin basalOther plugins' skills for the same job