
edr replaces built-in file tools with ones that front-load context. Read a function — get its body plus what it calls. Edit code — get the updated function back. Orient in a codebase — get structure, not a file listing. Each response includes what the agent needs for its next decision, not just what it asked for.
focus file:Symbol — function body + dependency signatures. Not the 400-line file around it.
focus SymbolName — smart resolve: ranks matches, auto-opens the best one.
edit --old X --new Y — diff + updated function + build errors (with --verify).
orient — budget-controlled structural overview. Symbols, not filenames.
- Batch —
edr --focus file:Sym --edit --old X --new Y reads then edits in one call.
- Sessions — re-reads return
{unchanged}. The agent never processes the same content twice.
Works with any agent that can run shell commands. Fully local, no telemetry.
Install
brew install jordw/tap/edr
edr setup
edr setup installs agent instructions to your global config (~/.claude/CLAUDE.md, ~/.cursor/rules/edr.mdc, or ~/.codex/AGENTS.md). Instructions auto-update when edr is rebuilt. They teach the agent to use edr instead of built-in file tools. Session data is stored in ~/.edr/repos/, not in the project directory.
Other install methods
Pre-built binary (review the script first):
curl -fsSL https://raw.githubusercontent.com/jordw/edr/main/install.sh | sh
From source (requires Go 1.24+):
go install github.com/jordw/edr@latest
edr setup
Cloud agents and CI (installs Go if needed, builds):
git clone https://github.com/jordw/edr.git && ./edr/setup.sh
Example
Focus on a function, orient in the project, edit it:
# Without edr: grep to find it, read the range, grep for callers, read each caller
# 5+ tool calls, ~25KB of context
# With edr: 3 calls, ~3KB
edr focus src/scheduler.py:run # just the function (not the file)
edr orient --dir src/ # structural overview
edr edit src/scheduler.py \
--old "def run(self):" \
--new "def run(self, retries=3):" --verify
Batched: gather everything in one call, mutate in one call:
# 1. Focus on three APIs + orient, one call
edr -f src/scheduler.py:Scheduler --sig \
-f src/config.py:parse_config \
-f src/worker.py:Worker --sig \
-o --dir src/
# 2. Edit two files, verify at the end
edr -e src/scheduler.py --old "def run(self):" --new "def run(self, retries=3):" \
-e src/config.py --old '"timeout": 30' --new '"timeout": 30, "retries": 3'
How it works
edr parses files on demand with pure-Go regex-based symbol extraction — no pre-built index, no setup step, no staleness, no CGO dependency. This gives agents three capabilities they don't have with raw file tools:
Symbol-level operations. Focus on one function instead of a 400-line file — the agent sees exactly what it needs, makes better decisions, and doesn't get confused by surrounding code. Get a class API with --signatures to understand structure before diving in. --expand includes dep signatures inline. Scope edits to a symbol with --in Symbol so they can't match the wrong code. Use --verify to check the build after edits (Go, Node, Rust, Make).
Batching. -f, -o, -e combine focus, orient, and edit in one CLI call. One call to gather context, one to apply mutations. Fewer round-trips means faster task completion.
Sessions. edr tracks what the agent has already seen and only returns what changed. Second read of an unchanged file: zero output. Zero config.
Search index. edr index builds a trigram index that accelerates files, orient --grep, focus SymbolName, and text search. On the Linux kernel (93K files), indexed operations complete in 0.02-0.5s vs 3-4s without. The index builds incrementally in the background; edr index forces a full build. edr bench measures real performance on your repo.
Commands
Primary commands
| Command |
Description |
orient [path] |
Structural overview of a directory or project (replaces map) |
focus file[:Symbol] |
Read file or symbol with context (replaces read) |
edit file |
Edit, write, create files. --verify to check build. |
status |
Repo root, index coverage, undo, build state, warnings |
undo |
Revert last edit/write (auto-checkpointed) |
files "pattern" |
Find files containing text (trigram-accelerated) |
index |
Build or inspect the search index |
bench |
Benchmark operations on current repo |
setup |
Install agent instructions |
Old command names map and read still work as aliases for orient and focus.
Batch flags
Chain operations with --focus, --orient, --search, --edit, --write (short: -f -o -s -e -w). File carries forward. Edit includes read-back automatically.
edr --focus file:Sym --sig --orient cmd/
edr --focus file:Func --edit --old "x" --new "y"
edr --search "TODO" --include "*.go"
edr --focus file:Func --expand callers
Cross-repo targeting
edr focus file:Symbol --root /path/to/repo
export EDR_ROOT=/path/to/repo # set once, all commands use it
Batch modifiers
Focus (after -f): --sig, --skeleton, --full, --expand[=deps], --symbols, --lines 10:50, --budget N
Orient (after -o): --dir, --lang, --grep, --glob, --type, --budget N
Edit (after -e): --old "x" --new "y", --where Sym (resolves file), --in Sym (scope), --content "...", --inside Class, --after Sym, --append, --mkdir, --all, --delete, --dry-run, --fuzzy, --read-back, --no-verify, @file for metacharacters
Output uses plain mode: one JSON header line followed by raw-text body.
Languages
edr reads and edits any text file. Symbol-aware features (symbol reads, --signatures, map) require a supported language:
Symbol parsing: Go, Python, JavaScript/JSX, TypeScript/TSX, Rust, Java, C, C++, Ruby
Limitations
- Structural navigation, not code analysis. edr finds functions and classes by pattern, not by parsing or type-checking. This means it works instantly, on broken code, with zero config — but it does not have type information. It may miss unusual syntax (e.g. deeply nested anonymous functions).
- macOS and Linux only. Windows is not planned.
- Pure Go. No CGO, no C compiler needed. Single ~6MB binary.
How it compares
Without edr, agents grep to find code, read line ranges, guess what's relevant, edit, then re-read to check. Each step is a separate tool call with context the agent has to filter.
With edr, focus file:Symbol returns the function body plus what it calls. edit returns the updated code plus build errors with the broken function included. The agent makes fewer decisions about what to read because edr front-loads the right context.
| Operation |
What the agent gets |
focus file:Symbol |
Function body + dependency signatures (auto) |
edit --old X --new Y |
Diff + updated function body + build result + error context (auto) |
orient --dir src/ |
Budget-controlled structural overview |
Batch (-f ... -f ... -e ...) |
Multiple operations in one call |
| Re-read unchanged file |
{unchanged: true} (session dedup) |
License
MIT