This guide explains how to lawfully study, reuse, adapt, and “plunder” useful architecture from Aider for your own Apache-2.0 CLI project.
Aider is an open-source AI pair-programming tool that runs in the terminal, edits files in a local Git repo, maps the codebase, applies changes, runs tests/linters, supports many LLM providers, and can be scripted from the command line or Python. (GitHub)
This is practical open-source hygiene, not legal advice.
Aider is licensed under Apache License 2.0, so it is in the same broad license family as the other lawful plunder targets we have been mapping. GitHub lists the repo as Apache-2.0 licensed, and the Aider FAQ says Aider is open source on GitHub under Apache 2.0. (GitHub)
Apache-2.0 generally allows you to:
- copy code
- modify code
- redistribute modified versions
- use it commercially
- merge useful portions into your own Apache-2.0 project
- build derivative systems from adapted pieces
But you must preserve required license and attribution notices, mark modified files, and avoid implying that your project is official Aider branding. The Apache-2.0 text also makes clear that trademark rights are not granted except as needed for normal attribution. (GitHub)
Take the useful steel. Keep the maker’s mark. Forge your own blade.
Use these as canonical upstream references in your repo docs.
- Aider GitHub Repository — main source repo. (GitHub)
- Aider License — Apache License 2.0 text. (GitHub)
- Aider Documentation Home — full docs index. (Aider)
- Configuration Docs — command-line options,
.aider.conf.yml, environment variables, and.envsupport. (Aider) - In-Chat Commands —
/add,/ask,/architect,/run,/test,/map,/undo,/web, etc. (Aider) - Repository Map Docs — concise whole-repo symbol map and graph-ranking optimization. (Aider)
- Edit Formats Docs —
whole,diff,diff-fenced,udiff, editor formats. (Aider) - Linting and Testing Docs — automatic lint/test repair loops. (Aider)
- Scripting Docs — one-shot
--message, command-line scripting, Python scripting. (Aider) - IDE Watch Mode Docs —
--watch-filesandAI!/AI?trigger comments. (Aider) - Coding Conventions Docs — read-only convention files such as
CONVENTIONS.md. (Aider) - Model Aliases Docs — model aliasing from CLI/config and priority rules. (Aider)
- FAQ — open-source/license note and scripting reference. (Aider)
Your project should include:
LICENSE
Use Apache License 2.0 if your project is already Apache-2.0.
Apache-2.0 requires redistributed derivative works to provide the license, preserve applicable notices, and mark modified files. (GitHub)
When copying files or meaningful chunks from Aider:
- preserve upstream copyright/license headers
- preserve SPDX headers if present
- preserve notices in copied files
- do not remove references to Aider upstream authorship
- do not claim copied code was written entirely from scratch
Suggested Python header:
# Portions adapted from Aider-AI/aider.
# Upstream project: Aider, licensed under Apache License 2.0.
# Modified by Volmarr / RuneForgeAI, 2026.
# Licensed under the Apache License, Version 2.0.Suggested Markdown header:
<!--
Portions adapted from Aider-AI/aider.
Upstream project: Aider, licensed under Apache License 2.0.
Modified by Volmarr / RuneForgeAI, 2026.
Licensed under the Apache License, Version 2.0.
-->Recommended repo files:
LICENSE
NOTICE
THIRD_PARTY_NOTICES.md
docs/plunder/AIDER_PLUNDER_GUIDE.md
docs/plunder/AIDER_PLUNDER_MAP.md
Suggested NOTICE:
# NOTICE
[Your CLI Project Name]
Copyright 2026 Volmarr / RuneForgeAI
This project is licensed under the Apache License, Version 2.0.
This project includes or adapts selected portions of software from:
## Aider
Project: Aider
Repository: Aider-AI/aider
License: Apache License 2.0
Aider is an open-source AI pair-programming tool for the terminal.
This project is independent and is not affiliated with, endorsed by, or sponsored by Aider AI LLC, Aider-AI, or the Aider project.Suggested THIRD_PARTY_NOTICES.md:
# Third-Party Notices
This project includes or adapts material from third-party open-source projects.
## Aider
Project: Aider
Repository: Aider-AI/aider
License: Apache License 2.0
Usage:
This project may include or adapt selected portions of Aider, especially architectural patterns related to:
- terminal AI pair programming
- Git-aware editing
- repository maps
- search/replace edit blocks
- unified diff edit formats
- model-specific edit formats
- chat command routing
- automatic commits
- lint/test repair loops
- scripting mode
- file watch mode
- coding convention files
- model aliases
- multi-provider LLM configuration
- browser/web scraping context
- chat history handling
- patch and diff utilities
This project is independent and is not affiliated with, endorsed by, or sponsored by Aider AI LLC, Aider-AI, or the Aider project.Apache-2.0 lets you reuse code. It does not let you steal the project’s identity.
Safe wording:
This project includes code adapted from Aider-AI/aider.Unsafe wording:
This is the official Aider CLI.Avoid names like:
- Official Aider Fork
- Aider Pro
- Aider Code Agent
- Aider Mythic Edition
- Aider AI Official CLI
Use “Aider” only for attribution and source description.
Aider is primarily a Python project. The root repo has major areas including .github, aider, benchmark, docker, requirements, scripts, and tests; GitHub currently shows a large history, many stars/forks, and an active issue/PR ecosystem. (GitHub)
The most important source directory is:
aider/
The aider/ package includes major files and folders such as:
aider/
coders/
queries/
resources/
website/
__main__.py
analytics.py
args.py
commands.py
diffs.py
editor.py
history.py
io.py
linter.py
llm.py
main.py
models.py
openrouter.py
prompts.py
repo.py
repomap.py
run_cmd.py
scrape.py
sendchat.py
urls.py
utils.py
voice.py
watch.py
watch_prompts.py
The visible repo tree confirms the presence of these core files, including commands.py, linter.py, llm.py, main.py, models.py, repo.py, repomap.py, run_cmd.py, scrape.py, sendchat.py, voice.py, and watch.py. (GitHub)
This is probably the richest directory to study.
The aider/coders/ directory contains multiple coder implementations and prompt files, including architect mode, ask mode, context mode, edit block formats, fenced edit blocks, patch mode, search/replace, unified diff, and whole-file editing. (GitHub)
Likely valuable files:
aider/coders/base_coder.py
aider/coders/base_prompts.py
aider/coders/architect_coder.py
aider/coders/architect_prompts.py
aider/coders/ask_coder.py
aider/coders/context_coder.py
aider/coders/editblock_coder.py
aider/coders/editblock_prompts.py
aider/coders/search_replace.py
aider/coders/patch_coder.py
aider/coders/patch_prompts.py
aider/coders/udiff_coder.py
aider/coders/udiff_prompts.py
aider/coders/wholefile_coder.py
aider/coders/wholefile_prompts.py
Aider’s edit-format design is one of its biggest treasures. It supports multiple edit formats because different model families follow different editing instructions with different reliability. The docs describe whole, diff, diff-fenced, udiff, and editor-specific variants. (Aider)
mythic_cli/coders/
base_coder.py
architect_coder.py
ask_coder.py
patch_coder.py
search_replace_coder.py
unified_diff_coder.py
whole_file_coder.py
prompts/
Design law:
## Edit Format Law
Do not force every model into one patch format.
Different models need different editing protocols:
- whole-file replacement
- search/replace blocks
- fenced search/replace blocks
- unified diff
- model-specific patch format
- architect/editor splitAider’s repo map is extremely worth studying.
The docs say Aider builds a concise map of the whole Git repo, including important classes, methods, functions, types, and call signatures. This helps the model understand code relationships without dumping the whole repository into context. (Aider)
The repo map also uses graph ranking to select the most important parts of the codebase that fit inside a token budget. The docs mention --map-tokens, dynamic sizing, and relevance based on current chat state. (Aider)
aider/repomap.py
aider/queries/
aider/queries/tree-sitter-language-pack/
aider/queries/tree-sitter-languages/
The queries directory contains Tree-sitter query resources, which are part of how Aider extracts code symbols from many languages. (GitHub)
mythic_cli/repomap/
symbol_extractor.py
graph_ranker.py
token_budget.py
language_queries/
repo_map_renderer.py
Design law:
## Repo Map Law
Do not make the model read the entire repo.
Give it a compressed map of:
- files
- symbols
- classes
- functions
- interfaces
- key signatures
- dependencies
- likely relevant modulesThis is one of the most important things to steal conceptually for your Norse Saga Engine and Mythic CLI work.
Aider’s README emphasizes Git integration: it automatically commits changes with sensible commit messages and lets users diff, manage, and undo AI changes with normal Git tools. (GitHub)
Plunder targets:
aider/repo.py
aider/diffs.py
aider/commands.py
Interesting command patterns:
/commit
/diff
/undo
/git
The command docs show /commit, /diff, /git, and /undo as built-in in-chat commands. (Aider)
mythic_cli/git/
repo_state.py
diff_view.py
commit_manager.py
undo_manager.py
dirty_tree_guard.py
Design law:
## Git Safety Law
Every AI edit should be Git-visible.
The CLI should:
- detect dirty state
- protect user edits
- show diffs
- commit AI changes separately
- generate useful commit messages
- allow safe undoAider’s in-chat slash-command system is very useful. It supports commands like /add, /ask, /architect, /code, /commit, /diff, /drop, /lint, /map, /model, /run, /test, /tokens, /undo, /voice, and /web. (Aider)
Plunder targets:
aider/commands.py
aider/args.py
aider/args_formatter.py
aider/io.py
mythic_cli/commands/
registry.py
add.py
ask.py
architect.py
forge.py
audit.py
map.py
test.py
run.py
model.py
undo.py
Suggested commands:
/architect
/forge
/audit
/cartograph
/scribe
/add
/drop
/read-only
/map
/map-refresh
/run
/test
/lint
/diff
/commit
/undo
/model
/tokens
/web
Design law:
## Command Law
Slash commands are not just UX sugar.
They are explicit control surfaces for:
- context management
- model switching
- repo mapping
- testing
- shell execution
- Git state
- role switching
- safety boundariesAider’s command docs include /architect, described as an architect/editor mode using two different models. The edit-format docs also explain that editor formats are used in architect mode, where the architect model resolves the task and gives plain-text instructions while the editor model produces the actual syntactic edits. (Aider)
Plunder targets:
aider/coders/architect_coder.py
aider/coders/architect_prompts.py
aider/coders/editor_*_coder.py
aider/coders/editor_*_prompts.py
mythic_cli/roles/
architect.py
editor.py
forge_worker.py
auditor.py
Design law:
## Architect/Editor Split
Separate design from mechanical editing.
The Architect decides:
- what should change
- why it should change
- what boundaries must hold
The Editor applies:
- exact file edits
- syntactic patches
- minimal mechanical transformationThis fits your existing Architect / Forge Worker / Auditor / Scribe model extremely well.
Aider can automatically lint and test code after it makes changes. The docs say it can fix problems detected by linters and test suites; it can use built-in linters, custom --lint-cmd, per-language lint commands, /test, --test-cmd, and --auto-test. (GitHub)
Plunder targets:
aider/linter.py
aider/run_cmd.py
aider/commands.py
mythic_cli/quality/
lint_runner.py
test_runner.py
repair_loop.py
command_result.py
Design law:
## Repair Loop Law
A coding agent should not stop at "I edited the file."
It should:
1. edit
2. lint
3. test
4. read failures
5. repair
6. repeat within safe bounds
7. summarize what changedAider can be scripted from the command line or Python. Its docs show --message / -m for one-shot tasks that apply edits and exit, plus --message-file for loading instructions from a file. (Aider)
Plunder targets:
aider/main.py
aider/args.py
aider/sendchat.py
mythic --message "audit this repo for architecture drift"
mythic -m "add docstrings to these files" src/*.py
mythic --message-file docs/tasks/refactor_plan.mdDesign law:
## Scriptability Law
A serious AI CLI must support:
- interactive mode
- one-shot mode
- message-file mode
- shell scripting
- CI-friendly execution
- deterministic exit behaviorAider can run with --watch-files, watch files in the repo, and respond to special AI comments. Comments with AI! trigger edits; comments with AI? trigger answers. (Aider)
Plunder targets:
aider/watch.py
aider/watch_prompts.py
# Refactor this function to use the new routing layer. AI!
# Explain why this method exists. AI?
Design law:
## Watch Mode Law
The editor can become the command surface.
AI comments should support:
- question triggers
- edit triggers
- file-local tasks
- lightweight IDE integration
- low-friction developer workflowThis is very compatible with your desire for CLI agents that can work alongside VS Code, GitHub, and repo docs without needing a heavy IDE plugin.
Aider supports loading coding convention files as read-only context. The docs recommend creating something like CONVENTIONS.md and loading it with /read CONVENTIONS.md or aider --read CONVENTIONS.md; .aider.conf.yml can always load conventions files. (Aider)
Plunder targets:
aider/commands.py
aider/prompts.py
aider/io.py
MYTHIC.md
AGENTS.md
CONVENTIONS.md
DOMAIN_MAP.md
ARCHITECTURE.md
INTERFACE.md
Suggested config:
read:
- MYTHIC.md
- AGENTS.md
- DOMAIN_MAP.md
- ARCHITECTURE.md
- CONVENTIONS.mdDesign law:
## Standing Instruction Law
Project law should be loaded as read-only context.
The agent may obey it.
The agent may cite it.
The agent may not casually rewrite it.Aider supports many LLM providers, including OpenAI, Anthropic, Gemini, Groq, LM Studio, xAI, Azure, Cohere, DeepSeek, Ollama, OpenRouter, GitHub Copilot, Vertex AI, Amazon Bedrock, and OpenAI-compatible APIs. The docs index lists all these provider sections. (Aider)
Aider also supports model aliases from command line and config files, with priority order: command-line aliases, config aliases, then built-in aliases. (Aider)
Plunder targets:
aider/models.py
aider/llm.py
aider/openrouter.py
aider/args.py
alias:
- "architect:anthropic/claude-opus-4.6"
- "forge:qwen/qwen3.5-coder"
- "auditor:gpt-5.5-thinking"
- "local:lmstudio/stheno-8b"Design law:
## Model Alias Law
Humans should not have to remember long provider model IDs.
Use role-based aliases:
- architect
- forge
- auditor
- scribe
- local
- cheap
- fast
- deepAider’s README says users can add images and web pages to the chat for screenshots, reference docs, and visual context. Its command docs include /web for scraping a webpage and sending it into the chat. (GitHub)
Plunder targets:
aider/scrape.py
aider/urls.py
aider/copypaste.py
/web https://docs.example.com/api
/paste screenshot.png
/read docs/reference.md
Design law:
## External Context Law
A coding agent should be able to ingest:
- docs URLs
- screenshots
- copied text
- local docs
- error logs
- design notesAider stores/shareable chat logs; the FAQ says users can share .aider.chat.history.md by publishing it and using Aider’s share viewer. (Aider)
Plunder targets:
aider/history.py
aider/mdstream.py
aider/io.py
.mythic/history/
chat.history.md
session.jsonl
summaries/
Design law:
## Session Memory Law
Every important coding session should leave behind:
- chat transcript
- changed files
- commands run
- test/lint results
- final summary
- follow-up tasksAider has a benchmark/ directory and publishes LLM leaderboards in its docs. The docs index includes code editing and refactoring leaderboards, benchmark notes, and contributed results. (Aider)
Plunder targets:
benchmark/
aider/website/docs/leaderboards/
tests/
benchmarks/
code_editing/
refactoring/
bug_fixing/
doc_update/
repo_map_quality/
Design law:
## Benchmark Law
Do not judge a coding agent only by vibes.
Test it against repeatable tasks:
- edit accuracy
- patch correctness
- refactor safety
- test repair
- repo map usefulness
- multi-file change successStudy first:
aider/coders/
aider/repomap.py
aider/repo.py
aider/commands.py
aider/diffs.py
aider/linter.py
aider/run_cmd.py
aider/models.py
aider/llm.py
aider/main.py
These are the bones: edit engines, repo map, Git, commands, lint/test loop, models, and runtime.
Study next:
aider/watch.py
aider/watch_prompts.py
aider/prompts.py
aider/history.py
aider/sendchat.py
aider/io.py
aider/scrape.py
aider/openrouter.py
aider/voice.py
These are workflow multipliers: IDE trigger comments, standing prompts, session memory, web context, provider integration, and voice.
Study later:
tests/
benchmark/
docker/
requirements/
scripts/
aider/website/
These are build, packaging, docs, benchmark, and ecosystem support systems.
Be careful with:
- Aider branding
- analytics defaults
- web UI branding
- provider-specific assumptions
- install scripts
- undocumented internal behavior
- model defaults that may change
- benchmark data without understanding methodology
- prompt wording that is too Aider-specific
- files with third-party code or assets you have not reviewed
- any system that commits with flags you do not want in your own workflow
The clean strategy:
Copy architecture aggressively.
Copy implementation selectively.
Rewrite branding, analytics, provider defaults, and project-specific assumptions.git clone https://github.com/Aider-AI/aider.git external/aider
cd external/aiderfind aider -maxdepth 2 -type f | sort
find aider/coders -maxdepth 1 -type f | sort
find tests -maxdepth 2 -type f | sortCreate:
docs/plunder/AIDER_PLUNDER_MAP.md
Template:
# Aider Plunder Map
## Upstream
Project: Aider
Repository: Aider-AI/aider
License: Apache-2.0
## Targeted Areas
| Upstream Path | Local Target | Status | Notes |
|---|---|---|---|
| aider/coders/base_coder.py | mythic_cli/coders/base.py | studying | Core coder loop |
| aider/coders/search_replace.py | mythic_cli/patching/search_replace.py | planned | Search/replace edit blocks |
| aider/repomap.py | mythic_cli/repomap/ | planned | Whole-repo symbol map |
| aider/repo.py | mythic_cli/git/repo_state.py | planned | Git state and commits |
| aider/commands.py | mythic_cli/commands/registry.py | planned | Slash command routing |
| aider/linter.py | mythic_cli/quality/lint_runner.py | planned | Lint/test repair loop |
| aider/watch.py | mythic_cli/watch/ | studying | AI comment triggers |
| aider/models.py | mythic_cli/models/registry.py | planned | Model metadata and aliases |git checkout -b adapt-aider-repomap-patternsgit commit -m "Adapt repository-map patterns from Aider
- Adds Apache-2.0 attribution
- Marks modified files
- Updates THIRD_PARTY_NOTICES.md
- Reworks repo map for Mythic CLI architecture"## Third-Party Attribution
This project is licensed under the Apache License, Version 2.0.
This project includes or adapts selected architectural patterns and code from Aider, also licensed under Apache-2.0.
Aider is an open-source AI pair-programming tool for the terminal.
This project is independent and is not affiliated with, endorsed by, or sponsored by Aider AI LLC, Aider-AI, or the Aider project.Aider inspiration:
aider/coders/base_coder.py
aider/coders/*_coder.py
aider/coders/*_prompts.py
Mythic target:
mythic_cli/coders/
base.py
architect.py
editor.py
search_replace.py
unified_diff.py
whole_file.py
Aider inspiration:
aider/repomap.py
aider/queries/
Mythic target:
mythic_cli/repomap/
extractor.py
graph_rank.py
renderer.py
token_budget.py
Aider inspiration:
aider/repo.py
aider/diffs.py
Mythic target:
mythic_cli/git/
repo.py
diff.py
commit.py
undo.py
Aider inspiration:
aider/commands.py
Mythic target:
mythic_cli/commands/
registry.py
architect.py
forge.py
audit.py
map.py
test.py
run.py
Aider inspiration:
aider/linter.py
aider/run_cmd.py
Mythic target:
mythic_cli/quality/
lint.py
test.py
repair_loop.py
Aider inspiration:
aider/watch.py
aider/watch_prompts.py
Mythic target:
mythic_cli/watch/
file_watcher.py
ai_comment_parser.py
trigger_router.py
Aider inspiration:
aider/models.py
aider/llm.py
aider/openrouter.py
Mythic target:
mythic_cli/models/
providers.py
aliases.py
metadata.py
openrouter.py
local.py
Before pushing your adapted CLI publicly:
- Your repo has
LICENSE. - Your repo uses Apache-2.0 or a compatible strategy.
- Your repo has
NOTICE. - Your repo has
THIRD_PARTY_NOTICES.md. - Your README credits Aider where relevant.
- Modified files have prominent change notices.
- Original copyright/SPDX/license headers are preserved.
- You removed Aider branding from your own product identity.
- You documented copied/adapted areas in a plunder map.
- You tested each adapted subsystem.
- You understand every copied dependency.
- Git operations protect user work.
- Patch/edit formats fail safely.
- Auto-commit behavior is configurable.
- Lint/test loops have bounded retry behavior.
- Analytics or telemetry defaults are removed or made explicit.
- Provider-specific assumptions are rewritten for your own config law.
Copy the architecture.
Respect the license.
Preserve attribution.
Mark your changes.
Do not steal the branding.
Rewrite provider-specific assumptions.
Protect Git history.
Study the repo map deeply.
Aider is especially valuable because it is not just another terminal agent. It is a mature pattern-library for Git-native AI pair programming:
- repository maps
- edit formats
- search/replace blocks
- architect/editor split
- auto-commit discipline
- lint/test repair loops
- slash-command UX
- scripting mode
- IDE comment triggers
- model aliases
- convention files
- web/context ingestion
- benchmark culture
For your own CLI project, the greatest treasure is probably:
Aider's repo map + edit formats + Git discipline.
That trio is battle-tested steel.