Kiro icon indicating copy to clipboard operation
Kiro copied to clipboard

kiroAgent.agentIgnoreFiles Error

Open coder-kurt opened this issue 11 months ago • 10 comments

Before opening, please confirm:

Operating System

darwin

Kiro Version

0.8.0

Bug Description

agent tell me "File is ignored: /Users/wangshengke/Workspace/Singulo/singulo-core/singulo/pytest/tests/api/test_material_controller.py. To allow access, modify the kiroAgent.agentIgnoreFiles setting.. The agent has seen this error and will try a different approach to write the file if needed." But my settings has no ignore items

Steps to Reproduce

agent tell me "File is ignored: /Users/wangshengke/Workspace/Singulo/singulo-core/singulo/pytest/tests/api/test_material_controller.py. To allow access, modify the kiroAgent.agentIgnoreFiles setting.. The agent has seen this error and will try a different approach to write the file if needed." But my settings has no ignore items

Expected Behavior

agent tell me "File is ignored: /Users/wangshengke/Workspace/Singulo/singulo-core/singulo/pytest/tests/api/test_material_controller.py. To allow access, modify the kiroAgent.agentIgnoreFiles setting.. The agent has seen this error and will try a different approach to write the file if needed." But my settings has no ignore items

Conversation ID

a64ff7d7-b955-4e9e-9162-e218b84e1e6b 71ae2f78-c3c7-423f-8b36-79903efd633d 74a1c7de-ede5-405b-86bc-7437214c72b6

Additional Context

No response

coder-kurt avatar Jan 04 '26 03:01 coder-kurt

Kiro takes the .gitignore and .gitignore_global into account too. This is probably to ignore sensitive files but it does not make sense to ignore the .kiro folder if it's ignored by git.

jcvanderwal avatar Mar 30 '26 20:03 jcvanderwal

Is there a way to get around it?

ruanimal avatar Apr 28 '26 03:04 ruanimal

You can remove .kiro from .gitognore and put it in .git/info/exclude file inside your repo. Works for me.

kravlad avatar Apr 28 '26 04:04 kravlad

I find very annoying that kiro takes .gitignore and .gitignore_global into account too. It happens quite often that I have stuff that I do not want to commit (rapid prototyping) but I want kiro to be able to act on it. There are a lot of solutions for this.

Examples:

  • decouple the 2. what about .kiroignore ?
  • a way to add to .gitignore with the same syntax as git so that I can say: exclude in gitignore and in kiroignore I can just say: include this with a partial or total override?

I understand the default but I would like to be able to change/customize it without needing to change git behavior

putting stuff in .git is a hack. Nice idea but it would be better to have things done correctly

cattabiani avatar May 13 '26 10:05 cattabiani

Hi!

So, what I understand is that Kiro should respect .gitignore, but when I ask to create steering it created structure.md with references to Eclipse files that must be ignored (.gitignore).

My kiroAgent.agentIgnoreFiles is empty, on fresh install. Is this correct? By default it takes .gitignore into account or not?

About points here:

  • By default, most agents takes .gitignore into account, I think this is the correct approach.
  • .git/info/exclude works, but it's local.
  • If .kiroignore has load order, maybe a negation rule could work?

claudioweiler avatar May 20 '26 21:05 claudioweiler

this seems to be new behaviour and is annoying. as others have said, its reading my global .gitignore file which i exclude the .kiro directory. Why has it started to do that?

oniice avatar May 29 '26 07:05 oniice

This issue still exists with Kiro IDE 1.0.116, and Kiro CLI 2.12.1. Kiro use ~/.gitignore_global as it's default ingore file list. Which means, you do no want to submit .kiro dir and put .kiro in ~/.gitignore_global, then your Kiro will block reading on .kiro dir. Your steering will not work at all.

WT... Unbeliveable design.

aobao32 avatar Jul 13 '26 09:07 aobao32

we want to globally ignore .kiro but this could be a good workaround for now.

  • .kiro/ lives at the workspace root you open — so if you open /Users/chelsea/workspace/supt-ai/src/, that's where .kiro/ would go.
  • .git/ stays wherever your repo is initialized — at /Users/chelsea/workspace/supt-ai/src/supt-ai/. Git doesn't care where your editor's workspace root is.

The only thing to keep in mind: Kiro's git-aware features (diff context, commit helpers, etc.) will still detect the .git repo in the subdirectory. VS Code / Kiro handles nested or non-root git repos without issue.

So you'd end up with:

/Users/chelsea/workspace/supt-ai/src/
├── .kiro/                  ← Kiro config (specs, steering, hooks)
└── supt-ai/
    ├── .git/               ← Git repo
    ├── .kiro/              ← (you'd remove or ignore this one)
    └── ...

One small caveat: if your .kiro/ specs reference file paths (like in steering files or specs), those paths would be relative to the new workspace root (src/), so you'd prefix them with supt-ai/.... Not a big deal, just something to adjust if you move things around.

helseaCat avatar Jul 13 '26 15:07 helseaCat

I am finding this still an issue, when its set even after explicitly setting a Agent Ignore Files to to something like .kiroignore - which apparently is only a workspace setting, not a global kiro one?

End up still having problems reading its own directory (anything in the global or project .kiro dir).

e.g.

Retry listing the steering directory after the full reload to confirm access is now open.
Denied
/Users/fred/abc122/.kiro/steering
Rule
deny .kiro
Defined in
/Users/fred
/.gitignore

I even tried to get it to solve its own issue...

The deny isn't coming from kiroAgent.agentIgnoreFiles at all. Notice the source is your home .gitignore - 
that's Git's global ignore file (set via core.excludesfile). 

Kiro honors global ignore files automatically and always, independent of the agentIgnoreFiles setting. 
That's why setting agentIgnoreFiles to [".kiroignore"] and reloading changed nothing - 
that setting only governs workspace-root ignore files, not the global git excludesfile.

myerscf avatar Oct 02 '26 14:10 myerscf

Yes this seems to be particularly annoying as I would like to add .worktrees to my .gitignore global but then kiro cannot work on a feature on a worktree (that I store under .worktrees).

For this, I use the following workaround:

  1. Remove the entry from ~/.gitignore and/or .gitignore
  2. Add the entry to each repo under .git/info/exclude.

The difference between .gitignore and .git/info/exclude is that .gitignore is included in your git history. So please be careful removing anything from here since this will affect any other clones of this repo (i.e your colleagues).

.git/info/exclude is only stored in your local clone of the repo

alexiswl avatar Nov 02 '26 22:11 alexiswl