In 2026, Clojure developers leverage Atlas to quickly debug a single failing test by integrating directly with their existing toolchain. Atlas uses `bash` to run `kaocha` tests, `lsp` to navigate Clojure namespaces, and `edit` to fix production code, ensuring a streamlined debugging experience from the terminal.
How to run a single Clojure test with Atlas and Kaocha
In 2026, isolating a single failing Clojure test is crucial for efficient debugging. Atlas achieves this by executing `kaocha` directly through its `bash` tool, allowing developers to apply specific filters and focus on the problem at hand. This approach ensures minimal output and faster iteration cycles.
When a Clojure test fails, the first step is to run only that specific test to reduce noise and execution time. Atlas's `bash` tool provides a real shell environment, enabling it to execute any command a developer would manually type. For `kaocha`, the standard test runner in Clojure projects managed by `deps.edn`, this means using the `--filter` flag. For example, to run a test named `my-failing-test` within the `my-app.core-test` namespace, Atlas would execute a command similar to `clojure -M:test --reporter documentation --filter "my-app.core-test/my-failing-test"`. This command is permission-gated, requiring user approval before Atlas runs it. The output from `kaocha` is then captured and analyzed by Atlas, providing immediate feedback on the test's status. This direct integration with the Clojure CLI and `kaocha` ensures that Atlas operates within the familiar and expected environment of a Clojure developer.
Fixing Clojure code and applying changes with Atlas
In 2026, fixing identified issues in Clojure code with Atlas is a precise and controlled process. Atlas uses its `edit` tool for small, focused changes or `apply_patch` for more extensive modifications, ensuring that all changes are reviewed. This includes applying `cljfmt` to maintain consistent code style across the `deps.edn` project.
After forming a hypothesis about the test failure, Atlas proceeds to fix the production code. For minor adjustments, such as adding a temporary `println` for logging or correcting a single line, Atlas uses its `edit` tool. This tool allows for targeted modifications to specific files, like `src/my_app/core.clj`. If the fix involves changes spanning multiple hunks or files, Atlas can generate a unified diff and apply it using `apply_patch`, which is more robust than chaining multiple `edit` commands. Before any changes are written to disk, Atlas computes a unified diff and surfaces it for approval, giving the developer full control. Furthermore, Atlas can apply `cljfmt` to ensure that all code changes adhere to the project's formatting conventions, maintaining code quality and reducing merge conflicts. This step is often performed automatically by Atlas after a fix, behind a permission prompt, ensuring the diff presented for approval is already formatted correctly. Atlas also snapshots file changes as git patches, allowing edits to be easily diffed and rolled back if necessary.
Reviewing and committing Clojure code changes with Atlas
Ensuring code quality and maintainability in 2026 Clojure projects involves a rigorous review process for every change. Atlas facilitates this by presenting unified diffs for approval, integrating with `git` to stage and commit changes, and running the full `kaocha` test suite. This comprehensive approach guarantees that fixes are correct and do not introduce regressions.
Atlas's workflow prioritizes developer oversight and safety. Every proposed code modification, whether a single line `edit` or a multi-hunk `apply_patch`, is presented as a unified diff for explicit approval before it is written to the filesystem. This permission-gated approach extends to running commands like `clojure -M:test` with `kaocha` and applying `cljfmt`. After a fix is applied and the single failing test passes, Atlas will re-run the full `kaocha` test suite to confirm no regressions have been introduced. This is typically done by executing `clojure -M:test` via the `bash` tool. Once all tests pass and temporary logging is removed, Atlas can read `git` branches, status, and diffs, and can stage and create commits on your behalf, streamlining the version control process. The developer retains ultimate control, approving each step and reviewing the final diff before committing. Atlas's ability to build its code index with local Ollama embeddings ensures that sensitive Clojure code remains off third-party servers during this process.
Step by step
- 01Run the failing Clojure test in isolation: Use Atlas's `bash` tool to execute `clojure -M:test --reporter documentation --filter "my-app.core-test/my-failing-test"` with `kaocha`, focusing output on the specific test.
- 02Read test and module code: Atlas uses its `read` tool to examine `test/my_app/core_test.clj` and `src/my_app/core.clj`, understanding the test's assertion and the production code it exercises.
- 03Walk the Clojure call graph: Employ Atlas's `lsp` tool with `goToDefinition` and `findReferences` to trace function calls across Clojure namespaces, identifying the relevant code path.
- 04Form a hypothesis and check it: Add temporary `println` logging to `src/my_app/core.clj` using Atlas's `edit` tool, or re-run the `kaocha` test with verbose flags via `bash` to gather more information.
- 05Fix the production Clojure code: Apply the necessary code changes to `src/my_app/core.clj` using Atlas's `edit` tool for small fixes, or `apply_patch` for more extensive modifications, reviewing the unified diff.
- 06Re-run tests and clean up: Execute the single `kaocha` test again via `bash`, then the full `clojure -M:test` suite. Remove any temporary logging with `edit` and let Atlas apply `cljfmt` to the modified files.
- 07Approve and commit changes: Review the final diff presented by Atlas, approve the changes, and allow Atlas to stage and create a `git` commit on your behalf.
Frequently asked questions
- How does Atlas run `kaocha` tests in a `deps.edn` project?
- Atlas uses its `bash` tool to execute `clojure -M:test` commands, which in turn invokes `kaocha`. It can apply specific `--filter` flags to run individual tests or the full suite, just as a developer would manually.
- Can Atlas navigate complex Clojure namespaces and function definitions?
- Yes, Atlas leverages its `lsp` tool, which understands Clojure's AST declarations via tree-sitter. This enables precise `goToDefinition` and `findReferences` operations across namespaces, even with `->>` pipelines.
- How does Atlas ensure code style consistency in Clojure after making fixes?
- Atlas integrates with `cljfmt`. After making code changes with `edit` or `apply_patch`, Atlas can automatically apply `cljfmt` to the modified files, ensuring the diff presented for approval adheres to your project's formatting conventions.
- What safety measures does Atlas have when modifying Clojure code?
- Atlas is permission-gated. Every tool call, file edit, or command execution (like `clojure -M:test`) requires explicit user approval. It presents unified diffs for all code changes before writing them and can snapshot changes as git patches for rollback.
- Does Atlas support Clojure projects using `deps.edn` for dependency management?
- Absolutely. Atlas is designed to work direct with Clojure projects driven by `deps.edn`. It reads your `:aliases`, namespace requires, and understands the project structure, making it a native fit for the Clojure CLI ecosystem.
- Can Atlas help me add temporary logging to debug a Clojure test?
- Yes, Atlas can use its `edit` tool to insert temporary `println` statements or other logging constructs into your Clojure source files, such as `src/my_app/core.clj`. You can then re-run the test via `bash` to observe the output.
- How does Atlas handle large code changes in Clojure files?
- For extensive modifications that span several hunks or files, Atlas can use its `apply_patch` tool. This is more robust than chaining multiple `edit` commands and ensures that complex changes are applied accurately after user review of the unified diff.
Try Atlas in your terminal
The terminal-native AI coding agent. Free core, single binary.
Install AtlasRelated guides
Debug a Single Failing Test with Atlas in 2026
How to debug one failing test with Atlas in 2026: run it in isolation with bash, walk the call graph with the lsp tool, and fix the code, not the assertion.
Atlas for Clojure: A Terminal-Native AI Coding Agent for deps.edn and Kaocha in 2026
Atlas is a terminal-native AI coding agent for Clojure in 2026. It reads deps.edn aliases and namespace requires, runs clojure -M:test with Kaocha, and applies cljfmt.
Migrate a Deprecated API Across Every Callsite in Clojure with Atlas in 2026
Effortlessly migrate deprecated APIs across your Clojure codebase using Atlas. Leverage `deps.edn`, `kaocha`, and `cljfmt` for a complete, verified transition.
Plan a Multi-File Change Before Editing in Clojure with Atlas in 2026
Design complex, multi-file Clojure changes with Atlas's Plan agent in 2026. Get review-ready plans for your deps.edn projects before touching a single line of code.
Onboard to an Unfamiliar Clojure Codebase with Atlas in 2026
In 2026, Clojure developers use Atlas to quickly build a mental model of new repositories. Leverage `deps.edn`, `kaocha`, and `cljfmt` with AI-powered code exploration.
Add a Regression Test for a Clojure Bug Fix with Atlas in 2026
In 2026, Clojure developers use Atlas to lock in bug fixes with regression tests. Learn how Atlas integrates with deps.edn, kaocha, and cljfmt for robust testing workflows.
Upgrade a Clojure Dependency and Fix Breakage with Atlas in 2026
In 2026, Clojure developers use Atlas to efficiently upgrade dependencies in `deps.edn` projects, fixing compile and test failures with `kaocha` and `cljfmt`.
Run Atlas Headless in CI for Clojure Projects in 2026
Automate Atlas in your Clojure CI/CD pipeline. Learn to run Atlas headless with `deps.edn`, `kaocha`, and `cljfmt` for machine-readable output and safe code changes in 2026.