5 ms·
One of the main reasons why code is often hard to understand is that it doesn't actually do what it appears to do unless you get in and read the code in depth.
by onion2k 1y ago
One of the main reasons why code is often hard to understand is that it doesn't actually do what it appears to do unless you get in and read the code in depth. It looks like skim is making an assumption that would make this happen a lot - that the code doesn't rely on side effects (modifying a global, using exceptions to control flow, throwing an event on a bus for something else to pick up, etc.)
I imagine this is a really useful tool for a codebase built on pure functions, but it'll get very confused by legacy code that hasn't been written without that goal.
- dean0x 1y agoThats a great point, thank you. I use it mostly to get my agent oriented in the beginning of a task. Been using it for the last couple of weeks and I seem to get better results, less code duplication, and better integrated features. I still need to reference specific files I want the agent to work on.
- onion2k 1y agoI suspect, but will probably never find the time to try, that you could build an AST from the source, discard the bits that are just the internals of functions and methods, and then turn what remains back into something an LLM could use.
- dean0x 1y agojust plug this in to your CLAUDE.md or AGENTS.md ;) ## Codebase Analysis **Before analyzing unfamiliar codebases**, use skim for efficient context: ```bash # Get architectural overview (60% reduction) skim src/ --mode structure # Get API surface (88% reduction) skim src/ --mode signatures # Get type system (91% reduction) skim src/ --mode types When to use: - First time exploring a repository - Understanding service architecture - Mapping API boundaries - Analyzing type relationships Install: npm install -g rskim or cargo install rskim