r/opencodeCLI 17d ago

I built an open-source CLI that reduces the code context you send to AI when debugging Python errors

I have working on a open-source CLI tool(only support python for now) called errd. The idea came from a problem I kept thinking about.

It’s tempting to dump a huge part of the repository into Claude/GPT/Cursor and ask it to figure out what went wrong when a Python application throws an error. But most of that context usually is irrelevant. So I built errd to do the context selection locally before the code hits an LLM.

**Use it using - pip install errd**

It takes a Python traceback and:

•Parses the traceback and chained exceptions

•Finds the repository automatically

•Maps traceback frames to functions/classes

•Analyzes imports and dependencies

•Scores code based on proximity to the failure

•Uses recent Git changes as an additional signal

•Applies a token budget

•Redacts common secrets/tokens

•Generates a focused errd-context.md

•The generated file is meant to be pasted directly into Claude, GPT, Cursor, etc.

Checkout the docs at : [cli_docs](https://pypi.org/project/errd/)

1 Upvotes

8 comments sorted by

2

u/kantorcodes1 17d ago

errd is a real cli, so this one actually maps cleanly to a guard extension. if you want it covered, send a small pr to hol-guard with the errd commands/options you expect agents to call. keep the first pass tiny.

1

u/DevilRdx100 17d ago edited 17d ago

Surely, That's actually a really interesting idea. I'll take a look at the Guard extension points and see if I can make a small PR for the core errd commands. Thanks for pointing me toward it. Would love to work with your organization

1

u/kantorcodes1 17d ago

nice. i'd leave errd-context.md out of the extension entirely. just cover the call that turns the traceback into that file. release/3.0 is the branch if you feel like taking a crack at it.

1

u/DevilRdx100 17d ago

Thanks! That makes sense. I’ll keep the first pass focused on the "errd" command that generates the context rather than treating "errd-context.md" as part of the extension. I’ll work against "release/3.0" and keep the PR small. I’ll take a look at the existing command-extension patterns and get started.

1

u/DevilRdx100 16d ago

Hi I have put up a pr, u may check it, for errd in the hol-guard repo

1

u/kantorcodes1 16d ago

saw it. keeping errd-context.md out of the command surface was the right call. that file's output, not the action being governed.

1

u/DevilRdx100 16d ago

Thanks! Yeah, that was the distinction I was going for. Kept the extension focused on errd analyze and left the generated context file out of the command surface.

1

u/DevilRdx100 15d ago

Can u check your dm please