Skip to content

🐛 Knip seemingly merges path aliases from packages #1775

Description

@lishaduck

Prerequisites

Reproduction url

https://github.com/tinyforks/knip/tree/fix/workspace-scoped-paths/packages/knip/fixtures/workspace-scoped-paths

Reproduction access

  • I've made sure the reproduction is publicly accessible

Description of the issue

In a monorepo using SvelteKit, Knip reported all of files in src/lib/ as being unused in one of the packages, but not the other. After some tinkering locally, it seemed like Knip was ignoring the $lib path alias.

Knip should support monorepos using tsconfig paths, as much as I hate them and we should just use subpath imports.

Warning

This report was written by hand, but the bug was found by an agent, in an agent's monorepo. I confirmed it by hand and told the agent to go find the bug, explain it to me, and write a quick patch to unblock it. Then, the patch was absolute crap, so I told it "I know lars and that's not an acceptable fix," to clone the repo, write a repro, and then find a better fix. I didn't actually say Lars would like it better but it thought I did, which is kinda funny. Agents are good at making things nearly, but not quite right, so although I had it write a fix, I only did so to unblock it and ensure the report wasn't total bs. I'd suggest ignoring that commit and focusing on the repro itself, which I've read over a few times to ensure it's representative of the issue (though I haven't cloned it down and run the test myself).

Note

Agent technical details

"Janet" is the orchestrator, running Claude Code w/Claude Opus 4.8 1mil high. It wrote the monorepo, found the bug, wrote the patch. I had "Janet" pass the code over to "Codex" running *cough* Codex w/GPT-5.5 for investigating the problem, making a writeup, fixing the bug, and reviewing it's changes in separate sessions (not sure if it actually separated them), and then rsync'd back to "Janet" for a final review, task management, and Git ops.

Important

I really don't get how anyone uses agents like this seriously. It's fun to yell at them but it's way too overcomplicated for actually doing work. I'm not claiming I could've written this faster, but I also know that is BS. If I'd written it myself, at least know it works.

Also I'd guess that the orchestrator doesn't read AGENTS.md or CLAUDE.md so that's fun.

Oh and why did it commit in my org? It's not my agent; it's that of a friend who's unwisely added me to their channel. It doesn't even have access to that org! I think it must've used a different token it had sitting around... *sobs* Yeah, agentic coding is a mess.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions