AgenticMemoryProductivity
Context Pruner
CLI Tool Name: context_pruner
Scores each context item (like file paths or retrieved data sets) by calculating keyword overlap with your active task description. Operates using purely CPU compute without any file reads or network overhead to preserve your agent's context limits cleanly. Items with zero overlap are universally dropped.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_description | string | yes | The current goal to check against. |
| items | string[] | yes | Array of file paths or text blocks to be scored. |
| keep_top_n | number | no | Limit the 'keep' array output length. (Default 10) |
| verbose | boolean | no | Exposes per-item scores and matched keywords inside the result when true. |
Example output
json
{
"recommendations": {
"keep": [
{ "item": "src/features/auth/login.tsx", "score": 8, "matched_keywords": ["auth", "login"] }
],
"drop": [
{ "item": "src/utils/math.ts", "score": 0, "matched_keywords": [] }
]
},
"metrics": {
"total_evaluated": 2,
"kept_count": 1,
"dropped_count": 1
}
}How to use it
example prompt
Filter this list of 50 files based on my current task: "Migrate the database ORM schema to Drizzle". Keep the top 5.