Official agent skill

Dump Intermediate Ir

by google in google/heir

Augments a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a…

OfficialApache-2.0Auto-check passedDevelopment

Install Dump Intermediate Ir

skills CLI
$ npx skills add google/heir --skill dump-intermediate-ir -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install google/heir dump-intermediate-ir --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/google/heir.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/dump_intermediate_ir .claude/skills/dump-intermediate-ir && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dump-intermediate-ir
GitHub stars
929
Token cost
~1.4k tokens
SKILL.md length
460 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
Apache-2.0

At a glance

Augments a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a…

  • Development work in your project
  • SKILL.md covers Overview, Usage and Gotchas
  • Calls bazel

What it does

Dump Intermediate Ir is an agent skill from google/heir, published by the product's own GitHub organization. Augments a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a particular pass at which the pipeline fails, or extract the corresponding IR input to a particular pass for further debugging.

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. The repository describes itself as: The compiler for homomorphic encryption. The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “Use the dump-intermediate-ir skill to augment a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass…”
  • “/dump-intermediate-ir”

What it can do on your machine

Read from SKILL.md and the folder at commit 4721d8d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bazel

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dump Intermediate Ir loads about 1.4k tokens when it runs. Until then it costs about 85 tokens; SKILL.md has 460 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from google/heir at commit 4721d8d, republished under its Apache-2.0 licence (© google). 460 words, ~1,436 tokens.

