context-dropper 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +90 -8
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,24 +3,103 @@
|
|
|
3
3
|
`context-dropper` is a CLI for iterating through a fixed list of files, tracking
|
|
4
4
|
position, and tagging progress.
|
|
5
5
|
|
|
6
|
-
##
|
|
6
|
+
## Why Context Dropper?
|
|
7
|
+
|
|
8
|
+
AI coding agents struggle with large codebases in two main ways:
|
|
9
|
+
|
|
10
|
+
1. **Search doesn't guarantee coverage:** Agents often rely on semantic or
|
|
11
|
+
keyword search to find relevant files, and it works well in many cases. But
|
|
12
|
+
for tasks that require iterating over every file in a set, there is no
|
|
13
|
+
guarantee that search alone will find them all.
|
|
14
|
+
2. **Context windows are a hard constraint:** Feeding an entire codebase into an
|
|
15
|
+
LLM at once is often simply impossible. Codebases frequently exceed the
|
|
16
|
+
model's token limit. Even when it fits, reasoning quality degrades as the
|
|
17
|
+
context grows.
|
|
18
|
+
|
|
19
|
+
`context-dropper` solves this by enforcing strict, programmable processing
|
|
20
|
+
loops.
|
|
21
|
+
|
|
22
|
+
Instead of relying on search, a precise list of target files (a "fileset") is
|
|
23
|
+
curated upfront - either manually or by using other tools - and the agent is
|
|
24
|
+
instructed to process that exact list sequentially. As the agent moves from one
|
|
25
|
+
file to the next, it can drop the previous file's tokens from memory. Each file
|
|
26
|
+
is then evaluated in a **clean context**.
|
|
27
|
+
|
|
28
|
+
This approach guarantees 100% file coverage, minimizes token usage, and keeps
|
|
29
|
+
the model's reasoning sharp.
|
|
30
|
+
|
|
31
|
+
### A Conceptual Example
|
|
32
|
+
|
|
33
|
+
Consider an agent tasked with exploring a large codebase to document every piece
|
|
34
|
+
of authentication logic it finds into a single file
|
|
35
|
+
(`authentication-discovery.md`). Without `context-dropper`, the agent would use
|
|
36
|
+
search to find files containing keywords like "auth", "login", or "session", and
|
|
37
|
+
might miss files that contain authentication logic but don't match those
|
|
38
|
+
keywords. With `context-dropper`, the agent instead iterates over a fixed,
|
|
39
|
+
curated list of files, such as all files in a subdirectory or a filtered list
|
|
40
|
+
from a test coverage report.
|
|
41
|
+
|
|
42
|
+
Here is how that looks in practice:
|
|
43
|
+
|
|
44
|
+
1. **The Fileset**: A discrete list of target files is provided to the tool:
|
|
45
|
+
- `src/auth/login.ts`
|
|
46
|
+
- `src/routes/api.ts`
|
|
47
|
+
- `src/middleware/session.ts`
|
|
48
|
+
2. **The Dropper**: A "dropper" is created and attached to that fileset. The
|
|
49
|
+
dropper acts as a stateful bookmark that tracks exactly where the agent is in
|
|
50
|
+
the list (it can go forward or backward).
|
|
51
|
+
3. **The Loop**: The AI agent is given a strict set of instructions: _"Read the
|
|
52
|
+
current file from the dropper. If authentication logic is found, append the
|
|
53
|
+
findings to `authentication-discovery.md`. Then mark the file as 'processed',
|
|
54
|
+
and move the dropper to the next file until the list is exhausted."_
|
|
55
|
+
|
|
56
|
+
By explicitly unloading the previous file from its context window before moving
|
|
57
|
+
the dropper, the context size remains small. This prevents the LLM from blowing
|
|
58
|
+
past its token limits or suffering from degraded reasoning. In theory, an
|
|
59
|
+
unlimited number of files can be processed this way.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
You can install `context-dropper` using one of the following methods.
|
|
64
|
+
|
|
65
|
+
### 1. Download Pre-compiled Binary (Recommended)
|
|
66
|
+
|
|
67
|
+
Download the latest standalone executable for your operating system from the
|
|
68
|
+
[Releases](https://github.com/fardjad/context-dropper/releases) page. Ensure it
|
|
69
|
+
is executable and in your `PATH`.
|
|
7
70
|
|
|
8
71
|
```bash
|
|
9
|
-
|
|
72
|
+
chmod +x context-dropper
|
|
73
|
+
mv context-dropper /usr/local/bin/
|
|
10
74
|
```
|
|
11
75
|
|
|
12
|
-
|
|
76
|
+
### 2. Install via Package Manager
|
|
77
|
+
|
|
78
|
+
You can install the package globally from NPM.
|
|
79
|
+
|
|
80
|
+
**Bun:**
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bun install -g context-dropper
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**NPM:**
|
|
13
87
|
|
|
14
88
|
```bash
|
|
15
|
-
|
|
89
|
+
npm install -g context-dropper
|
|
16
90
|
```
|
|
17
91
|
|
|
18
|
-
|
|
92
|
+
Then run it anywhere:
|
|
19
93
|
|
|
20
94
|
```bash
|
|
21
95
|
context-dropper --help
|
|
22
96
|
```
|
|
23
97
|
|
|
98
|
+
### 3. Build from Source (Development)
|
|
99
|
+
|
|
100
|
+
To develop, compile binaries from source, or contribute to the project, please
|
|
101
|
+
refer to the [Contributing Guide](CONTRIBUTING.md).
|
|
102
|
+
|
|
24
103
|
## Command Shape
|
|
25
104
|
|
|
26
105
|
```bash
|
|
@@ -213,9 +292,12 @@ context-dropper dropper is-done <dropperName>
|
|
|
213
292
|
|
|
214
293
|
## OpenCode Plugin
|
|
215
294
|
|
|
216
|
-
This repository also includes a dedicated, self-contained plugin for
|
|
217
|
-
|
|
218
|
-
|
|
295
|
+
This repository also includes a dedicated, self-contained plugin for
|
|
296
|
+
[OpenCode](https://github.com/opencode-ai/opencode) under `opencode-plugin/`.
|
|
297
|
+
The plugin natively binds to the `context-dropper` APIs and lets you iterate
|
|
298
|
+
through filesets autonomously inside an OpenCode chat session. See
|
|
299
|
+
[opencode-plugin/README.md](./opencode-plugin/README.md) for installation and
|
|
300
|
+
usage instructions.
|
|
219
301
|
|
|
220
302
|
## Exit Codes
|
|
221
303
|
|
package/dist/index.js
CHANGED
|
@@ -6558,7 +6558,7 @@ function createFilesetCommand(deps) {
|
|
|
6558
6558
|
// package.json
|
|
6559
6559
|
var package_default = {
|
|
6560
6560
|
name: "context-dropper",
|
|
6561
|
-
version: "0.1.
|
|
6561
|
+
version: "0.1.6",
|
|
6562
6562
|
description: "CLI for iterating through a fixed list of files, tracking position, and tagging progress within an AI agent's session.",
|
|
6563
6563
|
author: {
|
|
6564
6564
|
name: "Fardjad Davari",
|
package/package.json
CHANGED