# Run the Test Suite and Triage Failures in Clojure with Atlas in 2026

> Atlas helps Clojure developers efficiently triage `kaocha` test failures by grouping distinct root causes from extensive logs in `deps.edn` projects.

Atlas empowers Clojure developers in 2026 to transform a daunting wall of red `kaocha` test output into a prioritized list of distinct root causes, streamlining the debugging process within `deps.edn` projects. By integrating directly with the Clojure toolchain, Atlas provides concrete commands and intelligent analysis to accelerate triage.

## Key takeaways

- Atlas runs `kaocha` tests via `clojure -M:test` and captures full logs for comprehensive analysis.
- `atlas grep` helps identify distinct root causes from extensive Clojure test output, not just individual test names.
- `atlas todowrite` tracks and prioritizes Clojure test failure fixes, ensuring systematic resolution.
- Atlas `edit` and diff review ensure safe, iterative Clojure code changes, with `cljfmt` integration.
- Atlas integrates deeply with `deps.edn` and Clojure's testing workflow, understanding namespaces and aliases.
- Every Atlas action, from running `kaocha` to editing `src/my_app/core.clj`, is permission-gated for developer control.

## How Atlas runs Clojure test suites with kaocha and deps.edn

In 2026, Atlas executes Clojure test suites using its `bash` tool, specifically invoking `clojure -M:test` with `kaocha` as the test runner. This ensures the full test output is captured, even for suites producing thousands of lines, by writing the complete log to a retained file.

Atlas integrates direct with the Clojure ecosystem, leveraging `deps.edn` for project configuration and `kaocha` for test execution. When you instruct Atlas to run your tests, it uses the `bash` tool to execute the command `clojure -M:test`. This command, defined in your `deps.edn` file's `:aliases` section, typically points to `kaocha` as the test runner. For instance, a common alias might look like `:test {:extra-paths ["test"] :extra-deps {lambdaisland/kaocha {:mvn/version "1.87.1359"}} :main-opts ["-m" "kaocha.runner"]}`. Atlas's `bash` tool is designed to handle extensive output; while it truncates terminal display at 2000 lines or 50 KB, it always writes the complete `kaocha` log to a retained file, providing you with the exact path. This ensures that no critical failure detail is lost, allowing for comprehensive analysis against the entire test run, rather than a partial view.

## How to group Clojure test failures by root cause with Atlas

Atlas helps Clojure developers in 2026 group test failures by distinct root causes, moving beyond individual test names, by applying its `grep` tool to the complete `kaocha` log file. This approach identifies underlying issues across multiple failing tests, providing a more efficient path to resolution.

After a `kaocha` test run, especially one with many failures, the raw output can be overwhelming. Instead of sifting through individual test names, Atlas guides you to identify distinct root causes. Once the `clojure -M:test` command completes, Atlas will inform you if the output was truncated and provide the path to the full log file. You then use the `atlas grep` tool on this complete log. For example, you might `atlas grep "java.lang.NullPointerException" /path/to/full/kaocha.log` to find all occurrences of a specific exception. This method allows you to group related failures, such as those stemming from a particular database connection issue or a common data parsing error, rather than addressing each failing `deftest` case in isolation. This strategy is crucial for efficiently triaging a wall of red output into actionable, distinct problems.

## Prioritizing Clojure test fixes with Atlas todowrite

After identifying distinct root causes from `kaocha` output, Atlas uses its `todowrite` tool to create a prioritized list of fixes in 2026. Each entry tracks a specific issue, ensuring no failure is overlooked or forgotten, and provides a clear roadmap for resolution.

Once you've used `atlas grep` to distill the `kaocha` test failures into a set of distinct root causes, the next step is to organize these into a manageable workflow. Atlas's `todowrite` tool is designed precisely for this. For each unique root cause you identify - for instance, 'Fix `nil` handling in `my-app.core/process-data`' or 'Address database connection timeout in `my-app.db/connect`' - you create a new `todowrite` entry. You can set its status to `pending` and add relevant details. This transforms an amorphous list of failures into a structured, prioritized task list. This ensures that every identified problem is tracked, preventing issues from being forgotten and providing a clear, actionable plan for systematically addressing the test suite's shortcomings in your Clojure project.

## Iterative fixing and review of Clojure code with Atlas

Atlas facilitates an iterative fix-and-retest cycle for Clojure code in 2026, allowing developers to address one root cause at a time using the `edit` tool. Before any changes are written, Atlas presents a unified diff for approval, ensuring precise control over modifications.

With a prioritized list of distinct root causes from `todowrite`, you can begin fixing them one by one. Atlas's `edit` tool allows you to modify your Clojure source files, such as `src/my_app/core.clj` or `test/my_app/core_test.clj`. After making a change, you can re-run only the affected `kaocha` tests via `atlas bash clojure -M:test --focus my-app.core-test/my-failing-test` (or a similar `kaocha` command to target specific tests), rather than the entire suite. This rapid feedback loop is crucial for efficient debugging. Before Atlas writes any changes to your filesystem, it computes a unified diff, which it surfaces for your explicit approval. This gives you complete control over what gets committed. Furthermore, Atlas can apply `cljfmt` to your modified files, ensuring that your code adheres to your project's formatting conventions, such as consistent indentation, before the diff is presented for approval. Atlas also reads `git` branches and status, and can stage and create commits on your behalf, streamlining the entire development process.

