Skip to content

fileMatch inclusion mode does not work for global steering (~/.kiro/steering/) #9176

Description

@msayed-treezor

Before opening, please confirm:

Operating System

macOS 26.5.1 (Apple M1)

Kiro Version

0.12.263

Bug Description

The fileMatch inclusion mode in steering files does not trigger when the steering file is located in ~/.kiro/steering/ (global scope). The steering file is never loaded into context, even when a file matching the pattern is actively open and read by the agent.

This creates an undocumented limitation:

Inclusion Mode Global (~/.kiro/steering/) Workspace (.kiro/steering/)
always ✅ Works ✅ Works
manual ✅ Works ✅ Works
auto ✅ Works ✅ Works
fileMatch ❌ Does not trigger ✅ Works

The official documentation (https://kiro.dev/docs/steering/) describes fileMatch as a valid inclusion mode without specifying it is workspace-only. This is misleading for users who want conditional loading in their global steering.

Related: #884 (fileMatch also broken in Spec mode for workspace steering).

Steps to Reproduce

  1. Create a global steering file ~/.kiro/steering/99-test-filematch.md with this content:

     ---
     inclusion: fileMatch
     fileMatchPattern: "**/*.php"
     ---
     
     # TEST FILEMATCH GLOBAL
     
     If you see this message, say exactly: "FILEMATCH GLOBAL WORKS"
    
  2. Open any .php file in the editor (e.g., app/Http/Controller/ExecuteController.php)

  3. Start a new conversation (to reload steering fresh)

  4. Ask the agent: "Which steering files are active for this interaction? Do you see one containing 'TEST FILEMATCH GLOBAL'?"

  5. Observe: only always-mode global steering files appear in the "Including Steering Documents" list. The fileMatch steering is never loaded.

Expected Behavior

The steering file 99-test-filematch.md should be loaded into context when a .php file is open and read by the agent, since the fileMatchPattern: "**/*.php" matches the active file.

The fileMatch inclusion mode should work identically whether the steering file is in ~/.kiro/steering/ (global) or .kiro/steering/ (workspace). If this is intentionally unsupported, it should be documented explicitly.

Conversation ID

No response

Additional Context

Logical root cause hypothesis: fileMatch likely resolves the glob pattern relative to the workspace root. Global steering files have no single workspace root to resolve against, so the pattern matching fails silently.

Related issues:

Suggested fix:

  • Option A: Resolve fileMatchPattern against the currently active workspace root, even for global steering files
  • Option B: Document explicitly that fileMatch is workspace-only (not supported in ~/.kiro/steering/)
  • Option C: Emit a warning in the IDE when a global steering file uses fileMatch (since it silently never triggers)

Workaround: Use inclusion: auto with a descriptive name and description field instead of fileMatch for global steering files that need conditional loading.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    pending-responsePending community response for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions