---
title: "Definition"
source: dbt Core Documentation
source_url: https://github.com/dbt-labs/docs.getdbt.com
licence: Apache-2.0
domain: data-and-analysis
subdomain: dbt-docs
date_added: 2026-04-25
---

<File name='dbt_project.yml'>

```yml
clean-targets: [directorypath]
```

</File>


## Definition
Optionally specify a custom list of directories to be removed by the `dbt clean` [command](/reference/commands/clean). As such, you should only include directories containing artifacts (e.g. compiled files, logs, installed packages) in this list.

## Default
If this configuration is not included in your `dbt_project.yml` file, the `clean` command will remove files in your [target-path](/reference/global-configs/json-artifacts).

## Examples

### Remove packages and compiled files as part of `dbt clean` (preferred) {#remove-packages-and-compiled-files-as-part-of-dbt-clean}


To remove packages as well as compiled files, include the value of your [packages-install-path](/reference/project-configs/packages-install-path) configuration in your `clean-targets` configuration.

<File name='dbt_project.yml'>

```yml
clean-targets:
    - target
    - dbt_packages
```

</File>

Now, run `dbt clean`.

Both the `target` and `dbt_packages` directory will be removed.

Note: this is the configuration in the dbt [starter project](https://github.com/dbt-labs/dbt-starter-project/blob/HEAD/dbt_project.yml), which is generated by the `init` command.


### Remove `logs` when running `dbt clean`

<File name='dbt_project.yml'>

```yml
clean-targets: [target, dbt_packages, logs]

```

</File>
