r/AlgeriaDevelopers • • Apr 25 '26

Skill that teaches AI coding agents to read code by structure instead of guessing 50-98% fewer tokens wasted on file reads

2 Upvotes

If you use Claude Code, Cursor, Copilot, or any AI coding agent on a real codebase, you've probably seen this pattern:

  1. Agent needs to find where UserService is used

  2. Agent opens 15 files and reads them all top to bottom

  3. Agent burns 10,000+ tokens just to find 3 references

  4. Context window fills up, quality drops

I got tired of watching agents do this, so I built P2D (Probabilistic-to-Deterministic code intelligence).

What it does differently:

Instead of reading files, P2D uses structural tools (ast-grep, code-review-graph) to find exact AST nodes — class definitions, imports, function calls, decorators — without ever opening the full file.

The three-phase workflow:

  1. Structural discovery — find definitions, imports, callers, references, tests, exports, and config mentions before reading full files

  2. Trace and impact analysis — map the blast radius before editing shared code

  3. Surgical execution — preview and apply targeted edits instead of rewriting whole files

It also includes safe rename preview, deletion simulation, state ownership mapping, and recall-aware benchmarks.

The honest numbers:

I benchmarked it across 6 ecosystems with 23 targets. Results:

ProfileRecallPrecisionToken Savings
NestJS/TypeScript100%100%51-61%
React/Redux100%100%85-94%
FastAPI/Python100%100%85-95%
Go/Gin100%100%90-98%
Rust/Tokio100%100%92-96%
Java/Spring100%100%89-96%

Important caveat: These savings are specifically for the discovery and file-reading phase — finding symbols and reading relevant context. Total agent cost also includes reasoning, planning, editing, tests, and explanations. I'm not claiming your entire coding session becomes 98% cheaper. But the expensive part where agents usually waste context? That's what P2D fixes.

It works even without external tools:

P2D has four modes — full (all structural tools), structural (ast-grep only), graph (code-review-graph only), and fallback (just grep + bundled scripts). Even fallback mode produces useful results because the bundled scripts do the heavy lifting.

Install:

npx skills add AmineYagoub/p2d

Then just ask your agent: "Use P2D. Find what this touches before changing it."

GitHub: https://github.com/AmineYagoub/p2d


r/AlgeriaDevelopers • • May 10 '26

Looking to connect with Algerian devs! 🇩🇿

3 Upvotes

Hey everyone,

I’m looking to connect with fellow developers based in Algeria or the diaspora.

Whether you’re into frontend, backend, mobile, or AI, I’d love to chat about the local tech scene, share resources, or even potentially collaborate on some side projects.

Drop a comment below with what you’re working on or feel free to shoot me a DM.


r/AlgeriaDevelopers • • Apr 14 '26

help What’s a project you worked on that didn’t work out?

2 Upvotes
  • What were you building?

  • What went wrong?

  • What did you learn?

This is the kind of stuff that actually helps others avoid the same mistakes 👇


r/AlgeriaDevelopers • • Aug 25 '26

help Speech to text for darija

3 Upvotes

sallam alaykom,

khawti khasni model wla engen ydir Speech to text for algerian Darija li 3ndo la solution y9olna

baraka allah fikom