The Trunk plugin for Claude Code bundles the MCP server connection, slash commands, and skills into a single install. This is the recommended way to connect Trunk to Claude Code.Documentation Index
Fetch the complete documentation index at: https://trunk-4cab4936-sam-gutentag-flaky-tests-new-monitors.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Install the Plugin
First, add the community plugins marketplace if you haven’t already:Alternative: install directly from GitHub
Alternative: install directly from GitHub
You can also install from the plugin repository URL:This is useful if you want to pin to a specific version or test changes before publishing a new release.
Authentication
After installing, Claude Code will prompt you to authenticate with Trunk on first use.- Run any Trunk command (e.g.,
/trunk:fix-flaky) or trigger an MCP tool call - Claude Code will open a browser window for OAuth login
- Log in with your Trunk account and authorize the connection
- You’ll see
Authentication successful. Connected to trunk.back in the terminal
Slash Commands
| Command | What it does |
|---|---|
/trunk:fix-flaky <test_name> | Retrieves root cause analysis for a flaky test and offers to apply the fix |
/trunk:why-flaky <test_name> | Explains why a test is flaky without making changes — good for triage |
/trunk:setup-uploads | Detects your test framework and CI provider, then generates the upload configuration |
Fix a flaky test
Understand why a test is flaky
fix-flaky, but read-only. Useful when you want to understand the problem before deciding how to handle it — especially for tests you didn’t write.
Set up test uploads
Skills
The plugin includes two skills that activate automatically based on context: Flaky test patterns — activates when you’re debugging or writing tests. Provides common flaky test patterns and proven fixes so Claude Code can reference them without you asking. Trunk CI setup — activates when you’re editing CI configuration files (.github/workflows/, .circleci/config.yml, etc.). Provides best practices for test upload configuration.
Also Available For
- Cursor (one-click install)
- GitHub Copilot (one-click install)
- Gemini CLI
- Any MCP client — manual configuration