---
title: pluginWorkDirectory
framework: swift-package-manager
role: symbol
role_heading: Instance Property
path: swift-package-manager/documentation/packageplugin/plugincontext/pluginworkdirectory
---

# pluginWorkDirectory

The path of a writable directory into which the plugin or the build commands can write files.

## Declaration

```swift
let pluginWorkDirectory: Path
```

## Discussion

Discussion This could include generated source files to processed further, as well as any caches used by the build tool or the plugin. The plugin is in complete control of what is written under this directory, and the package manager preserves the contents between builds. A plugin may create a separate subdirectory for each command it creates, with the command configured to write its output to that directory. The plugin may also create other directories for cache files and other file system content that either it or the command will need.

## See Also

### Inspecting the Context

- [pluginWorkDirectoryURL](swift-package-manager/documentation/packageplugin/plugincontext/pluginworkdirectoryurl.md)
- [tool(named:)](swift-package-manager/documentation/packageplugin/plugincontext/tool(named:).md)
- [package](swift-package-manager/documentation/packageplugin/plugincontext/package.md)
- [PluginContext.Tool](swift-package-manager/documentation/packageplugin/plugincontext/tool.md)
