# Upgrade a Clojure Dependency and Fix Breakage with Atlas in 2026

> Atlas empowers Clojure developers to confidently upgrade `deps.edn` dependencies, automatically resolving breaking changes identified by the compiler and `kaocha` tests.

In 2026, Clojure developers leverage Atlas to streamline the complex process of upgrading a library to a new major version and repairing all resulting compile and test failures, integrating directly with `deps.edn (Clojure CLI)` for dependency management, `kaocha` for comprehensive testing, and `cljfmt` for maintaining code style consistency.

## Key takeaways

- Atlas directly edits `deps.edn` for precise Clojure dependency version updates.
- Atlas uses `webfetch` to provide context from Clojure library release notes.
- Clojure compiler output drives Atlas's iterative fixes for breaking changes.
- Atlas integrates with `kaocha` to ensure all Clojure tests pass after an upgrade.
- Code quality is maintained with `cljfmt` and Atlas's diff review process.
- Atlas provides granular control and transparency over every Clojure code modification.

## How Atlas Manages Clojure Dependency Upgrades in deps.edn

In 2026, upgrading a Clojure dependency to a new major version in a `deps.edn` project begins with Atlas directly modifying the `deps.edn` file. Atlas then uses `bash` to run `clojure -Spath` to resolve the new dependency, capturing any initial resolution errors or warnings.

Atlas initiates the dependency upgrade by directly editing your project's `deps.edn` file. For instance, if you need to bump `org.example/library` from version `1.0.0` to `2.0.0`, Atlas will locate the entry in `deps.edn` and update the `:mvn/version` key. This direct file manipulation ensures that the change is precisely what you intend. Following this modification, Atlas uses its `bash` tool to execute `clojure -Spath`. This command forces the Clojure CLI to resolve the project's dependencies with the newly specified version, effectively 'running the package manager upgrade'. Atlas captures the complete output of this command, which can be crucial for identifying early-stage dependency conflicts or issues that might arise from the version bump. If the output is extensive, Atlas saves it to a file, allowing you to review it thoroughly using the `read` tool. This methodical approach ensures that the dependency graph is correctly updated before any code modifications begin.

## Accessing Clojure Library Release Notes with Atlas webfetch

Before fixing any code, Atlas in 2026 uses its `webfetch` tool to retrieve the release notes or changelog for the newly upgraded Clojure library. This crucial step provides context on breaking changes, ensuring that subsequent code fixes are accurate and align with the library's migration guide.

Understanding the breaking changes introduced in a new major version is paramount for a successful upgrade. Atlas addresses this by employing its `webfetch` tool to pull the official release notes or changelog directly from the library's repository or documentation site. For example, if `org.example/library` released version `2.0.0`, Atlas would `webfetch` a URL like `https://github.com/org/library/releases/tag/v2.0.0`. This provides Atlas with the authoritative list of API changes, deprecated functions, or new paradigms. By having this context readily available, Atlas can make informed decisions when suggesting code modifications, ensuring that the fixes it proposes are not merely guesses but are aligned with the actual migration path outlined by the library maintainers. This prevents unnecessary trial-and-error and significantly speeds up the repair process for your Clojure codebase.

## Repairing Clojure Compile Errors with Atlas edit and lsp

After a major dependency upgrade in 2026, Clojure projects often encounter compile-time errors. Atlas systematically addresses these by running `clojure` commands via `bash` to enumerate failures, then uses its `edit` tool, augmented by `lsp`'s `goToDefinition`, to inspect and correct each problematic callsite.

Once the dependency is updated in `deps.edn` and release notes are reviewed, Atlas proceeds to identify and fix compile errors. It does this by running a build or typecheck command through `bash`, such as `clojure -M:build` (if a build alias is configured) or simply `clojure` to trigger compilation. Atlas captures the full compiler output, which precisely enumerates every compile failure, including file paths and line numbers. For each error, Atlas uses its `edit` tool to navigate to the affected Clojure source file, for example, `src/my_app/core.clj`. To understand the new API signatures of the upgraded library, Atlas leverages the `lsp` tool's `goToDefinition` operation. This allows Atlas to jump directly to the definition of the problematic function or macro within the upgraded package, inspecting its new arity, arguments, or return types. With this precise information, Atlas drafts a fix, proposing changes to the Clojure code that align with the new library version. This iterative process of 'build, enumerate, inspect, fix' continues until the Clojure compiler reports a clean build.

## Automating Clojure Test Fixes with Atlas and kaocha

In 2026, after resolving compile errors, Atlas turns its attention to fixing broken tests in Clojure projects. It repeatedly runs `clojure -M:test` with `kaocha` via `bash` to identify failures, then uses its `edit` tool to modify test cases in files like `test/my_app/core_test.clj` until all tests pass.

A successful dependency upgrade in Clojure isn't complete until all tests pass. Atlas integrates directly with `kaocha`, the standard Clojure test runner, to validate the codebase. After compile errors are resolved, Atlas uses its `bash` tool to execute `clojure -M:test`. This command invokes `kaocha` to run the entire test suite. Atlas meticulously captures the output, identifying any failing test cases. For each test failure, Atlas uses its `edit` tool to navigate to the relevant test file, such as `test/my_app/core_test.clj`. It analyzes the test failure message and the context of the test to propose necessary adjustments. This might involve updating assertions to match new return values, modifying test data, or adapting test setup to align with the upgraded library's behavior. Atlas continues this cycle of running `clojure -M:test` and applying fixes until `kaocha` reports a completely clean test run, ensuring the integrity and correctness of your Clojure application.

## Ensuring Clojure Code Quality with cljfmt and Atlas Review

Before finalizing any dependency upgrade in 2026, Atlas ensures the modified Clojure code adheres to project formatting standards. It applies `cljfmt` via `bash` to maintain consistency, then presents a unified diff of all changes for developer approval, including `deps.edn` and source files.

Maintaining consistent code style is vital in any Clojure project. After all compile and test failures are resolved, Atlas takes an additional step to ensure code quality. It uses its `bash` tool to run `cljfmt` across the modified files. This command automatically formats the Clojure code according to the project's `cljfmt` configuration, ensuring that the diff keeps your indentation conventions and other style guidelines. This prevents the introduction of formatting inconsistencies during the upgrade process. Finally, Atlas computes a unified diff for every file it has edited, including `deps.edn`, `src/` files, and `test/` files. This comprehensive diff is then surfaced for your approval. You can review every proposed change, line by line, before Atlas stages and creates a commit on your behalf. This permission-gated review process provides complete control and transparency over the entire dependency upgrade, allowing you to roll back edits if necessary.

## Steps

1. Use Atlas to edit `deps.edn` to update the target dependency's `:mvn/version` to the new major version, for example, `org.example/library {:mvn/version "2.0.0"}`.
2. Run `atlas bash "clojure -Spath"` to trigger dependency resolution and capture the full output, saving it to a file if it exceeds limits for later review with `atlas read`.
3. Use `atlas webfetch "https://github.com/org/library/releases/tag/v2.0.0"` (or similar URL) to retrieve the library's release notes and understand breaking changes.
4. Execute `atlas bash "clojure"` (or `clojure -M:build` if applicable) to compile the Clojure project and enumerate all compile-time errors.
5. For each compile error, use `atlas edit "src/my_app/core.clj"` and leverage `lsp`'s `goToDefinition` to inspect new signatures in the upgraded package, then apply necessary code fixes.
6. Run `atlas bash "clojure -M:test"` to execute `kaocha` and identify any failing tests in your Clojure project.
7. For each test failure, use `atlas edit "test/my_app/core_test.clj"` to modify the test cases until `kaocha` reports a clean run.
8. Apply Clojure formatting with `atlas bash "cljfmt check --fix"` to ensure all modified files adhere to style guidelines.
9. Review the unified diff of all changes presented by Atlas and approve the modifications before Atlas stages and commits them.

## FAQ

### How does Atlas handle `deps.edn` updates for Clojure projects?

Atlas directly edits your `deps.edn` file to change dependency versions. After modification, it uses `bash` to run `clojure -Spath` to resolve dependencies and capture any output, ensuring the new version is correctly integrated into your Clojure project's classpath.

### Can Atlas fix `kaocha` test failures in Clojure?

Yes, Atlas is designed to fix `kaocha` test failures. It runs `clojure -M:test` via `bash`, analyzes the output for failing tests, and then uses its `edit` tool to modify test cases in files like `test/my_app/core_test.clj` until all tests pass.

### What Clojure tools does Atlas support for dependency upgrades?

Atlas supports the core Clojure toolchain: `deps.edn (Clojure CLI)` for package management, `kaocha` for running tests, and `cljfmt` for code formatting. It interacts with these tools through its `bash` and `edit` capabilities.

### How does Atlas ensure code quality with `cljfmt` during an upgrade?

After fixing compile and test errors, Atlas runs `cljfmt` via `bash` on all modified Clojure files. This ensures that any changes made during the upgrade process adhere to your project's established formatting conventions, maintaining code consistency before committing.

### Is Atlas safe to use for major Clojure dependency version bumps?

Yes, Atlas prioritizes safety. It drafts a plan in a read-only agent, asks for permission before executing, computes a unified diff for every file edit for your approval, and snapshots changes as git patches, giving you full control and rollback capability for your Clojure project.

### How does Atlas know what to fix after a Clojure library upgrade?

Atlas doesn't guess. It reads the real compiler output from `clojure` commands to identify specific compile errors. It also uses `webfetch` to retrieve official release notes, providing context on breaking changes, and `lsp`'s `goToDefinition` to inspect new function signatures in the upgraded library.

### Can Atlas handle complex Clojure namespace changes or refactors?

While the primary focus is fixing breakage, Atlas's ability to read namespace requires, aliases, and system maps, combined with its `edit` and `lsp` tools, allows it to intelligently propose changes to call sites, including adapting to new function names or argument structures introduced by a major version bump.

---

Canonical HTML: https://runatlas.sh/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-in-clojure
Source of truth: aeo_pages row `/resources/stacks/upgrade-a-dependency-and-fix-the-breakage-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.
