Skip to content

[Feature] Custom .nanocoderignore File Support #755

Closed

Description

@akramcodez

Description

Introduce support for a .nanocoderignore file at the root of the workspace. This file would prevent the AI from ever reading or considering specific files, even if they are referenced or open.

Use Case

Developers often have large generated files (e.g., package-lock.json, minified builds, huge CSV datasets) or sensitive files (.env) that should never be sent to the LLM. While .gitignore covers some of this, users sometimes need to commit files to Git but hide them from the AI to save tokens and prevent context bloat.

Proposed Solution

Before the ACP client reads a file or builds workspace context, it should check against glob patterns defined in .nanocoderignore.

Alternatives Considered

  • Relying solely on .gitignore, but this doesn't cover files that are tracked in version control but shouldn't be read by the AI.

Additional Context

  • I have searched existing issues to ensure this is not a duplicate
  • This feature aligns with the project's goals (local-first AI assistance)

Implementation Notes (optional)

  • Use a lightweight glob matching library (like ignore on npm).
  • Parse the file during session initialization and pass the ignore list to file-reading tools.

Contribution Guidelines

  • If you would like to work on this issue, please comment below to ask for assignment first.
  • Before opening a Pull Request, please briefly share your implementation plan in this thread so we can align on the approach!

Activity

  1. added
    enhancement
    on Aug 3, 2026
  2. changed the title [-]# [Feature] Custom `.nanocoderignore` File Support[/-] [+][Feature] Custom `.nanocoderignore` File Support[/+] on Aug 3, 2026
  3. A-S-Manoj commented on Aug 4, 2026

    @A-S-Manoj
    Contributor

    Hi! I'd like to work on this — could I get assigned?

    .gitignore handling already exists in source/utils/gitignore-loader.ts (uses the ignore package, 5 call sites consume it). Plan: extend that same loadGitignore function to also read .nanocoderignore and merge its patterns into the same ignore instance, additive on top of .gitignore. No changes needed to the 5 call sites since they just consume the returned object.

    Will add tests covering: .nanocoderignore alone, both files together, and neither present. Keeping the function name as-is unless you'd prefer a rename.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions