Skip to content

Steering Files

Steering files are markdown files that Kiro loads into context automatically, every session. They’re how you give the agent durable knowledge about your project instead of repeating yourself in every prompt. Good things to put in a steering file:

  • The purpose of the project: what it does and who it’s for.
  • The technologies used: language, frameworks, and key libraries.
  • Organizational coding standards: conventions that go beyond general language style, like how your team handles money, errors, naming, or comments.

Steering files live under .kiro/steering/ in your project (or ~/.kiro/steering/ for personal, machine-wide rules). Each file’s YAML frontmatter carries an inclusion field that tells Kiro when to load it — mark a file inclusion: always and it joins every conversation.

The inclusion field controls when a file enters context. This matters because anything loaded on every turn costs context whether it’s relevant or not. There are three modes:

inclusionWhen the file loadsUse it for
alwaysEvery turn of every sessionProject-wide rules that always apply
fileMatchOnly when a file matching fileMatchPattern is in contextRules scoped to one part of the codebase
manualOnly when you reference it with # in a promptOccasional context you pull in by hand

A fileMatch file declares the glob it reacts to:

.kiro/steering/test-conventions.md
---
inclusion: fileMatch
fileMatchPattern: '**/*.Tests.cs'
---
# Test conventions
- Name the test class after the class under test, like `MoneyTests`.
- Use Arrange-Act-Assert, with one descriptive method per case.

That file stays out of context until you open or reference a matching *.Tests.cs file. Then it loads, whole, automatically.

Exercise: teach Kiro your money convention

Section titled “Exercise: teach Kiro your money convention”

The budget tracker follows one firm rule throughout its code: money is integer cents (long), never decimal or float, and every money value shown to a user goes through Money.Format (see Money.cs). That’s a project decision. Nothing forces it, and the agent only follows it if it happens to notice. A steering file turns “happens to notice” into “always.”

Open the budget tracker in Kiro and ask it to extend the summary:

Add a GET /summary/by-category endpoint that returns each category
and how much was spent in it this month.

Run it:

Terminal window
curl "http://localhost:5000/summary/by-category"

Don’t paste a prepared file. In one or two imperative sentences, write the convention the way you’d say it to a new teammate:

.kiro/steering/money.md
---
inclusion: always
---
# Money
- All monetary amounts are integer **cents** (`long`). Never use `decimal`, `double`, or `float` for money.
- Every money value returned from an API or shown to a user is formatted with `Money.Format`.

Keep it terse and imperative. “Do this, not that” lands far better than a paragraph.

Before you run anything: what will change in the /summary/by-category output once the rule is loaded? Say it out loud or jot it down.

  1. Save the rule and restart Kiro so it loads.

    • Directory.kiro/
      • Directorysteering/
        • money.md
  2. Confirm it’s in context:

    /context show

    You should see money.md listed. If not, check it’s directly under .kiro/steering/, ends in .md, and has the inclusion: always frontmatter at the top.

  3. Remove the previous attempt (delete the endpoint, clear the context) and ask for the exact same feature again.

Terminal window
curl "http://localhost:5000/summary/by-category"