Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Ignore rules go stale, and nested .gitignore files are ignored

Closed
#169 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
tooling

Research direction

Start with the ignore-rule cache in src/main/tools/workspace.ts:95-115, then trace invalidation through edit_file, write_file, apply_patch, undo in chat_manager.ts:142, and the separate CodeIndex workspace. Reproduce the nested-ignore case with pkg/.gitignore excluding dist/ and check how listFiles feeds grep, list_directory, glob, and embeddings. Done when changed and nested ignore rules are honored across these paths and the issue’s stale-rule scenarios are covered by tests.

Written by the indexing model from the issue text.

Description

bug priority: medium severity: medium

Found in the 2026-10-07 code review and confirmed with probes.

Problem

Workspace caches its ignore rules (src/main/tools/workspace.ts:95-115):

  • edit_file never calls invalidateIgnoreRules (only write_file and apply_patch do).
  • Undo invalidates a new Workspace (chat_manager.ts:142), not the cached one, so it has no effect.
  • Changes made by run_command, the user or git checkout are never picked up during a session.
  • CodeIndex keeps its own Workspace instance, and nothing ever invalidates its rules.
  • Only the root .gitignore/.ccignore are read. Nested .gitignore files and .git/info/exclude are ignored. Probe: pkg/.gitignore with dist/ still listed pkg/dist/bundle.js.

Impact

grep, list_directory, glob and the embeddings index include build output in monorepos, which wastes tokens and embedding money. Files the user just ignored are still shown.

Fix

  • Key the cache on the mtimeMs of each ignore file and re-read when one changes (one stat per call).
  • Load nested .gitignore files during listFiles, scoped to their folder, or use git ls-files -co --exclude-standard when .git exists.
Dominant language
TypeScript
Stars
2
Forks
2
Avg merge
5h 28m
Merged PRs (30d)
24

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PierrunoYT/patch

All issues in PierrunoYT/patch

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.