Skip to content
Back to skills

Pruner

ASecurity

Pick the smallest set of file:line ranges relevant to a concrete task (bug, compiler error, failing test, change) in a large Python or C/C++ repository, instead of grep-exploring or reading whole files. Skip when the task or traceback already names the file.

  • 6 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added October 23, 2026
ai-agentspythonc++bashsqlbackend

Works with

  • cli

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add oliverweissl/context-garden --skill pruner --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pruner?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pruner
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oliverweissl-pruner/badge)](https://www.skillsdirectory.com/skills/oliverweissl-pruner)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pruner
description: Pick the smallest set of file:line ranges relevant to a concrete task (bug, compiler error, failing test, change) in a large Python or C/C++ repository, instead of grep-exploring or reading whole files. Skip when the task or traceback already names the file.
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/bin/pruner *), Bash("${CLAUDE_SKILL_DIR}/bin/pruner" *)
---

# pruner

!`"${CLAUDE_SKILL_DIR}/bin/pruner" mode --banner`

Agents that do not expand the line above (e.g. Codex): run
`<this-skill-dir>/bin/pruner mode --banner` first and follow it.

Offline indexer + lexical/structural relevance scorer (keyword overlap,
call graph, error-stack membership, test relationships; no embeddings,
no LLM). How scores work: `references/scoring.md`.

`pruner` is not on PATH: run `<this-skill-dir>/bin/pruner`.

1. Select a slice:
   ```
   <this-skill-dir>/bin/pruner select --task "<what you're doing>" --budget <N> \
     [--error "<traceback>" | --error-file <path>] [--changed <files...> | --auto-changed]
   ```
   If you have an error, always pass `--error`; error-stack membership is
   the strongest relevance signal.
   First run builds a SQLite index under `.pruner/`; later runs re-parse
   only changed files. Output lists `required_context`,
   `supporting_context`, `relevant_tests`, `relevant_config` as exact
   `file:start-end` ranges with a reason each. Read those ranges, not whole
   files.
2. The slice is a starting point, not a fence. If confidence is
   `low`/`medium` (a `hint:` line is printed) or the slice doesn't explain
   the behavior, fall back to targeted grep and reads.
3. Missing a dependency? Don't re-run `select` from scratch or fall back to
   open-ended exploration: check `omitted_candidates`, then
   `bin/pruner expand <slice_id> --add <id or file:start-end>` (or
   `--file <path> --lines A:B`). The token budget is hard-enforced: `select`
   never returns more than `--budget` tokens and `expand` refuses to exceed
   it unless you pass `--budget-extra N`.
4. `bin/pruner show <slice_id>` / `list` re-print saved slices without re-scoring.
5. With the plugin, an error pasted into the prompt is sliced automatically
   (context starting "pruner (ran automatically ..."): start from that
   slice, `expand` it rather than re-running `select`.

Full CLI (`--graph`, `--parser`, tree-sitter backend, language scope):
`references/schema.md`.

Files in this skill

  • .gitignore28 B
  • SKILL.md2.2 KB
  • bin/pruner625 B
  • references/schema.md4.1 KB
  • references/scoring.md3.4 KB
  • scripts/cg_mode.py5.2 KB
  • scripts/pr_common.py5.5 KB
  • scripts/pr_cpp.py9.6 KB
  • scripts/pr_graph.py1.5 KB
  • scripts/pr_hook.py2.8 KB
  • scripts/pr_index.py14.7 KB
  • scripts/pr_python.py3.8 KB
  • scripts/pr_score.py16 KB
  • scripts/pr_select.py21.7 KB
  • scripts/pr_store.py11 KB
  • scripts/pr_treesitter.py10.9 KB
  • scripts/pruner.py12.9 KB
  • tests/eval/baseline.json2.5 KB
  • tests/eval/cases.json9.5 KB
  • tests/eval/run_eval.py7.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.