loki-seal — Claude Code skill: what it does, how to install
Prevents marking a task as finished when tests fail, get skipped, or lose assertions. It guides the agent on passing the local loki-seal verification hook.
npx skills add asklokesh/loki-mode --skill loki-seal -a claude-codeWhat loki-seal does
This skill provides advisory guidelines so the agent knows what checks to expect. Actual enforcement comes from the plugin Stop hook in bin/loki-seal.js. The hook detects test runners locally and executes test suites on the working tree without model calls. Supported runners include npm test with Jest, Vitest, or node --test, along with pytest, go test, and cargo test.
Stopping is blocked if new test failures appear since the session started or if the test suite crashes. The hook catches deleted test files, drops in assertion counts, and newly added skip, xfail, or only flags. It also flags CI workflow edits that soften test steps. Requirements from the first prompt are parsed into a delivery contract, requiring passing tests with real assertions.
Installing only the skill gives the agent guidance, while enforcement requires the hook. A clean run finishes with a six-line verification receipt that includes test counts and a working tree hash.
What it helps with
- block completion when tests newly fail in the working tree
- catch deleted test declarations or weakened assertion counts
- verify delivery contracts derived from initial prompt requirements
- prevent stripping or softening test steps inside CI workflows
Example prompts for the agent
- Inspect the working tree with loki-seal before finishing the task.
- Run the test suite and verify all request requirements pass.
- Check test integrity and generate the completion receipt.
How to install loki-seal
1Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a claude-code2Manually: put the files in place
~/.claude/skills/loki-seal/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/loki-seal/
1Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a codex2Manually: put the files in place
.agents/skills/loki-seal/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a cursor2Manually: put the files in place
.cursor/skills/loki-seal/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install asklokesh/loki-mode loki-seal2Manually: put the files in place
.github/skills/loki-seal/SKILL.md1Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a gemini-cli2Platform CLI
gemini skills install https://github.com/asklokesh/loki-mode --path packages/loki-seal/skills/loki-sealManually: put the files in place
.devin/skills/loki-seal/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add asklokesh/loki-mode --skill loki-seal -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about loki-seal
How to install loki-seal in Claude Code?
Run npx skills add asklokesh/loki-mode --skill loki-seal -a claude-code. The skill file is placed at ~/.claude/skills/loki-seal/SKILL.md.
What does loki-seal do?
It advises the agent on rules required to complete coding tasks in repos with tests. It ensures the assistant does not finish work while tests fail, disappear, or get skipped.
Does loki-seal run automated enforcement by itself?
No, the skill registers no hooks and only advises the agent. Strict enforcement requires the companion Stop hook located at bin/loki-seal.js.
Source text
SKILL.md · Apache-2.0
---
name: loki-seal
description: Use when finishing any coding task in a repo with tests. Loki Seal runs the repo's real test suite and refuses to let you declare done while tests newly fail, or while tests or CI config were deleted, skipped, xfailed or weakened. Runs locally with no model calls.
---
# Loki Seal
The enforcing piece is the plugin's Stop hook (`bin/loki-seal.js`). This skill is advisory: it tells you what the hook checks so you do not trip it. It registers no hooks itself.
When you try to finish, the hook:
1. Detects the runner (npm test with node --test/jest/vitest, pytest, go test, cargo test) and runs the real suite on the working tree.
2. Blocks the stop when tests newly fail since session start (already-red tests are reported, not blamed, except that a request item whose tests fail now always blocks), when the run crashed or ran nothing, when the total test count dropped, or when, compared with the session baseline, a test file was removed, test declarations or assertions dropped, a skip/xfail/only marker was added, or a CI workflow test step was removed or softened.
3. Reads the delivery contract from your first request (see README) and blocks while a request item (a must or bullet line of 2+ keywords) has no matching test that contains an assertion token and that the runner reported as passed (comments, docstrings, string, template and regex literals, skipped tests and tests in files the runner never ran never count), and always blocks while any test matched to a request item fails now: failing tests never count as covered. Only sentences opening with I, we, let me or let's (and tool-version or status notes) are dropped as chat and listed in the contract line; You, Our, My and Please sentences with a modal are requirement items. A spec file counts only when you mark it ("spec: docs/x.md"); when no contract can be derived the receipt says "NOT VERIFIED: no contract".
4. Reports a 6-line receipt (outcome, runner and counts, tests-integrity, contract, tree hash, Verified by Loki link).
## What to do when it blocks
Fix the production code. Do not delete, skip, xfail or weaken tests to get green; that is exactly what the hook detects. If a test is genuinely wrong, tell the user and let them decide.
## Install
Install the plugin: `claude plugin marketplace add <owner/repo or path>`, then install `loki-seal` from the `/plugin` UI. Installing only this skill gives you the guidance but no enforcement.
© asklokesh · Apache-2.0 · asklokesh/loki-mode