llm-coding-agent
An LLM plugin that adds an interactive Claude Code-style coding agent with file and shell tools to the llm command line.
At a Glance
About llm-coding-agent
llm-coding-agent is an open-source Python plugin for Simon Willison's LLM tool. It adds an llm code command that starts an interactive coding agent session in the current directory, using any tool-capable model that LLM supports. It also exposes a Python CodingAgent class and a CodingTools toolbox.
What It Is
The project is a Claude Code-style coding agent built on top of LLM. The model can read, search and edit files under the session directory and run shell commands there. The README says the first working alpha was built from prompts given to a coding assistant, and installation currently requires the --pre flag because it depends on an LLM alpha release.
How the approval workflow works
Read-only tools run freely. File writes, edits and shell commands show what the model wants to do and ask for approval: y approves once, a approves similar actions for the rest of the session, and anything else declines, in which case the model is told and can try another approach. Options such as --yolo auto-approve every tool call, and --allow pre-approves matching commands. In-session commands include !quit, !yolo, !model MODEL and !tokens.
Tools and sandboxing
CodingTools is an llm.Toolbox confined to a root directory. It provides read_file (numbered lines, with offset and limit), write_file, edit_file (exact string replacement returning a unified diff), list_files, search_files (uses ripgrep when installed, otherwise a pure-Python fallback) and execute_command. Commands default to a 120-second timeout, capped at 600 seconds, and the whole process tree is killed on timeout with partial output returned. Paths that escape the root via .., absolute paths or symlinks return an error string instead of content.
Python API and logging
CodingAgent runs the full agent loop with a chain_limit (default 25). Its approve parameter accepts True, a callable, or None; with None the run pauses and agent.resume() continues it, which suits applications with no terminal attached. Sessions are logged to LLM's SQLite database, so llm logs shows full transcripts including tool calls, and conversations can be continued with llm code -c or --cid. The toolbox also works with llm chat --tool CodingTools.
Community Discussions
Be the first to start a conversation about llm-coding-agent
Share your experience with llm-coding-agent, ask questions, or help others learn from your insights.
Pricing
Open Source
Self-hosted llm-coding-agent plugin released under the Apache License 2.0. Model/API usage costs from third-party providers are separate.
- Apache License 2.0
- LLM plugin adding an `llm code` command
- Tools for reading, searching and editing files and running shell commands
- Python CodingAgent and CodingTools APIs
- Installable via pip (`pip install --pre llm-coding-agent`)
Capabilities
Key Features
- `llm code` interactive coding agent session
- Read, write, and exact-string edit files with unified diff output
- List and search files using ripgrep with Python fallback
- Execute shell commands with timeout and process-tree kill
- Per-action approval with session-wide approve, --yolo and --allow options
- Switch models mid-conversation with !model
- Sessions logged to LLM's SQLite database and resumable
- Python CodingAgent API with pause/resume approval flow and chain limit
- CodingTools toolbox usable with llm chat and llm prompt
- File access confined to a root directory