How to Send Web Pages to Aider with Share2Agent
Feed documentation, error pages, and API references to Aider sessions. Share2Agent extracts clean page content and saves it as Markdown that you can add to Aider's context with /add or --read.
Prerequisites
- Aider installed (aider.chat)
- Share2Agent Chrome extension installed
- Python 3.10+ with PyYAML (
pip install pyyaml)
Step 1: Set Up the Receiver
git clone https://github.com/mnardit/share2agent.git
cd share2agent/examples/receiver
pip install pyyamlStep 2: Save Pages to Your Project Directory
Point the receiver at a references/ directory inside your project:
export PAGES_DIR=~/my-project/references
python3 -u receiver.pyThe receiver listens on port 9876 and saves each shared page as a .md file with YAML frontmatter (URL, title, timestamp, comment) and the extracted text.
Step 3: Configure Share2Agent
- Click the Share2Agent extension icon in Chrome.
- Open Settings.
- Set the Webhook URL to
http://localhost:9876. - Save.
Step 4: Share a Page
- Open documentation, a GitHub issue, or an error page you want Aider to see.
- Click the Share2Agent icon.
- Add a comment describing what you need (e.g., "implement this pattern in our codebase").
- Click Share.
The page is saved as:
~/my-project/references/2026-03-28-1430-flask-error-handling.md
Step 5: Add to Aider
You have two options depending on whether Aider should edit the file or just read it for context.
Option A: Read-only reference (/read)
Use this when the saved page is documentation you want Aider to reference but not modify:
/read references/2026-03-28-1430-flask-error-handling.md
Aider adds the file to its context without including it in the edit set.
Option B: Add to chat (/add)
If you want Aider to analyze and potentially use the content in its edits:
/add references/2026-03-28-1430-flask-error-handling.md
Then ask your question:
Based on the error handling docs I just added, refactor our
app.py to use Flask's errorhandler decorator instead of try/except blocks.
Option C: Start Aider with references
You can also launch Aider with reference files pre-loaded:
aider --read references/*.mdThis loads all saved pages as read-only context from the start.
Share2Agent vs Aider's /web Command
Aider has a built-in /web command that fetches a URL:
/web https://flask.palletsprojects.com/en/stable/errorhandling/
When to use /web: Quick, one-off lookups where you already have the URL and just need the text.
When to use Share2Agent: Pages that require JavaScript rendering, pages behind login walls, complex pages where browser extraction gives cleaner results, or when you want to save the content for later reference. Share2Agent extracts content from the fully rendered page in your browser, so it handles SPAs, dynamic content, and authenticated pages that /web cannot reach.
Tips
- Add
references/to.gitignore-- these are temporary reference files, not part of your source code. - Use comments as prompts -- the comment you write in Share2Agent is saved in the Markdown frontmatter. When reviewing the file in Aider, you can see your original intent.
- Batch multiple pages -- share several reference pages before starting an Aider session, then
/readall of them at once.
What's Next?
- Build a wrapper script -- create a shell alias that starts Aider with
--read references/*.mdso every session automatically includes your latest saved pages. - Auto-clean old references -- add a cron job to delete files older than 7 days from the references directory.
- Combine with Aider's git integration -- share a GitHub PR diff page, add it to Aider, and ask it to review the changes.