agent-toolkit

Public

All in one

334 Downloads

1 star

1 fork

README

agent-toolkit

Turn a local model into a working coding agent. It reads and edits your code, runs your tests, remembers your project, uses git, searches the web and reads your documents. It all runs on your machine: no API keys, nothing uploaded.

Project home · What's new · Tips & tricks · Report a problem


At a glance

GroupDefaultIn one line
📁Files & ShellonRead, write and edit files, search the project, run commands
🧠Memory & ContextonRemember things between chats, follow your AGENTS.md, plan before changing
🌿Git & GitHubonStatus, diffs, commits, branches, pull requests and issues
🌐WeboffSearch, read pages and feeds, video transcripts, a real browser, research with sources
📄DocumentsoffRead PDFs, scans and images, look at pictures, write Word and PDF files
🧮UtilitiesoffExact arithmetic, and today's date and time

Each group is a switch in the plugin's settings. Leave on only what you need, because small models choose better from a short tool list. The tools' descriptions also take room on every message: with every group on, about 8,000 to 10,000 tokens depending on the model, half of a 16k context. /doctor shows the exact figure for your model.

Getting started

  • Load a tool-capable model, with 32k context or more.
  • Enable agent-toolkit in the chat. It's a chip under the message box.
  • Click the chip and set Project Folder to the folder you want the model to work in.
  • Ask for work, and approve each tool call as it comes.

Without a Project Folder, the model works in the chat's own empty folder and is told so.


📁 Files & Shell

ToolWhat it does
read_fileReads a file with line numbers; offset and limit page through big ones.
write_fileCreates or overwrites a file, or appends to it (to write a long file in parts).
edit_fileReplaces one exact piece of text. It must match once, so nothing else changes. If the text isn't found, it shows the closest lines.
multi_editSeveral replacements in one file; if any fails, none are written.
insert_linesInserts text after a line number.
undo_editPuts a file back as it was before the chat's last change to it.
list_dir · globList a folder, or find files by pattern.
grepSearches file contents, returning lines, just file names, or counts. Lines it shows can be edited straight away.
run_commandRuns a shell command and returns its real exit code and output. A command that gave the same output three times in a row isn't run a fourth time until something changes, so a model can't get stuck rerunning it.
shell_resetStarts the shell session afresh.
task_run · task_list · task_output · task_wait · task_stopRun dev servers, downloads and long builds in the background. task_wait waits for one to finish, or for a line in its output, without the model generating anything meanwhile.
diagnosticsRuns the project's own checkers: tsc, ESLint, Ruff, Pyright, cargo, go vet.
notebook_read · notebook_editRead and change Jupyter notebook cells. Off by default.
run_subagentAnswers a search-heavy question in a read-only helper agent. Off by default.
sqlite_queryShows a SQLite database's tables, or runs one read-only query. Off by default.

After every write or edit, a JavaScript, Python or JSON file is checked for syntax, and a problem is reported in the same result (Check Edits). Each of your messages is a checkpoint: /rewind puts files back (see Commands). Long command output is saved to a file and its path returned, so nothing is lost; a command that floods output keeps its first and last 2 million characters. A path that doesn't exist comes back with the likely one ("Did you mean: src/signup.js?"). grep gives the same results whether or not ripgrep is installed; ripgrep just makes it faster.

🧠 Memory & Context

Every new chat starts with today's date, your AGENTS.md (or CLAUDE.md), your saved memories, your skills and, in a git repository, the branch, uncommitted changes and recent commits.

ToolWhat it does
memory_save · memory_read · memory_search · memory_list · memory_deleteFacts that last between chats.
save_session_summarySaves where a long chat got to, so a new chat can pick it up.
todo_write · todo_readA todo list for work with several steps.
skill_list · skill_readYour skills: written instructions for kinds of task. skill_read also opens the other files in a skill's folder.
skill_saveLets the model save a new skill. Off by default.
chat_searchSearches your earlier LM Studio chats. Off by default.
enter_plan_mode · exit_plan_modePlan first: the tools that change files disappear until the plan is presented.
thinkA place for the model to reason between tool calls. For models without a thinking mode. Off by default.

