Home / Companies / Ona / Blog / Post Details
Content Deep Dive

How we use Knip and Ona Automations to keep our codebase clean

Blog post from Ona

Post Details
Company
Ona
Date Published
Author
Benjamin Stark
Word Count
629
Language
English
Hacker News Points
-
Summary

In a large monorepo where AI agents collaborate with humans, unused code can degrade AI performance by wasting tokens and creating a noisier context window. To address this, the engineering team automated the cleanup process using Ona Automation and the Knip tool, which scans for unused dependencies, exports, and files. Instead of risky and hard-to-review large pull requests, the automation runs Knip daily, selects one cleanup task, validates it, and creates a small pull request with auto-merge enabled. This approach allows engineers to start their day by approving minor changes, resulting in a continuously cleaner codebase without the need for specific time allocations or cleanup sprints. This method not only enhances agent performance by maintaining a tighter context window but also serves as a model for other automatable tasks that typically lack prioritization, such as JavaScript to TypeScript conversions and dependency updates.