## Atlas safety and transparency for Clojure development

Atlas prioritizes safety and transparency for Clojure developers in 2026, ensuring every tool call and file edit is permission-gated against allow, ask, and deny rules. This includes explicit approval for running `clojure -M:test` and reviewing diffs before writing changes.

Working with an AI agent requires trust and transparency, and Atlas is built with this in mind for Clojure development. Every Atlas tool call, whether it's `bash` to run `clojure -M:test`, `grep` to analyze logs, or `edit` to modify `src/my_app/utils.clj`, is permission-gated. This means Atlas will ask for your explicit approval before executing potentially impactful commands. Atlas also drafts its plan in a read-only plan agent, allowing you to review its strategy before it switches to a build agent to make changes. For every file edit, Atlas computes and surfaces a unified diff, which you must approve before any changes are written to your project. Atlas also snapshots file changes as `git` patches, so edits can be diffed and rolled back if necessary. This robust system ensures that you, the Clojure developer, maintain full control and visibility over Atlas's actions throughout the test triage and fixing workflow.

## Steps

1. Run your Clojure test suite with `atlas bash clojure -M:test --timeout 600000` (adjust timeout as needed for `kaocha`).
2. If the output was truncated, use `atlas read /path/to/full/kaocha.log` to view the complete test log.
3. Group failures by distinct root cause using `atlas grep "<error-pattern>" /path/to/full/kaocha.log` (e.g., `java.lang.IllegalArgumentException`).
4. For each distinct root cause, create a tracking entry: `atlas todowrite "Fix <description-of-root-cause>" --status pending`.
5. Use `atlas edit src/my_app/problem_area.clj` to address one root cause, focusing on specific Clojure namespaces or `test/` files.
6. Re-run only the affected `kaocha` tests via `atlas bash clojure -M:test --focus my-app.problem-area-test/failing-test` to verify the fix.
7. Review the `atlas diff` for your changes and approve them; Atlas can apply `cljfmt` to maintain formatting conventions.
8. Repeat the edit, re-run, and review cycle until all `todowrite` entries are resolved and your Clojure tests pass.

## FAQ

### How does Atlas handle large `kaocha` test outputs in Clojure?

Atlas's `bash` tool truncates terminal output at 2000 lines or 50 KB but always saves the complete `kaocha` log to a retained file. You can then use `atlas read /path/to/full/kaocha.log` to access the entire context for your Clojure project.

### Can Atlas help me fix specific Clojure test failures?

Yes, Atlas uses its `edit` tool to modify Clojure source files, such as those in `src/` or `test/`. After making a change, you can re-run only the affected `kaocha` tests via `atlas bash clojure -M:test --focus <test-namespace>` to quickly verify your fix.

### How does Atlas ensure my Clojure code changes are safe?

Atlas prioritizes safety by drafting plans in a read-only agent, asking for explicit permission before running tools like `clojure -M:test`, and presenting a unified diff for every file edit for your approval before writing to your Clojure project.

### Does Atlas understand Clojure's `deps.edn` and namespaces?

Absolutely. Atlas is designed to work with Clojure projects driven by `deps.edn`, understanding namespace requires, `:aliases`, and REPL-shaped code as core units of work, making it highly effective for Clojure development.

### How does Atlas help prioritize fixes for multiple Clojure test failures?

After identifying distinct root causes with `atlas grep` on the `kaocha` log, Atlas's `todowrite` tool helps you create and track a prioritized list of fixes, ensuring a systematic approach to resolving your Clojure test suite's issues.

### Can Atlas apply `cljfmt` to my Clojure code changes?

Yes, Atlas can apply `cljfmt` to your modified Clojure files. This ensures that your code adheres to your project's formatting conventions, such as consistent indentation, before the unified diff is presented for your approval.

### What if my Clojure test suite is slow?

When running `clojure -M:test` via `atlas bash`, you can pass a generous timeout in milliseconds, for example, `--timeout 600000` for 10 minutes. This prevents Atlas from prematurely killing a slow `kaocha` test run, ensuring full completion.

### How does Atlas integrate with Git for Clojure projects?

Atlas reads `git` branches, status, and diffs, and can stage and create commits on your behalf. It also snapshots file changes as `git` patches, allowing you to diff and roll back edits in your Clojure codebase if needed.

---

Canonical HTML: https://runatlas.sh/resources/stacks/run-the-test-suite-and-triage-failures-in-clojure
Source of truth: aeo_pages row `/resources/stacks/run-the-test-suite-and-triage-failures-in-clojure` (segment: Stacks) (this file is generated from it, never hand-edited).
Licence: Atlas is proprietary with a free core. It is not open source and there is no public source repository.