Download SKILL.mdSave it as .claude/skills/dump-intermediate-ir/SKILL.md (or your agent's skills folder).
name
dump-intermediate-ir
description
Augments a `bazel run` CLI command for `heir-opt` with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a particular pass at which the pipeline fails, or extract the corresponding IR input to a particular pass for further debugging.

Dump intermediate IR during compilation

Overview

This skill guides the agent in adding flags to the heir-opt tool to dump the compiled IR after each compiler pass to a series of files. These files can then be inspected to identify the failing pass as well as the IR input to the failing pass.

Usage

Converting a bazel run command

To convert a bazel run command, add the flags --mlir-print-ir-before-all and --mlir-print-ir-tree-dir=<PATH>, where <PATH> is a path to a temporary directory.

For example, given the following input command (which can be produced by the lit-to-bazel skill),

bash
bazel run //tools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' /path/to/file

The agent should produce the following (again where <PATH> is chosen appropriately)

bash
bazel run //tools:heir-opt -- --mlir-to-ckks='ciphertext-degree=8' --scheme-to-openfhe='entry-function=dot_product' --mlir-print-ir-before-all --mlir-print-ir-tree-dir=<PATH> /path/to/file
Tree structure

--mlir-print-ir-tree-dir nests the dumped IR in a tree structure that matches the nesting structure of the pass pipeline. In particular, by default all passes will be nested under a builtin_module_no-symbol-name/ folder, and any passes in the pipeline that are anchored on nested operations like func.func will be placed in subdirectories based on the name, such as func_func_matvec__decrypt__result0 for a pass anchored on func.func when the IR contains a function called matvec__decrypt__result0.

For example, if the flag --mlir-print-ir-tree-dir=/tmp/mlir is used, then the dumped files might look like:

/tmp/mlir/
└── builtin_module_no-symbol-name
    ├── 0_annotate-module.mlir
    ├── 10_compare-to-sign-rewrite.mlir
    ├── 11_canonicalize.mlir
    ├── 12_cse.mlir
    ├── 13_apply-folders.mlir
    ├── 14_canonicalize.mlir
    ├── 15_insert-rotate.mlir
    ├── 16_cse.mlir
    ├── 17_canonicalize.mlir
    ├── 18_cse.mlir
    ├── 19_collapse-insertion-chains.mlir
    ├── 1_debug-validate-names.mlir
    ├── 20_sccp.mlir
    ├── 21_canonicalize.mlir
    ...
    ├── func_func__assign_layout_9911323688340753831
    │   ├── 47_0_affine-expand-index-ops.mlir
    │   ├── 47_1_affine-simplify-structures.mlir
    │   ├── 47_2_affine-loop-normalize.mlir
    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir
    ├── func_func_matvec
    │   ├── 47_0_affine-expand-index-ops.mlir
    │   ├── 47_1_affine-simplify-structures.mlir
    │   ├── 47_2_affine-loop-normalize.mlir
    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir
    ├── func_func_matvec__decrypt__result0
    │   ├── 47_0_affine-expand-index-ops.mlir
    │   ├── 47_1_affine-simplify-structures.mlir
    │   ├── 47_2_affine-loop-normalize.mlir
    │   └── 47_3_forward-insert-slice-to-extract-slice.mlir
    └── func_func_matvec__encrypt__arg0
        ├── 47_0_affine-expand-index-ops.mlir
        ├── 47_1_affine-simplify-structures.mlir
        ├── 47_2_affine-loop-normalize.mlir
        └── 47_3_forward-insert-slice-to-extract-slice.mlir
Dumped file contents

At the top of each file, a comment is printed indicating how the file was generated, containing e.g., IR Dump Before CSEPass (cse). This will say whether the IR was dumped before or after a pass, as well as whether (in the case of --mlir-print-ir-after-failure) the pass failed.

Below the comment, the MLIR is printed in textual format.

Show full SKILL.md (206 more words)Show less

Gotchas

  • Stale files: --mlir-print-ir-tree-dir does not delete existing files, so if the command is re-run, be sure to remove the existing temporary files first.
  • Dump before vs after: --mlir-print-ir-before-all prints the IR before a pass runs, which is required to extract the IR if a pass has a hard error like a segfault. To dump the IR after each pass, use --mlir-print-ir-after-all.
  • Dumping after failure: For some errors without stack traces (like a dialect conversion failure where the compiler fails gracefully), you can use --mlir-print-ir-after-failure to dump the IR at failure time, which can provide additional debugging information. One notable example is when dialect conversion fails, the IR dumped by --mlir-print-ir-after-failure includes the partially-converted IR including any unrealized_conversion_cast ops that failed to be removed.
  • Dumping after change: The number of files can be reduced by using --mlir-print-ir-after-change, which only prints the IR if the compiler pass changed it. There is no "before change" analogue.
  • Dumping after change: The number of files can be reduced by using --mlir-print-ir-before=<pass_name>, which only prints the IR before the target pass. Since a pass can be run multiple times in a pipeline, this may still produce many files if, for example, the pass is a common one like cse.
markdown
Copy this checklist and track progress:

- [ ] Step 1: Identify the command to convert, perhaps with `lit-to-bazel`
- [ ] Step 2: Add the relevant flags, defaulting to `--mlir-print-ir-before-all` and `--mlir-print-ir-tree-dir` if there is no specific reason to use the more specific flags.
- [ ] Step 3: Inspect the generated command and run it.
- [ ] Step 4: Inspect the dumped files for information.
<!-- mdformat global-off -->

© google, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/dump_intermediate_ir of google/heir.

Open the folder on GitHubat commit 4721d8d

Compare with similar skills

Dump Intermediate Ir next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dump Intermediate Ir compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dump Intermediate Ir this skillgoogle/heir929—~1.4kAutomated safety check: PassApache-2.0
Vercel Composition Patternssupabase/supabase111k59 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 59 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from google/heir

  • Lit To Bazel

    google/heir

    Official

    Converts MLIR lit test files to bazel run commands. An agent skill from google/heir.

    929 GitHub stars~447 tokensUpdated today
    Auto-check passed
  • E2E To Bazel

    google/heir

    Official

    Converts end-to-end (e2e) test targets or paths to bazel run commands for heir-opt.

    929 GitHub stars~394 tokensUpdated today
    Auto-check passed
  • Official

    Describes a decision tree of steps and skills to utilize when, starting from a test failure or the failure of bazel run command using heir-opt, you would like to produce a reproducing input IR that…

    929 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Categories

Questions about Dump Intermediate Ir

What does Dump Intermediate Ir do?

Augments a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a…. Dump Intermediate Ir is an agent skill from google/heir, published by the product's own GitHub organization. Augments a bazel run CLI command for heir-opt with additional flags that dump the IR before each compiler pass, allowing the agent to inspect intermediate IR during compilation, identify a particular pass at which the pipeline fails, or extract the corresponding IR input to a particular pass for further debugging.

When should I use Dump Intermediate Ir?

Dump Intermediate Ir fits situations like: development work in your project.

How do I install Dump Intermediate Ir in Claude Code?

Run `npx skills add google/heir --skill dump-intermediate-ir -a claude-code`. Or copy the skill folder (.agents/skills/dump_intermediate_ir in google/heir) into .claude/skills/dump-intermediate-ir in your project. Claude Code loads it when a task matches its description.

How do I install Dump Intermediate Ir in Codex?

Run `npx skills add google/heir --skill dump-intermediate-ir -a codex`. Or copy the skill folder (.agents/skills/dump_intermediate_ir in google/heir) into .agents/skills/dump-intermediate-ir in your project. Codex loads it when a task matches its description.

Can I use Dump Intermediate Ir in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add google/heir --skill dump-intermediate-ir -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dump-intermediate-ir, .gemini/skills/dump-intermediate-ir, .github/skills/dump-intermediate-ir and .opencode/skills/dump-intermediate-ir in your project.

What does Dump Intermediate Ir need to run?

Going by SKILL.md and its folder, Dump Intermediate Ir needs the command-line tools its instructions call (bazel).

Does Dump Intermediate Ir access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dump Intermediate Ir safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dump Intermediate Ir use?

Dump Intermediate Ir is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dump Intermediate Ir use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dump Intermediate Ir?

Skills that share tags, products or a category with Dump Intermediate Ir: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 296k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dump Intermediate Ir?

google (a GitHub organization, an official publisher) maintains it in google/heir, which has 929 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on October 8, 2026.

Source: google/heir on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.