This file is the canonical agent guide. CLAUDE.md is a symlink to AGENTS.md for compatibility with existing tooling.
Task-specific procedures live as skills in .agents/skills/ (.claude/skills is a symlink to it). Load the named skill when this guide points to one; agents without skill support can read its SKILL.md directly.
Do not use AI to reply to a mise Discussion or Issue unless the user (a) created that Discussion or Issue, (b) opened a PR that fixes it, or (c) has already had a contribution merged into the default branch of mise. Otherwise they are not allowed to use AI to respond to it. Drive-by AI replies are spam, the problem is getting worse, and doing it is an instant ban across all of jdx's projects (mise, hk, pitchfork, usage, fnox, and the rest).
- If the user asks you to answer, comment on, or "help with" a Discussion or Issue, confirm one of the three conditions first. If you cannot confirm one, do not post.
- (a) Compare the thread author to the authenticated user (
gh api user --jq .login). For an Issue, usegh api repos/jdx/mise/issues/<number> --jq .user.login. Discussions have no REST endpoint, so use GraphQL:gh api graphql -f query='query{repository(owner:"jdx",name:"mise"){discussion(number:<number>){author{login}}}}' --jq .data.repository.discussion.author.login. - (b) Check that the user's PR actually fixes the problem described in the thread. A closing keyword such as
Fixes #<number>is good evidence, but a link is not required, and a PR that merely mentions an unrelated thread does not count. - (c) Look for any contribution merged into the default branch that is tied to the user's GitHub account, not just a matching name or email: a PR authored by the user that was merged into the default branch (
gh pr list --repo jdx/mise --author @me --state merged --base main --limit 1), commits on the default branch that GitHub attributes to their login (gh api 'repos/jdx/mise/commits?author=<login>&per_page=1'lists the default branch), never commits on a local or unmerged branch, or a PR from someone else, merged into the default branch, that credits them with aCo-authored-bytrailer whose email is their GitHub noreply address or one verified on their account. Do not acceptgit log --authoroutput, which includes local unmerged commits, or a trailer matched only by display name. Both queries filter by author on the server, so one matching result is enough to qualify and no pagination is needed.
- (a) Compare the thread author to the authenticated user (
- If none of the three apply, do not post a reply, even a short one. Tell them this project does not allow AI replies from people who have not contributed, and offer to explain the answer to them in chat instead.
- Never batch-post, loop over, or sweep Discussions or Issues to answer several of them, even for a merged contributor.
- Lightly edited, human-reviewed, or disclosed model output does not create an exception. The disclosure footer does not make an AI reply acceptable on its own.
- Permitted replies may be AI-assisted. The user must review and verify the reply before it is posted.
- Creating a new Discussion or Issue with AI assistance is fine and is not restricted. The user must review it before it is posted, and it needs the AI disclosure below.
When you post AI-contributed GitHub content, including a new Discussion or Issue, a reply, or a PR description or comment, append this disclosure: *AI-assisted — Tool: <tool>; model: <provider>/<model>; version: <version-or-unavailable>.* Use the exact model and version identifiers exposed by the runtime, never guessed values, and unavailable when one is not exposed.
Most new registry additions from agents get rejected. mise's registry/ is curated for tools that are already widely used — generally thousands of GitHub stars, not hundreds. jdx closes PRs that miss the bar without giving a reason.
Before adding a new tool or shorthand to registry/, follow the registry-submission skill (.agents/skills/registry-submission/SKILL.md). In short:
- Warn the user about the bar, look up real popularity numbers, and stop if the tool is personal, internal, a fork, or niche.
- Put a
## Popularitysection with those numbers in the PR description. - Confirm
mise ls-remote <backend>lists installable versions. - Prefer
packslip:, thenaqua:,github:, orgitlab:.conda:has a high bar;npm:,pipx:,gem:,cargo:,go:, anddotnet:are almost never accepted. Newasdf:,vfox:, andubi:entries are not accepted. - Users can install any tool without a registry entry (
mise use github:owner/repo,mise use cargo:name, …); the registry only adds a shorthand.
None of this applies to editing an existing registry entry; do not ask the user about popularity for maintenance or fixes.
mise run buildormise run b- Build the project with cargotarget/debug/mise- Run the built binary directlymise run testormise run t- Run all tests (unit + e2e)mise run test:unit- Run unit tests onlymise run test:e2e- Run end-to-end tests onlymise run snapshots- Update test snapshots withcargo insta
- Use
MISE_DEBUG=1orMISE_TRACE=1environment variables to enable debug output (notRUST_LOG)
mise run lint- Run all linting tasks (hk; does not run clippy — see below)mise run lint-fix- Run linting and automatically fix issuesmise run format- Format code (part of CI task)mise run ci- Run format, build, and testmise run test:e2e [test_filename]...- Run specific e2e tests (use this instead of executing test files directly)mise --cd crates/vfox run test- Run tests for the vfox cratemise --cd crates/vfox run lint- Run linting for the vfox cratemise --cd crates/vfox run lint-fix- Run linting and fix issues for the vfox cratemise task ls- List all available tasks
- Do not add
#[allow(clippy::...)],#[expect(clippy::...)], Cargo lint levels set toallow, or-A clippy::...command-line flags. - Refactor the code so
cargo clippy --workspace --all-features --all-targets -- -D warningspasses without exclusions. mise run lintdoes not cover this: the clippy step inhk.pklis disabled, andcargo checkdoes not enforce-D warnings. CI runs clippy separately, so run the command above yourself before pushing Rust changes.- If a feature or fix needs a preparatory refactor to satisfy Clippy cleanly, put that refactor in a prerequisite PR and stack the behavior change on top of it.
mise run render- Generate all documentation and completionsmise run render:usage- Generate CLI usage documentationmise run render:completions- Generate shell completionsmise run docs- Start documentation dev servermise run docs:build- Build documentation
mise run install-dev- Install development version locallymise run clean- Clean cargo build artifacts
Mise is a Rust CLI tool that manages development environments, tools, tasks, and environment variables. The codebase follows a modular architecture:
The mise package has two targets. The library (src/lib.rs) is everything except the command line; the binary (src/main.rs plus src/cli/) sits on top of it and glob-imports its root, so cli code still writes crate::config::…. An edit under src/cli/ recompiles only the binary. Core code must not refer to crate::cli: it reaches command behavior through the hooks in src/frontend.rs. When cli needs a core item, make that item pub; unreachable_pub keeps everything else pub(crate). cfg(test) does not reach the library from the binary's tests, so core code that behaves differently under tests checks mise_util::testing::in_tests() instead.
Core Components:
src/main.rs- Binary entry pointsrc/lib.rs- Library root: module list and the hooks lower crates needsrc/cli/- Command-line interface implementation with subcommands (binary only)src/config/- Configuration file parsing and managementsrc/backend/- Tool backend implementations (aqua, github, cargo, npm, asdf, vfox, …)src/toolset/- Tool version management and installation logicsrc/task/- Task execution systemsrc/plugins/- Plugin system for extending tool support
Key Backend Systems (src/backend/):
packslip.rs— Signed release manifests (preferred for new registry entries)aqua.rs— Aqua registrygithub.rs— GitHub / GitLab / Forgejo releaseshttp.rs,s3.rs— HTTP and S3 backendscargo.rs,npm.rs(plus embedded aube),pipx.rs,gem.rs,go.rs,dotnet.rs,conda.rs,spm.rsasdf.rs,vfox.rs— plugin compatibility layersubi.rs— deprecated; do not add new registry entries
Core Tools (Built-in):
src/plugins/core/— Node, Python, Go, Ruby, Java, Bun, Deno, Elixir, Erlang, Dotnet, Swift, Zig, Rust
Configuration System:
mise.tomlfiles for project configuration.tool-versionsfiles for ASDF compatibility- Environment variable management and templating
- Task definition and execution
- Backend Architecture: Tools are implemented through a unified backend interface, allowing multiple sources (ASDF plugins, vfox plugins, cargo, npm, etc.)
- Toolset Management: The
Toolsetmanages collections of tool versions and their installation state - Configuration Layering: Config files are loaded hierarchically from system → global → local with environment-specific overrides
- Task System: Tasks can be defined in TOML files with dependencies, environment variables, and multiple execution modes
mise.toml- Main configuration file formatsettings.toml- Global settings definitions (generates code/docs)registry/- Tool registry mappingstasks.toml- Project task definitions
- Unit tests within source files
- E2E tests in
e2e/directory organized by feature area (e.g.,e2e/cli/,e2e/backend/) - E2E tests are bash scripts using assertion helpers from
e2e/assert.sh(e.g.,assert,assert_contains,assert_fail) - E2E tests do not need cleanup steps (rm, etc.) — the test harness handles that
- Snapshot tests using
instacrate for CLI output verification - Windows-specific tests in
e2e-win/
- Rust project using a Cargo workspace; member crates live in
crates/(vfox,aqua-registry,mise-shim,mise-sigstore,mise-cache-core,mise-brew-relocation,mise-brew-metadata,mise-agent-env,mise-interactive-config,mise-settings,mise-util) - Custom build script in
build.rsfor generating metadata - Multiple build profiles including
releaseandserious(with LTO) - Cross-compilation support via
Cross.toml
PR titles MUST follow conventional commit format. Intermediate commit subjects SHOULD use the same format:
Format: <type>[optional scope][optional !]: <description>
Types:
feat:- New featuresfix:- Bug fixes that affect the CLI behavior (not CI, docs, or infrastructure)refactor:- Code refactoringdocs:- Documentation changesstyle:- Code style/formatting (no logic changes)perf:- Performance improvementstest:- Testing changeschore:- Maintenance tasks, releases, dependency updates, CI/infrastructure changessecurity:- Security-related changesregistry:- Any changes toregistry/(do not add a scope)ci:- CI and automation changesrevert:- Reverting a previous change
Scopes:
- For command-specific changes, use the command name:
install,activate,use,exec, etc. - For subsystem changes:
config,backend,env,task,vfox,python,github,release,completions,http,schema,doctor,shim,core,deps,ci - Use
task(notrun) for task-related changes, even if the code lives insrc/cli/run.rsorsrc/cmd.rs
Description Style:
- Start the description with a lowercase character, or with an acronym such as
PGOorCLI - Use imperative mood ("add feature" not "added feature")
- Keep it concise but descriptive
Examples:
fix(install): resolve version mismatch for previously installed toolsfeat(activate): add fish shell supportfeat(vfox): add semver Lua module for version sortingfeat(env): add environment caching with module cacheability supportdocs(contributing): update hk usageschore: release 2026.1.6chore(ci): add FORGEJO_TOKEN for API authenticationregistry: add miller
CI validates the pull request title and re-runs when it is edited. Intermediate commit subjects are not checked because pull requests are squash-merged. CI mechanically checks the allowed type, syntax, and lowercase- or acronym-leading description; imperative mood and breaking-change details remain review rules.
Communique generates release notes from PR titles and descriptions, so write them for a mise user who has not read the diff: lead with the user-visible problem and outcome, show a concrete example, and keep them in sync with the final diff. Follow the pr-description skill (.agents/skills/pr-description/SKILL.md) when opening or revising a PR.
- Run
mise run lint-fixandgit addany lint fixes before committing - Use
mise run test:e2e [test_filename]...for running specific e2e tests - Never run e2e tests by executing them directly — always use the mise task
hk.pkl defines check and fix steps and a git pre-commit hook that runs the same linters with auto-fix (stash = "git" preserves unstaged work). hk install --mise installs that hook. You can still run mise run lint / mise run lint-fix by hand; on Linux and macOS they run hk, but on Windows lint-fix runs only Clippy, Prettier, and cargo fmt, so the other hk steps do not run there.
- Prefer the hk MCP server for effect-aware plans, checks, fixes, logs, and captured diffs.
- When invoking hk directly, use
hk run check --safe --format jsonfor a complete machine-readable result or--format jsonlfor streaming lifecycle events. - Scope checks to changed files. For an exact file list, pass NUL-delimited paths with
--files0-from; use--cdto target another project directory. - Never run a command classified as unknown or destructive without explicit user approval. Review the resulting diff after fixes.
- Use the lowest-specificity dependency requirement that expresses compatibility in
Cargo.toml(for example, prefer"1"over"1.2.3", and"0.12"over"0.12.1"for a pre-1.0 crate). - Routine dependency updates should only change
Cargo.lock. If the existingCargo.tomlrequirement accepts the target version, do not change it merely to force or record the update; usecargo update -p <crate> --precise <version>instead. - Keep lockfile updates focused on the requested dependency and its required transitive changes. Remove unrelated resolver churn before committing.
When updating the embedded aube crates, follow the update-aube skill (.agents/skills/update-aube/SKILL.md).
When deprecating a feature, backend, or implicit behavior:
- Immediately: Mark it as deprecated in docs (add a warning banner) and display a CLI warning using the
deprecated_at!macro fromsrc/output.rs(warn_atis the current version). - 12 months after warn (
remove_at):debug_assert!indeprecated_at!fires, signaling the deprecated code or behavior should be removed.
12 months is the default window, not a hard rule. Some deprecations use a shorter window, such as 6 months, on purpose. Use 12 months for new deprecations unless jdx asks for something else, and do not lengthen an existing shorter window.
Delay the CLI warning for up to 6 months only when migration requires a new setting, syntax, or replacement that older supported mise versions would reject or fail to parse. This compatibility window lets users adopt a configuration that works across old and new clients before warnings begin. Do not delay warnings for a behavior change that requires no new configuration, or when the replacement already works in older clients.
Use mise version format for dates (e.g., deprecated_at!("2026.10.0", "2027.10.0", "id", "message")).
If a compatibility window is required, removal remains 12 months after warn_at, not 12 months after the initial documentation notice.
For temporary code with no user-facing deprecation, such as a migration or a fallback that reads what an older mise wrote, use remove_by!("2027.1.0", "id") from src/output.rs. It is a compile-time assertion, so the build fails once the version reaches remove_at; remove every remove_by! with that id and the code it guards.
When implementing new tool backends, follow the pattern in src/backend/mod.rs. Each backend must implement the Backend trait with methods for listing versions, installing tools, and managing tool metadata.
Do not assume tool versions follow semver or any other orderable scheme. mise manages hundreds of tools with wildly different versioning conventions:
- Date-based:
2024.01.15,20241015 - Pre-release / ref / tag versions:
tip,HEAD,nightly,edge,canary,ref:main,tag:v1,sub-X.Y:... - Non-numeric tags: Python
3.12.0a1, Ruby3.2.0-preview1, Go1.22rc1, Nodelts/hydrogen,lts-iron - Tool-specific meanings of
latest(e.g. some exclude pre-releases, some don't)
Rules:
- Do not call
versions::Versioning::new(...)(or any other semver comparator) at a new call site to pick the "newest" version, "resolve latest", or sort a version list. That crate silently returnsNone/ arbitrary ordering for non-semver strings, which means wrong versions get chosen for many tools. - To resolve a version request (
latest, a prefix, a channel name), delegate to the backend viaBackend::latest_version,Backend::latest_installed_version,Backend::list_versions_matching, orToolRequest::resolve— the backend knows what "latest" means for its tool. - To list installed versions in a meaningful order, use
Backend::list_installed_versions_matchingor the toolset's resolved versions. Do not reorder them yourself. - Lockfile version strings must be treated as opaque — compare with
==, never with a version ordering. Never write a non-concrete string (latest,lts/*, a prefix) into the lockfile; resolve first.
A few existing call sites (e.g. runtime symlinks) do use Versioning ordering today, but that's legacy behavior and arguably also wrong — do not point at them to justify new semver assumptions.
If you think you need to pick "the newest installed version" at a new call site, stop and ask — that call almost always belongs on the backend, not inline.
- Core tools are implemented in
src/plugins/core/ - External plugins use ASDF or vfox compatibility layers
- Plugin metadata is defined in
mise.plugin.tomlfiles
The configuration system supports multiple file formats and environment-specific configs. Changes to settings require updating settings.toml and running mise run render:schema. The Settings types are generated from settings.toml in crates/mise-settings; loading them (config discovery, trust, CLI flags) stays in src/config/settings.rs, whose SettingsExt trait holds the methods that need the rest of mise.
When changing configuration syntax or tool options, update schema/mise.json and run mise run render:schema. The render task also regenerates schema/mise-task.json from the main schema.
- E2E tests are organized by feature area (cli/, config/, backend/, etc.)
- Use snapshot testing for CLI output verification
- Backend-specific tests verify tool installation and version management
- Slow tests (marked with
_slowsuffix) test actual tool compilation/installation
- Windows modules follow one of two conventions:
*_windows.rsis a platform-swapped sibling of a same-named module, selected with#[cfg_attr(windows, path = "..._windows.rs")](e.g.src/fake_asdf.rs/src/fake_asdf_windows.rs)windows_*.rsis a single module about Windows with no non-Windows counterpart to swap in. Declare it on every platform and cfg-split it internally when other code calls it on all targets or its tests should run on Linux (e.g.src/windows_posix.rs,src/windows_console.rs); declare it under#[cfg(windows)]when only Windows code uses it (e.g.src/windows_job.rs)
- Platform-specific tool installation logic in core plugins
- Shim system varies by platform (especially Windows)
- we don't chmod mise e2e tests to be executable
- Do not invoke subprocesses to translate paths in activation hooks, shims, or
mise x/task execution. - Keep PATH in native Windows form inside mise and when launching child processes, including child MSYS2, Git Bash, or Cygwin processes. Never pre-convert the PATH inherited by a child emulator.
- Convert PATH only when native Windows mise emits an assignment into an already-running, positively identified MSYS2/Cygwin shell. Only persisted mounts from the runtime defaults,
fstab, andfstab.dare available; session-onlymountchanges cannot be reconstructed without entering the running process. - Never infer an emulator from the word
bashalone. Require MSYS/Cygwin runtime evidence, and explicitly exclude WSL and BusyBox Bash. - Windows activation tests must execute a command through the emitted PATH and verify a native Windows grandchild receives a valid semicolon-delimited PATH. Output-shape assertions alone are insufficient.
Never open pull requests against the release branch. Default PRs to main unless the user explicitly names a different non-release base branch. If a change appears to belong on release, stop and ask for the intended branch strategy instead of opening a PR against release.
See Discussions and Issues: Restricted AI Replies at the top of this file.
When AI contributes GitHub content—including a pull request description, review, pull request comment, discussion post, or issue—append this disclosure:
*AI-assisted — Tool: <tool>; model: <provider>/<model>; version: <version-or-unavailable>.*
Use the exact model and version identifiers exposed by the runtime. Never infer or guess them; use
unavailable when either value is not exposed.
When referencing mise documentation URLs, use the correct path structure based on the docs/ directory layout:
- Dev tools & backends:
mise.jdx.dev/dev-tools/backends/<backend>.html(e.g.,mise.jdx.dev/dev-tools/backends/s3.html) - Configuration:
mise.jdx.dev/configuration/... - Tasks:
mise.jdx.dev/tasks/... - Environments:
mise.jdx.dev/environments/... - CLI reference:
mise.jdx.dev/cli/...
Do NOT use shortened paths like mise.jdx.dev/backends/... - always include the full path matching the docs/ directory structure.
Cursor Cloud Agents bootstrap from .cursor/environment.json, which runs .cursor/install.sh. Claude Code on the web runs the same script from the SessionStart hook in .claude/settings.json (.claude/hooks/session-start.sh), which runs on session startup/resume/fork (not /clear or compaction) with a 30-minute timeout, exits immediately unless CLAUDE_CODE_REMOTE=true, sends the bootstrap output to stderr, and adds the mise shims and /usr/local/bin to PATH through CLAUDE_ENV_FILE. The hook runs synchronously, so the session starts after the build finishes. Claude cloud containers do not provide a GitHub token by default; add GITHUB_TOKEN as an environment secret to avoid GitHub API rate limits during mise install and e2e tests. Use a fine-grained token with public-repository read-only access and no other permissions: any branch a session checks out (its hook, build scripts, tests, and tasks) can read the session environment. Draft environment builds often run as ubuntu rather than root; the script handles both (passwordless sudo, cargo/rustup permissions, world-writable /tmp/fslock).
The install script:
- cds to the repository root derived from the script path before reading
Cargo.tomlor building - installs host packages needed to build mise and to run most e2e tests (openssl, pkg-config, zsh, fish, python3 + venv, jq, git, build-essential, and compile-time libs). It does not install a JDK or GUI libraries; those live in
packaging/e2e/Dockerfile.apt-getis invoked assudo -n env DEBIAN_FRONTEND=noninteractive apt-get …so the frontend reaches apt when elevation is required - installs and defaults to the latest stable Rust toolchain (not the
Cargo.tomlrust-versionMSRV), includingrustfmtandclippy, and updates it on reruns - gets a bootstrap
miseand symlinks it to/usr/local/bin/mise: an existingtarget/debug/miserefreshes itself withmise run build; if it cannot run this checkout's config, a plaincargo buildgoes totarget/bootstrap(thembxwrapper leaves read-only outputs intarget/); with notarget/yet, a plaincargo buildgoes totarget/ - keeps
GITHUB_TOKEN,MISE_GITHUB_TOKEN, andGH_TOKENin sync via onesync_github_tokenshelper (prefer any already-set token; fall back togh auth tokenonly when all three are empty) - runs
MISE_SAFE=1 /usr/local/bin/mise installwith the just-built binary so checkout-controlled hooks/templates/[env]and tool-levelpostinstall/install_envcannot run with those tokens, thenmise trustfor later agent commands - runs
mise run buildsotarget/is warm for thembx-wrapped cargo ([wrappers.cargo]inmise.toml) that agents build with, then points/usr/local/bin/miseattarget/debug/mise. Every build runs withGITHUB_TOKEN,MISE_GITHUB_TOKEN,GH_TOKEN, andGITHUB_API_TOKENunset - runs
hk install --mise(installs the gitpre-commithook defined inhk.pkl) - persists mise shims and token sync in one
/etc/profile.d/mise-dev-env.sh(shims first, thensync_github_tokens) and rewrites the Cloud Agent block in/etc/bash.bashrcso non-login interactive bash picks it up after a snapshot. Fish/zsh only get this from login shells (profile.d), not from bashrc - exposes the mise-installed
node/npm/npx/hk/ghbinaries on/usr/local/bin(isolated e2e PATH includes that directory, not the agent's shims). Links freeze the version from install time — re-run.cursor/install.shafter upgrading those tools
There is no long-running service to start. Do not put mise run build or mise run test:unit in terminals; those are one-shot commands and would rerun a full build/test on every boot.
The debug mise binary is already on PATH. Prefer mise run … for project tasks.
- Always
mise run test:e2e [test_filename]...— never execute e2e scripts directly - Slow tests (
*_slow) are skipped unlessTEST_ALL=1. Do not run the full suite unless asked; pick tests under the feature area you changed - Isolated e2e uses
env -iand a fakeHOME, so the agent's mise shims are not on PATH. Tests install their own tools. Host packages (zsh, fish, python3, jq, git) still need to be on/usr/bin - If GitHub API calls 429, run
export GITHUB_TOKEN="$(gh auth token)"; export MISE_GITHUB_TOKEN="$GITHUB_TOKEN" - A leftover
/tmp/mise.tomlwill fail the harness; remove it if that error appears