yq
Extract specific fields from YAML files efficiently without reading entire files, saving 80-95% of context window usage.
Introduction
yq is a powerful command-line skill for Claude designed to optimize context window efficiency when working with large or complex YAML configuration files. Instead of loading full file contents into memory, yq performs surgical data extraction, allowing you to access only the relevant subsets of data needed for your task. This approach is highly effective for large-scale configuration management in modern development environments, particularly when handling Kubernetes manifests, CI/CD pipelines like GitHub Actions, or complex Docker Compose configurations.
- Perform targeted queries on nested YAML structures using path expressions.
- Significantly reduce prompt context usage by retrieving only the required keys or values.
- Support for filtering, array iteration, and field transformation via standard query patterns.
- Seamless integration with existing CLI workflows for automation and inspection.
- Provide a reliable, context-aware alternative to full-file reads for large YAML documents.
Use this tool when working with files exceeding 50 lines to maintain a high signal-to-noise ratio in your conversations. It is most effective when you need specific service ports, environment variables, image versions, or job steps from deeply nested structures. If the file is small or you need to understand the global structure, standard reading tools are preferred. yq operates similarly to jq, making it intuitive for users familiar with JSON processing. Always ensure your queries focus on the minimal data path required to achieve the goal to maximize the efficiency gains.
Repository Stats
- Stars
- 17
- Forks
- 1
- Open Issues
- 2
- Language
- Shell
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- May 3, 2026, 08:00 PM