# clean-targets

dbt\_project.yml

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

## Definition

Optionally specify a custom list of directories to be removed by the `dbt clean` [command](../commands/clean.md). 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](../global-configs/json-artifacts.md).

## Examples

### Remove packages and compiled files as part of `dbt clean` (preferred)

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

dbt\_project.yml

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

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`

dbt\_project.yml

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

## Was this page helpful?

YesNo

[Privacy policy](https://www.getdbt.com/cloud/privacy-policy)[Create a GitHub issue](https://github.com/dbt-labs/docs.getdbt.com/issues)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.
