> ## Documentation Index
> Fetch the complete documentation index at: https://aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# aspect cache diff: affected tests, from the remote cache

> aspect cache diff lists the test targets your working tree affects by probing the remote cache, and runs no tests.

[← Shipped](https://aspect.build/shipped)

# aspect cache diff: affected tests, from the remote cache

***

![A cache miss in the dependency graph marks the two tests that depend on it, and aspect cache diff prints them](https://mintlify.s3.us-west-1.amazonaws.com/aspectbuild/images/marketing/illustrations/shipped-cache-diff.svg)

Your remote cache already knows which tests a change can affect. [`aspect cache diff`](https://aspect.build/docs/cli/tasks/cache_diff) asks it. Every cache hit means a target is unaffected, every miss is attributed to the tests that depend on it, and nothing runs.

```shell theme={null}
aspect cache diff //services/... | xargs bazel test
```

* **Two modes.** `overreport`, the default, executes nothing. `--mode=precise` builds the missing non-test actions first and flags a test only when its own test action misses.
* **Scriptable.** Labels go to stdout and progress to stderr. `--output=json` names the cache-missed target behind each affected test, and `--exec="bazel test"` runs a command on the result.
* **Cache only.** It needs a writable `--remote_cache` with a baseline your CI already uploads, and no remote execution.

It's in the Aspect CLI, free. [Which tests are affected? Ask the cache, run nothing.](https://aspect.build/blog/selective-testing-with-cache-diff) explains how the probe works and how it compares with hashing targets. The [`aspect cache diff` docs](https://aspect.build/docs/cli/tasks/cache_diff) cover flags and prerequisites.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.