A Claude Code skill that sweeps your codebase for architecture-deepening opportunities (delta-aware, analysis-only) and files them as ready-to-grab issues

Reddit r/AI_Agents Tools

Summary

A Claude Code skill that autonomously scans codebases for architecture improvement opportunities (e.g., shallow modules), creates delta-aware, analysis-only issues and PRDs, ready for implementation.

I kept running the same manual ritual on my own repos: read through a subsystem looking for shallow pass-through modules, apply the *deletion test* ("if I deleted this, would complexity vanish or reappear across N callers?"), then write up the refactor as a self-contained ticket. It's the methodology from Ousterhout's *A Philosophy of Software Design* \+ Matt Pocock's `improve-codebase-architecture` skills — but doing it by hand across a whole codebase is tedious and easy to abandon halfway. So I turned it into a Claude Code skill that drives the **ralph** autonomous loop to do it for me. You run `/ralph-architecture-sweep` and it: * asks for **scope** — whole repo or a chosen subsystem/package/directory * forks a `ralph/*` worktree off your **remote default branch** (so it sees shipped refactors and won't re-find them — it's **delta-aware**) * sweeps for deepening candidates, **analysis-only**, one sub-agent per area * writes **vertical-slice issues** (deep module + every call site repointed + tests at the new interface + old copies deleted = one independently-grabbable ticket) plus a per-area PRD under `.scratch/` Nothing gets pushed — you review the issues before merging or implementing. Optionally you can chain ralph to actually implement them. One design detail I'm happy with: headless ralph only commits at the *end* of an iteration, so a long analysis call that drops loses everything. This skill drives the sweep via short sub-agents instead, so it's robust to that. Install is just `npx ralph-architecture-sweep` from your project root (or `--global`). MIT licensed. Curious whether others are automating the *analysis* side of refactoring rather than the implementation — and how you keep an agent from re-proposing decisions you've already made (I use ADRs as a no-go list).
Original Article

Similar Articles

How Claude Code works in large codebases

Hacker News Top

Anthropic's blog post details best practices for using Claude Code in large, complex codebases, explaining how agentic search and the 'harness' of extensions like CLAUDE.md files improve navigation and performance at scale.

multica-ai/andrej-karpathy-skills

GitHub Trending (daily)

A single CLAUDE.md file that implements four principles to improve Claude Code's coding behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.