This project is a minimal agent-based AI code editor inspired by the “How to Build an Agent – Amp” article.
- Stateless LLM interaction with explicit, externalized conversation memory
- Agent loop: LLM generates tool requests, which are executed, then the results returned to the LLM
- Clear separation between tool schemas (for LLM) and actual execution (in Node.js)
- Safe local filesystem tools (reading, listing, writing files) with strong sandboxing—no access above project root
- Model-agnostic pattern (current code uses Anthropic Claude, but OpenAI/Gemini integration possible)
- Not a Cursor clone or production code editor
- No user interface or editor integration (CLI-only for now)
- Focuses strictly on agent flow and core mechanics—no UI polish
app.js– Handles the agent loop, conversation context, user input, and LLM callstools.js– Defines tool schemas and their guarded execution logic (read, list, write files)- The LLM treats every message statelessly—full context is passed each time, so all memory is explicit
read_file— Reads a file’s contents (relative path, sandboxed)list_files— Lists files and folders at a path (defaults to current directory, sandboxed)edit_file— Safely edits files via exact string replacement (delta-based, sandboxed)search_code— Recursively searches the codebase for a given string and returns file/line matches
- Diff-based editing (
apply_diff) - More code-editing and analysis utilities
This project is intentionally minimal and focused on demonstrating agent mechanics and safe tool usage, in line with the referenced article and for learning purposes. The goal is to iteratively expand and improve its capabilities while keeping safety and clarity as top priorities.