Skills use the standard SKILL.md layout, the same as Claude Code, Codex and LM Studio Bionic. Point Skills Directory at ~/.lmstudio/skills or ~/.claude/skills and the skills you already have work here. Give a skill triggers: in its header, like triggers: [deploy, release notes], and its full text is added to any message that mentions one, once per chat. Small models rarely decide to load a skill on their own.

Commands

Start a message with a command and it becomes that command's instructions:

CommandWhat it does
/reviewReviews the uncommitted changes for bugs, security problems and missing tests, without changing anything.
/testRuns the tests and fixes the code until they pass.
/commitCommits related changes with a clear message. Never pushes.
/initWrites an AGENTS.md for the project, or improves the one there.
/rewindLists your messages that changed files; /rewind 3 puts every file back to how it was before message 3. Changes made by shell commands aren't tracked.
/handoffHas the model write down where the work stands (goal, what's done, current state, decisions, open problems, next steps) and save it to .agent-toolkit/handoff.md.
/resumeIn a new chat: loads that note, so the model carries on where the old chat left off.
/doctorChecks this chat's setup and says what to fix: how much of the context the tools take, tools offered by two plugins, whether agent-toolkit-loop runs the reply, the Project Folder, and the programs the enabled groups need. It changes nothing, though measuring the tools has every enabled plugin build them, as a reply does.
/helpLists the commands.

Anything after the command goes along: /review focus on the parser. A project can add its own as .agent-toolkit/commands/<name>.md, with $ARGUMENTS where your words go and an optional description: header. A project's command can't take the name of a built-in one. Those are scanned like AGENTS.md, since a cloned repository can ship them.

A long chat gets slower with every message. When it does, type /handoff, start a new chat in the same Project Folder, and type /resume. The note is kept in the project, so both chats need the same Project Folder. It's loaded as information from an earlier chat, not as instructions, and it's scanned and has its secrets hidden like other loaded files. /btw belongs to agent-toolkit-loop.

🌿 Git & GitHub

ToolWhat it does
git_status · git_diff · git_log · git_showSee what changed, and when.
git_add · git_commit · git_branch · git_initStage, commit, branch, start a repository.
git_pushPushes the current branch. Off by default, and never forced.
gh_pr_list · gh_pr_view · gh_pr_diff · gh_pr_checks · gh_pr_createPull requests, through the GitHub CLI.
gh_issue_list · gh_issue_viewIssues.

git and gh run directly, never through a shell. The gh_* tools appear once gh is installed and logged in.

🌐 Web

ToolWhat it does
web_searchSearches the web through your SearXNG, DuckDuckGo or Brave. Repeat searches are answered from a short cache; page asks for more results.
fetch_urlReads a page as clean markdown, or a PDF page by page. Give it a CSS selector to read just one part, like a single table.
read_feedThe latest items of an RSS or Atom feed. A site's home page works too.
video_transcriptWhat's said in a YouTube or other video, through yt-dlp.
browser_open · browser_click · browser_type · browser_back · browser_snapshot · browser_screenshot · browser_closeDrives your own Edge or Chrome. Pages run their JavaScript, and the model clicks by number.
wikipediaFinds a Wikipedia article and returns its text, in any language edition.
web_doctorChecks what's set up (SearXNG, the browser, yt-dlp) and says how to fix what isn't. Also says when a newer agent-toolkit release is out.
researchAnswers a question from several pages, with a numbered source for each claim. Off by default.

research searches with a few queries, reads up to five pages and has the model note what each says about the question, then writes the answer from those notes alone. Each step is a small, single question, which small models handle well. Citations of sources that don't exist are removed, and the answer says when it cites nothing. It takes a minute or so of generation, on the first loaded model or the Research Model you choose. Its answers are only as good as the search behind them, so it works best with SearXNG or Brave.

Search works best with a private SearXNG. Without one it falls back to DuckDuckGo, which answers a couple of searches and then turns automated requests away for a while; the toolkit spaces its requests out and pauses for two minutes once refused. More result pages need SearXNG or Brave. video_transcript appears once yt-dlp is installed.

read_feed, video_transcript and fetch_url also come as small plugins of their own: feed-reader, video-transcripts and page-reader.

📄 Documents

Your chat model doesn't need vision. A PDF's text is read without any model, and OCR and view_image use a separate vision model only when a page or picture has to be looked at.

ToolWhat it does
read_document_textReads a PDF's text, and says when a page looks scanned.
ocr_documentReads a scanned PDF or an image with a vision model.
view_imageLooks at a picture, from your folder or a web address, and describes it or answers a question about it.
pdf_to_imagesSaves PDF pages as images.
write_documentWrites the model's answer as a Word (.docx) or PDF file in your folder.

PDF output is printed by your own Edge or Chrome, with scripts off and no network access, so it needs one of them installed; Word output needs nothing. Pictures are left out of both, and the tool says how many.

🧮 Utilities

Small models guess at sums and don't know what day it is. These two tools give them the right answer.

ToolWhat it does
calculateWorks out an arithmetic expression exactly: 15% of 240, sqrt(2) * 10^3, 12!.
current_timeToday's date, the time and the week number, in your time zone or any other.

Settings

Everywhere

SettingDefault
Project Folder(empty)The folder every group works in.
Max Output Characters20000Longer results keep their beginning and end.
Redact SecretsonHides API keys, tokens and private keys in what tools return. Your files are never changed.
Read Attached FilesonPuts the text of a PDF, Word or text file you attach to a message into that message.
Max Attachment Characters40000How much of it; never more than half of what the chat's model has left.
Commandson/review, /test, /commit, /init, /handoff, /resume, /doctor, /help, and the project's own.

Attached files. Attach a document to a message and ask about it: its text goes into the message, so "summarize this" means the document. A long one is cut at the limit, and the model is told how to read the rest; a scanned PDF is read with ocr_document. The tools can open what you attached in that chat by its name, and nothing else from LM Studio's own folder. LM Studio's RAG plugin reads attachments too: use one of the two in a chat, not both.

Files & Shell

SettingDefault
Allow Shell CommandsonOffers run_command.
ShellautoPowerShell on Windows, bash elsewhere.
Default Command Timeout60 sThe model can ask for up to ten times this.
Extra Blocked Command Patterns(none)Your own patterns to refuse.
Persistent Shell Sessiononcd and variables carry over between commands.
Max Read Bytes256 KBBigger files are read in parts.
Background Tasks · Diagnostics · Checkpoints · Check Editson
Jupyter Notebook Tools · Research Sub-agent · SQLite Tooloff
Sub-agent ModelAutoChosen from a list of your models.

Memory & Context

SettingDefault
Instruction FilesAGENTS.md, CLAUDE.md, .lmstudio/instructions.mdLoaded into each new chat.
Inject Memory Index · Git Snapshot · Skills · Plan Modeon
Scan Loaded FilesonLeaves out files written to steer the model.
Let the Model Save Skills · Search Past Chats · Think Tooloff
Max Injected Characters12000

Git & GitHub: Allow Push (off) · Enable GitHub Tools (on).

Web: Search Backend (auto) · Brave Search API Key (needed for brave) · SearXNG URL (http://localhost:8888) · Safe Search (moderate) · Default Search Results (8) · Max Page Characters (15000) · Browser Fallback (on) · Enable Browser Tools (on) · Browser (Edge on Windows, Chrome elsewhere) · Headless (on) · Research (off) · Research Model (Auto, chosen from your models).

Documents: Vision Model (Auto, chosen from your models) · PDF Render Scale (2) · Max Pages Per Call (10).

Shared by every chat: Memory Directory · Skills Directory.

Safety

Approving a tool call is the same as running that command yourself, so keep LM Studio's confirmation on.

  • Stays in the Project Folder. File paths can't leave it, not even through links.
  • Reads before it edits. A file must be read before it's changed, and the change is refused if the file changed in the meantime.
  • Never half-writes a file. Writes go to a temporary file first, then replace the original.
  • Refuses disasters. rm -rf /, format C:, diskpart and similar are blocked. This is a seatbelt, not a sandbox.
  • Risky things are opt-in. Pushing, saving skills and searching past chats are off until you switch them on.
  • Checks what it loads. An AGENTS.md or skill that tries to steer the model ("ignore previous instructions", hidden characters, sending keys away) is left out, and you're shown why.

MIT licensed · Source · Security