# trimtest > trimtest is a Rust CLI that runs only the tests a code change can reach. It builds a dependency graph per language (and, optionally, per-test coverage recordings), selects the affected tests, and runs them with each project's native runner. Notes for agents: - Selection is conservative: when trimtest cannot trace a change it runs the whole suite instead of guessing. - Exit codes: 0 passed or nothing selected, 1 a test failed, 2 trimtest itself failed, 3 selection is uncertain (run the full suite). - In pull requests use `trimtest run --base origin/`; it needs no recorded map. Keep a scheduled full run as a safety net. - A green subset is not a green suite: run `trimtest run --full` (or rely on the scheduled full run) before calling work finished. - Every page is also available as plain markdown by appending `.md` to its URL. - The trimtest.toml JSON Schema is at https://trimtest.dev/schema/trimtest.schema.json. ## Start - [Quick start](https://trimtest.dev/start/quick-start.md): Install trimtest, record a baseline, edit a file, and run only the tests that change reaches. - [Install](https://trimtest.dev/start/install.md): Install a prebuilt trimtest binary, cargo install it, or build it from source, and see which tools each language needs. ## For AI agents - [For AI agents](https://trimtest.dev/agents/for-ai-agents.md): How an AI coding agent should use trimtest safely, with an AGENTS.md snippet, a Claude Code skill, exit-code handling and the machine-readable surfaces. ## Concepts - [How it works](https://trimtest.dev/concepts/how-it-works.md): How trimtest fingerprints files, builds a reverse dependency graph and selects the tests a change reaches. - [Static vs recorded tier](https://trimtest.dev/concepts/tiers.md): The static import graph, the recorded coverage tier, which languages have which, and what falling back to the static graph means. - [Safety rules and when everything runs](https://trimtest.dev/concepts/safety-rules.md): The cases where trimtest runs the whole suite for a project instead of guessing which tests a change affects. - [Function-level selection](https://trimtest.dev/concepts/function-level.md): How Python and Jest/Vitest recordings select tests by the functions they executed, not just by file. ## Languages - [Python (pytest)](https://trimtest.dev/languages/python.md): How trimtest selects pytest tests, records coverage with coverage.py, and what it needs. - [JavaScript and TypeScript](https://trimtest.dev/languages/javascript.md): How trimtest handles Jest, Vitest and Playwright, tsconfig paths, workspaces and package exports. - [Rust](https://trimtest.dev/languages/rust.md): How trimtest selects cargo tests, records per-test coverage with cargo llvm-cov, and what stays attached. - [Java and Kotlin](https://trimtest.dev/languages/jvm.md): How trimtest runs Gradle and Maven tests, records coverage with JaCoCo, and which files stay attached. - [SQL and PostgreSQL](https://trimtest.dev/languages/sql.md): How trimtest selects pgTAP and plain psql test scripts for SQL and PostgreSQL projects. - [Go, Swift, Dart and Zig](https://trimtest.dev/languages/others.md): How trimtest selects tests for Go, SwiftPM, Dart/Flutter and Zig projects. ## Guides - [GitHub Actions](https://trimtest.dev/guides/github-actions.md): A copy-paste GitHub Actions workflow that runs only affected tests on pull requests and everything on main and nightly. - [Sharding](https://trimtest.dev/guides/sharding.md): Split the affected tests across CI jobs with --shard, or fan out per-command with the GitHub matrix output. - [Monorepos](https://trimtest.dev/guides/monorepos.md): How trimtest finds projects in a monorepo, how nested projects and workspace members work, and how to override detection. - [Timeouts](https://trimtest.dev/guides/timeouts.md): Kill a hung test runner and everything it started with --timeout and --total-timeout. - [Windows](https://trimtest.dev/guides/windows.md): Installing and running trimtest natively on Windows 10 and 11 (x64 and arm64), what it handles, and what to know about shims, line endings and long paths. - [Troubleshooting](https://trimtest.dev/guides/troubleshooting.md): Common trimtest problems and fixes, from everything running to ignored recordings and stale Gradle builds. ## Reference - [CLI reference](https://trimtest.dev/reference/cli.md): Every trimtest command and flag, generated from the binary's own --help output. - [trimtest.toml](https://trimtest.dev/reference/config.md): Every trimtest.toml key, with its type, default and effect, plus the JSON Schema for editors and agents. - [Exit codes](https://trimtest.dev/reference/exit-codes.md): What each trimtest exit code means and what a script or agent should do with it. - [JSON and machine-readable output](https://trimtest.dev/reference/json-output.md): The shape of trimtest select --json, --paths and --format github, for scripts and AI agents. - [Supported and unsupported](https://trimtest.dev/reference/support-matrix.md): Which languages and runners trimtest supports on which tier, and what is not supported. ## Trust - [Soundness and the bench](https://trimtest.dev/trust/soundness.md): How trimtest measures whether selection ever misses a failure, and the zero-miss results on real open-source projects. - [Limits](https://trimtest.dev/trust/limits.md): What trimtest cannot see, where it deliberately over-selects, and why a scheduled full run still matters. - [Changelog](https://trimtest.dev/trust/changelog.md): What changed in each trimtest release. ## Blog - [Blog](https://trimtest.dev/blog.md): News and release announcements from trimtest. - [trimtest 0.1: run only the tests a change can reach](https://trimtest.dev/blog/first-release.md): The first release of trimtest, a Rust CLI that selects the tests a code change can reach, across Python, JS/TS, Rust, Go, Dart, Java/Kotlin, Swift and more. What it does, how to install it, how far to trust it, and what is still early. ## Project - [Support and sponsors](https://trimtest.dev/project/support.md): trimtest is free and Apache-2.0. How to support it, become a sponsor, and who sponsors it. ## Optional - [Complete documentation](https://trimtest.dev/llms-full.txt): every page concatenated - [trimtest.toml JSON Schema](https://trimtest.dev/schema/trimtest.schema.json): for editors and agents - [Claude Code skill](https://trimtest.dev/skill/SKILL.md): the rules for agents as a skill file