Skip to content

Include Directives

Include directives allow you to modularize and reuse workflow components across multiple workflows.

@include relative/path/to/file.md

Includes files relative to the current markdown file’s location.

@include? relative/path/to/file.md

Includes files optionally - if the file doesn’t exist, no error occurs and a friendly informational comment is added to the workflow. The optional file will be watched for changes in gh aw compile --watch mode, so creating the file later will automatically include it.

@include filename.md#Section

Includes only a specific section from a markdown file using the section header.

  • Only tools: frontmatter is allowed in included files, other entries give a warning.
  • Tool merging: allowed: tools are merged across all included files
# Base workflow
---
tools:
github:
allowed: [get_issue]
---
@include shared/extra-tools.md # Adds more GitHub tools
shared/extra-tools.md
---
tools:
github:
allowed: [add_issue_comment, update_issue]
edit:
---

Result: Final workflow has github.allowed: [get_issue, add_issue_comment, update_issue] and Claude Edit tool.

  • Relative paths: Resolved relative to the including file
  • Nested includes: Included files can include other files
  • Circular protection: System prevents infinite include loops