/midnight-tooling:compact-clifrom midnight-tooling
Manages the Compact CLI toolchain for Midnight Network smart contract development. Handles compiler version management, toolchain setup, error resolution, and compilation troubleshooting.
Ships in midnight-tooling. 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.
Last verified: 2026-11-12 against
compactCLI 0.5.1 / compiler 0.36.0 — version outputs below re-run on 0.36.0; other commands, flags and exit codes last run 2026-09-17 against 0.31.1.
The Compact CLI (compact) is the command-line tool for managing the Midnight Network's smart contract development toolchain. It handles compiler version management, code formatting, fixup transformations, and compiler invocation.
Three distinct things share the "Compact" name. Always be precise about which is being referenced.
| Term | What It Is | Binary / Location | Version Command |
|---|---|---|---|
| Compact CLI | The command-line management tool (also called Compact Dev Tool, Compact Developer CLI, compact devtools) | compact (typically ~/.local/bin/compact) | compact --version |
| Compact (language) | The smart contract programming language | Source files: *.compact | N/A |
| Compact compiler | The compiler that transforms Compact source into ZK circuits and TypeScript | compactc.bin (managed by CLI, stored in $COMPACT_DIRECTORY) | compact compile --version |
Relationship: The Compact CLI manages and invokes the Compact compiler, which compiles Compact (the language) source files. The CLI is the orchestrator; the compiler is the worker it manages.
When users say "install Compact", they typically mean installing the Compact CLI (which then manages the compiler). When they say "update Compact", determine whether they mean:
compact self updatecompact updateThese are independent operations. The CLI and compiler have separate version numbers.
The toolchain reports three independent version numbers. Confusing them is a common source of errors.
| What | Commands | Example Output |
|---|---|---|
| CLI tool version | compact --version (or compact self) | compact 0.5.1 |
| Compiler version | compact compile --version, compact format --version, compact fixup --version | 0.36.0 (b5d9e4dfc 2026-11-03) (0.36.0 and later add the commit and date; take the first field) |
| Language version | compact compile --language-version, compact format --language-version, compact fixup --language-version | 0.28.0 |
The compiler also reports two additional versions relevant to DApp developers:
| What | Command | Example Output |
|---|---|---|
| Ledger version | compact compile -- --ledger-version | zkir-3.2.0-rc.2 on 0.36.0, which is the ZKIR backend version rather than a ledger version; 0.31.1 printed ledger-8.0.2. Take the ledger a compiler targets from the support matrix (0.36.x targets ledger 9) |
| Runtime JS package version | compact compile -- --runtime-version | 0.21.0 |
The CLI and compiler update independently:
| What to Update | Command | Check First |
|---|---|---|
| The compiler | compact update | compact check |
| The CLI tool | compact self update | compact self check |
⚠️ "Latest available" is not "latest supported".
compact checkmay report a newer compiler than the networks support. Pin to the network-supported compiler (currently0.36.0, on Mainnet, Preview and Preprod since they moved to ledger 9) for anything you intend to deploy. A later patch of it, such as0.36.1, keeps the same language and runtime versions. See references/version-management.md for details.
| Command | Aliases | Purpose |
|---|---|---|
compact compile <source> <target-dir> | c | Compile a Compact source file |
compact compile +<VER> <source> <target-dir> | Compile with a specific compiler version (full semver required) | |
compact format [FILES] | f, fmt | Format Compact source files |
compact format --check [FILES] | Check formatting without changes | |
compact fixup [FILES] | fx, fix | Apply fixup transformations (e.g. rename deprecated identifiers) |
compact fixup --check [FILES] | Check if fixups are needed without changes | |
compact update [VERSION] | u, up | Download compiler version, set as default |
compact list | l | List all available compiler versions (remote) |
compact list --installed | List locally installed compiler versions | |
compact check | ch | Check for compiler updates without downloading |
compact clean | cl | Remove all installed compiler versions |
compact clean --keep-current | Remove all except current default version | |
compact clean --cache | Remove all installed versions and the download cache (add --keep-current to preserve the current compiler) | |
compact update --no-set-default [VERSION] | Download compiler version without setting it as default | |
compact self check | s check | Check for CLI tool updates |
compact self update | s update | Update the CLI tool itself |
Every command accepts these flags:
| Flag | Environment Variable | Purpose |
|---|---|---|
--directory <DIR> | COMPACT_DIRECTORY | Use a custom artifact directory instead of $HOME/.compact |
The --directory flag can appear before or after the subcommand — both positions are equivalent. When both the flag and environment variable are set, the flag takes precedence. The directory is created automatically if it does not exist.
The CLI invokes the compiler via compact compile <source> <target-dir>. Use --skip-zk during development to skip proving key generation (significantly faster). Prefix with +VERSION (full semver, e.g. +0.29.0) to use a specific installed compiler version. See references/compile-format-fixup.md for all compiler flags, output structure, import paths, and compilation troubleshooting. See references/troubleshooting.md for compilation error messages and exit codes.
compact format formats .compact source files in place. When no files are specified, it recursively formats all .compact files in the current directory, respecting .gitignore. Use --check for CI pipelines (exits non-zero if changes needed).
compact fixup applies source-level transformations such as renaming deprecated identifiers. It shares the same file-targeting and --check behavior as format. See references/compile-format-fixup.md for full details on both commands. See references/troubleshooting.md for formatting and fixup error messages.
Install, list, switch, and remove compiler versions with update, list, check, and clean. The update command accepts partial versions (0, 0.29, or 0.29.0). See references/version-management.md for workflows and troubleshooting.
Update the CLI tool itself with compact self update. This is independent of compiler updates. See references/self-management.md for details.
| Reference | When to Read |
|---|---|
references/installation.md | First-time setup, PATH issues, new machine |
references/compile-format-fixup.md | Compiling contracts, formatting, fixup, compiler flags |
references/version-management.md | Installing, switching, listing, or removing compiler versions |
references/self-management.md | Updating the CLI tool, checking versions |
references/troubleshooting.md | Error messages, exit codes, common failures |
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub midnightntwrk/midnight-expert --plugin midnight-tooling6 skills in this plugin
/devnetmidnight-tooling:devnetThis skill should be used when the user asks about the Midnight local development network, including "start the devnet", "stop the devnet", "restart the network", "local development network", "midnight node", "midnight indexer", "network status", "network health", "devnet config", "network endpoints", "port 9944", "port 8088", "port 6300", "Docker Compose", "devnet not starting", "local blockchain", "devnet logs", "network ID", "generate devnet", "devnet versions", "update devnet", "devnet stale", "proof server", "devnet volumes", "clean slate", "docker containers", "devnet compose file", "devnet endpoints"/devnet-healthmidnight-tooling:devnet-healthThis skill should be used when the user asks to check the status or health of the local Midnight devnet, including "is the devnet running", "is the node up", "is the proof server responding", "indexer health", "devnet status", "devnet health", "are the containers running", "are the services healthy", "devnet probes", or when an agent (e.g. doctor, statusline) needs structured per-service status/health for the local devnet./proof-servermidnight-tooling:proof-serverThis skill should be used when the user asks about the Midnight proof server in any context — local, testnet, or mainnet. Includes "start the proof server", "restart the proof server", "stop the proof server", "proof server not working", "proof server logs", "check if proof server is running", "proof server port 6300", "proof server version", "proof server image tag", "proof server health check", "proof server API endpoints", "Docker container for proofs", "set up Docker for the proof server", or "proof server endpoint". Covers proof server concepts, version selection, API endpoints, standalone Docker usage, and troubleshooting. For local development setup, see the devnet skill./release-notesmidnight-tooling:release-notesThis skill should be used when the user asks about "Midnight release notes", "what changed in version X", "latest release", "changelog", "show me the changelog", "what's new in Midnight", "component versions", "list versions", "compact release notes", "ledger release notes", "wallet release notes", "proof server release notes", "node release notes", "lace release notes", "midnight-js release notes", "indexer release notes", "breaking changes", "latest version of X", viewing release history, checking component update details, or comparing versions of any Midnight Network component./troubleshootingmidnight-tooling:troubleshootingThis skill should be used when the user encounters errors, installation failures, version mismatches, or unexpected behavior with Midnight Network tools. Covers Node.js import errors, Compact CLI issues, proof server and Docker problems, devnet startup failures, environment and URL misconfiguration, NixOS and Windows/WSL setup, and searching Midnight GitHub issues for known bugs. For wallet initialization or funding failures, use the midnight-wallet plugin.Other plugins' skills for the same job