Armitage
Armitage is an agent toolkit (CLI, skillset, a custom Pi harness and a Claude Code plugin). The model answers from three sources you choose: your Zotero library, a Markdown memory and your workspace code. It runs in the terminal, in Zed or in Claude Code. In Pi and Zed the role you pick sets the workflow: SWE (coder, architect, devops, debug), Tutor or Researcher. Every answer cites its sources, with links that open the Zotero item or the code file at the right page or line.
I built Armitage mostly with AI coding agents, to help me develop Nodens and Nyar. It is a personal, experimental project, and agent tooling is outside my area of expertise.
What it does
PiACPClaude Code
Six rules the agent works under, each one checked by the tools, not left to the model.
- 01Citations
Every claim has a source
Claude Code audits the reply after it is written.
Each factual claim carries a footnote. A check confirms that the file and line, or the Zotero page, exist and that the agent looked them up this session. A source the model only remembers is refused.
- 02Memory
Notes keep the source's words
A finding is stored as a quote with a link to its page. The quote is checked against the file, even with Zotero closed.
- 03Search
Search runs on your machine
Embeddings, keyword search and reranking all run locally, on a modest GPU.
- 04Research
A study starts with your approval
Claude Code runs it from
/armitage:research.A research plan waits for you. A report is refused unless every analysis paragraph cites a page or is marked Inference.
- 05Design
A big change starts with a design
The architect and coder roles exist only in Pi and ACP; in Claude Code the model follows the skill.
Before a large code change it writes a design and asks its open questions. The plan cannot be approved while one is unanswered. It is then built one phase at a time, and you commit each phase.
- 06Decisions
What you settle is kept
When you settle something, it is recorded in your words and loaded into every later session.
Built around Zotero, Zed and Pi
Three native integrations. Zed and the terminal both run on Pi.
- Pi
The agent harness and terminal UI
Pi
Armitage is built on Pi.
armitage agent piopens Pi with Armitage's own interface: a header board, a status footer and a plan docked above the input. Tool calls fold to one row,ctrl+oexpands them, and/prefschanges the role and settings. - Zotero
Your library is the source
PiACPClaude Code
Armitage reads Zotero 7+ through its local API and never writes to it. It reads PDFs page by page (with OCR for scans), EPUBs by chapter and saved web pages by section. Every citation opens at the exact page or passage. A list of collections and items you want left out keeps them out of the index and its answers.
- Zed
Native in the Agent Panel
ACP
A custom ACP adapter on top of Pi runs the same agent, roles and gate as the terminal. Questions and approvals appear as native cards, and a code citation opens the file at the cited line.
The CLI
PiACPClaude Code
It also works on its own.
The base the rest builds on. armitage owns the memory vault, the Zotero and code
indexes, plans and artifacts, and it works on its own, with no Pi, Zed or Claude Code. It never
writes a claim: agents call it, and the harness checks what they cite. The agent is a second
package that adds armitage agent.
What else it does
Features beyond answering a question from the three sources.
- Figures
It can look at a figure
PiACP
Claude Code gets the figure markers in the text, and
armitage zotero figurereturns the image as JSON text.A PDF page that holds a figure ends with a marker, and an EPUB marks its images in the text. The agent can ask for one figure as an image. A model that cannot read images says so, and you choose whether OCR describes the figure instead.
- Web
Web pages from hosts you list
PiACPClaude Code
Claude Code runs
armitage web fetchunder its own permissions.The agent fetches only from hosts you allow, or ones you approve on first use. Requests are https and GET only, every redirect is checked against the list, and a fetched page can be cited by its address.
- Artifacts
Files you can keep or send
PiACPClaude Code
It writes a Markdown document, a LaTeX document built to PDF, or an interactive tool as one HTML file. Builds run offline in a sandbox, and each reference in the sources list opens its file, page or note.
- Quiz
A quiz before a large commit
PiACPClaude Code
Before it commits or pushes 20 or more changed lines of code, the agent asks whether you want to be quizzed on them. It is a recommendation, never a gate, and you can turn it off.
- Bibliography
Entries with the printed page
PiACPClaude Code
armitage zotero bibprints a work's bibliographic entry for a document you are writing. The page comes from the PDF's page labels, so a PDF index is never cited as a page. - Upkeep
Keeps the memory and the docs honest
PiACPClaude Code
armitage memory lintchecks the vault, andcurateproposes fixes without writing them.armitage docs stalelists docs that describe code changed since they were written. - Status
One read-only view of its state
PiACPClaude Code
armitage statusreports the index, memory, plans, drafts, Zotero collections and code indexes in one call, as a table or JSON. The Armitage Dashboard, a separate app, reads it.
Ways to use it
Four ways to run the same skills and the same citation gate. Pick the one that matches the tool you already work in. The CLI underneath is the same in all of them.
| ACP (Zed) | A custom ACP adapter runs Pi in Zed's Agent Panel. Needs Pi. The most thoroughly tested way. |
| Pi (terminal) | armitage agent pi opens Pi with Armitage's own terminal UI, and armitage agent ask answers one question. Needs Pi. |
| Claude Code | A plugin adds the skills, the Armitage output style and the checks to Claude Code. No Pi. |
| Another agent | armitage agent install skills copies the skills to a folder you can point any coding agent at, and the CLI does the rest. No Pi, and no automatic citation checks. |
Every section and item on this page is tagged with the ways that have it. This table sums up the main differences.
| Feature | Pi | ACP | Claude Code |
|---|---|---|---|
| The CLI, the skills and the memory | ✓ | ✓ | ✓ |
| Memory sweep before the first factual question | ✓ | ✓ | ✓ |
| Citation audit of each answer | ✓ | ✓ | ✓ |
| Quiz before a large commit | ✓ | ✓ | ✓ |
| Web pages from hosts you list | ✓ | ✓ | ✓ |
| The answer as a form with numbered references | ✓ | ✓ | – |
| Roles | ✓ | ✓ | – |
| Sandboxed shell, file guard and protected rules | ✓ | ✓ | – |
| Armitage's permission levels | ✓ | ✓ | – |
| Figures as images | ✓ | ✓ | – |
| Terminal UI: header, footer, plan dock | ✓ | – | – |
| Native cards and the role selector in Zed | – | ✓ | – |
Pi · terminal · armitage agent pi and armitage agent ask · needs Pi
Choose this to work in a terminal. It is a dedicated Pi environment with Armitage's own interface, and the same agent that runs in Zed. Roles, the sandbox, the permission prompts and the citation gate all apply.
◈ armitage chief librarian of the archives ledger 214 notes · 3 active plans · 5 concepts waiting archive 9 of 12 collections indexed keys alt+t thoughts · / commands · /prefs Which skills does the swe-devops role load? ◈ memory sweep → 3 rows from 2 notes deliberating… The role file names them. Checking how they are loaded. ✓ read “agent/src/armitage_agent/pi/roles/swe-devops.md” → 39 lines 0.1s ✓ grep “hiddenChargeBodies” → 2 matches 0.1s ✓ tasks set → 3/3 complete swe-devops loads armitage-maintain and work-patterns.[^1] A skill the model can already start stays a pointer that it loads when needed. Only a skill the model cannot start has its text added to the prompt.[^2] [^1] agent/src/armitage_agent/pi/roles/swe-devops.md:7 [^2] agent/src/armitage_agent/pi/extensions/armitage-role.ts:149 ── Plan 3/3 ██████████alt+o ── ✓ 1. read the role file ✓ 2. check how charged skills are loaded ✓ 3. answer with the two citations ~/miskatonic/armitage (main) • role skillsdeepseek-v4.1-flash • highsessionrole autoaccess read-writepermission riskygate enforcebwrap (no net)repliescaveman fullthoughts hidecoauthor oncompact neverzotero ● ollama ● context ██████████████░░░░░░░░░░░░░░░░░░░░░░░░░░ 35.0% 350k/1.0M ■ tool output 29% 102k ■ thinking 17% 60k ■ system prompt 14% 49k ■ tool definitions 12% 42k ■ user 10% 35k ■ assistant 10% 35k ■ tool calls 6% 21k ■ summaries 2% 7.0k
Quick questions with armitage agent ask · Pi only
The same interface for a one-off question with no project: a short, cited
answer from Zotero and memory, using the read-only ask role.
ACP · Zed · custom adapter · needs Pi · the best way
Choose this to work inside the editor. Armitage's ACP adapter runs the same Pi agent in Zed's Agent Panel, with the same roles, sandbox and gate as the terminal. Questions and approvals appear as native cards, and a code citation opens the file at the cited line.
Memory has the answer but marks it stale, so I rechecked it against the docs and code, and it still holds. The reranker is loaded for one query and then released, and the query path unloads the embedding model first, so the two never sit in VRAM together.1
In code, Reranker is a context manager whose __exit__ calls close().2 That moves the model off the GPU and empties the CUDA cache.3
docs/03-retrieval-pipeline.md:208src/armitage_cli/retriever.py:207src/armitage_cli/retriever.py:302
Claude Code · plugin · armitage agent install claude-code · no Pi
Choose this to stay in Claude Code. It installs the skills and an Armitage
output style. Before a factual question it recalls from memory, and it checks each footnote in
the reply against the files and Zotero. It refuses shell edits in favour of Claude Code's own
edit tools, and the references close each answer under a rule, with a link for every file.
There are no roles and no sandbox of Armitage's own: Claude Code's permissions apply, and the
tutor is a skill, /armitage:tutor.
Another agent · armitage agent install skills · no Pi
Choose this for any other coding agent that reads skills. The skills
go to ~/.armitage/agent/skills by default, and the agent gets the instructions and
the CLI. The mechanical citation checks and the sandbox come only with Pi or
the Claude Code plugin.
How a question is answered
PiACPClaude Code
One search across memory, code and papers, then four steps to an answer with a source for every claim.
- 1
Ask: One question
A single query searches memory, papers and code at once (
armitage search). -
-
Memory
The agent's notes, kept as Markdown in an Obsidian vault.
-
Papers, books & web
Your read-only Zotero 7+ library: PDFs, EPUBs and saved web pages.
-
Code
An index of your repositories. Symbol lookups need no AI model.
-
Memory
- 2
Match: Meaning + keywords
Embedding search (Ollama) finds passages by meaning; SQLite full-text search finds exact words.
- 3
Rank: Best passages first
Matches from all sources are merged, then a reranking model (Qwen3) puts the most relevant first.
- 4
Cite: Every claim sourced
Each factual statement carries an inline
[^n]footnote to its source.
How a claim earns its source
What happens between your question and a cited answer.
- 1
Sweep
PiACPClaude Code
A hook runs it in Claude Code.
On your first fact-bearing question, it recalls related memory, plans, code or literature in about three seconds.
- 2
Look up
PiACPClaude Code
The agent reads the code or queries Zotero, so claims rest on sources, not on what the model remembers.
- 3
Answer
PiACP
Claude Code has no form: the model writes the footnotes in the reply, under a rule and a References heading.
Factual answers use a form with claims and their references, not free prose.
- 4
Audit
PiACPClaude Code
Claude Code audits only turns about memory, literature, plans or your earlier work.
Each footnote is checked: the file and line exist and were read, or the Zotero item was returned this session and the page exists.
- 5
Correct
PiACPClaude Code
Claude Code asks for the fix once per prompt, then lets the reply stand.
A failed check sends the agent back once to fix the problems it names. If the fixed answer still fails, the answer is flagged with a visible warning.
What it remembers
PiACPClaude Code
Plain Markdown in a vault on your disk. Obsidian is optional.
- Notes and concepts
Notes that point to the source
The source's exact words, linked to the page.
- Research
Plans and reports
Approved plans and cited reports that later sessions can find.
- Design plans
The reasoning behind a change
The goal, decisions, architecture and open questions of a big change.
- Decisions
What you settled
Your decision, the reason and your own words. Changed only by being superseded or revoked.
- Profile
Your profile
The shell guard that protects it is Pi and ACP only.
Preferences, corrections, goals and dated events. The shell cannot rewrite it.
Roles
PiACP
Claude Code has no roles: it has the skills, and /armitage:tutor teaches.
Each role loads the skills it needs and adds a workflow drawn from the literature, cited by
page. It also sets what Armitage may touch. Pick one with /role; only you can
switch it. Pick the role for the kind of work and its skills come with it. Every other
skill stays available in every role: the model loads it when the task matches, and you can
also type it by name. Outside Pi there are no roles, only skills.
Can edit your files
- Default
auto
Reads your request and chooses how to work: answer, investigate, plan, implement or teach.
- Builder
swe-coder
Builds one phase of an approved plan, proves it with tests and its docs, then stops so you can commit it. Never commits itself. Skills:
armitage-swe,work-patterns. - Delivery
swe-devops
Handles CI/CD, releases, versioning and git, and groups the phase commits before a push. Writes no application code, and confirms before any commit, push, tag or deploy. Skills:
armitage-maintain,work-patterns.
Read-only: cannot change your files
- Quick questions
ask
Short, cited answers from Zotero and memory.
armitage agent asklocks this role. - Research
researcher
Plans a study from your Zotero library, waits for approval, then reports with the exact page behind each claim. Skills:
armitage-research,armitage-consolidate,armitage-learn. - Teaching
tutor
Teaches a concept or guides an implementation so you can do it alone. Never writes your code. Skills:
armitage-tutor. - Design
swe-architect
Designs a feature, then reviews each finished phase against the plan: on plan, fixable, or the plan is wrong. Names the trade-offs. Skills:
armitage-swe,work-patterns,caveman-review. - Diagnosis
swe-debug
Finds why something fails before any edit and hands you an evidence-backed cause. Skills:
work-patterns.
Staying in control
The agent has a shell and your notes, so it is contained in layers. The sandbox is not perfect isolation; the project documents its known limits.
Contains the agent
- Shell
Sandboxed commands
PiACP
Runs in bubblewrap with no network and SSH, AWS and GPG folders hidden. Each command starts with a clean environment, so an exported key is not visible to it, and runs under caps on tasks and memory. Without the sandbox, the shell refuses to run.
- Files
File-tool guard
PiACP
Claude Code uses its own file permissions.
Writes outside the workspace are refused, and reads outside it ask you first. Images in what the model writes are replaced by a marker, so a client cannot be made to fetch an address that carries what the agent read, and approval dialogs spell out invisible characters.
- Rules
Protected rules
PiACP
Skills, persona and your profile are read-only to the agent, so it cannot widen its own sandbox.
- Models
Local search, your choice of chat model
PiACPClaude Code
The search is local in all three. Pi and ACP use any chat provider you configure; Claude Code uses Claude.
Embeddings and reranking run on a local Ollama, and the CLI refuses a remote Ollama host unless you opt in, so your library is never sent to a search service. The chat model is separate: Pi uses whichever provider you configure, hosted or local. Passages the agent reads are sent to that provider like any other prompt.
Keeps you in charge
- Commands
Permission prompts
PiACP
Claude Code uses its own permissions, and approves read-only
armitagecommands without a prompt.Commands ask before running: all, only risky ones, or none, with per-command allow and deny rules. The TUI footer always shows the current level.
- Roles
Read-only roles
PiACP
The researcher, tutor, architect and debug roles cannot change your files. Their builds and tests run in a throwaway overlay.
- Library
Zotero untouched
PiACPClaude Code
Armitage never writes to Zotero. The one opt-in OCR option rewrites a PDF and keeps the original.
- GitHub
Its own GitHub login, optional
PiACPClaude Code
Issues change only after you approve each one, through a login kept apart from your own
ghlogin. With a bot account, agent-written issues are recognisable on GitHub, at the cost of a second account to set up and secure. With a scoped token of your own account, setup is lighter, but the issues appear under your name. Without a login, the agent writes the text and you file it.
The skills
PiACPClaude Code
Claude Code names them /armitage:<name>, without the armitage- prefix, and no role loads them.
Instructions the agent follows, which the roles build on. They are grouped by who can start them. A role loads the skills it needs for you, so you start a skill by hand only when no role covers it.
Only you start these
The agent cannot start these. The researcher and tutor roles load theirs for you.
| armitage-research | Plans the research, waits for your approval, reads each source, and reports with the exact Zotero page behind every finding. |
| armitage-tutor | Teaches you step by step instead of just writing the answer, grounded in your code, notes and papers. |
You or the agent
Type them by name, or the agent loads them when the task matches.
| armitage-init | Starts or resumes a session: recalls prior work, attaches the right project and plan, then routes to the next skill. |
| armitage-project | Keeps a project file for a bigger goal: aims, ideas, open questions, decisions and its plans. |
| armitage-plan | Keeps a plan for one piece of work, with checkpoints so a later session can pick up where you left off. |
| armitage-consolidate | Turns an approved research report into linked memory notes and an Obsidian canvas. |
| armitage-maintain | Advice on versioning, git workflow, changelogs, releases and roadmaps, based on the repository's real state. |
| armitage-help | Shows the quick-reference card for all the skills. |
The agent starts these
The agent loads them when the task matches.
| armitage | The citation gate. Searches memory, code and papers before a factual answer and cites every claim. An unsourced claim is cut or marked unverified. |
| armitage-swe | Before a big change (over 3 files or 80 lines, a new feature, a migration), writes a design plan and implements only after you approve. |
| armitage-artifact | Builds a file you asked for: a Markdown document, a LaTeX document as PDF, or an interactive tool as one HTML file, built offline in a sandbox. |
| armitage-github | Writes, searches and triages GitHub issues through the agent's own login. Nothing is sent until you approve. |
| armitage-learn | Saves findings as citation-backed notes so later sessions can recall them. |
| armitage-decide | Records what you settle ("never X", "keep Y") with the reason and your words, so no later session proposes the opposite. |
| armitage-user | Maintains your profile: preferences, corrections, goals and deadlines. |
| armitage-obsidian | Formats notes for Obsidian and builds tables, boards and canvas maps of the memory on request. |
Also bundled from the Caveman project (MIT), outside the citation system:
work-patterns (working habits such as investigate-first and surgical-patch),
caveman, caveman-commit and caveman-review.