OneNote Desktop Agent
OneNote has years of notes, meetings, research, and recordings.
Agents should be able to use that context without asking you to copy and paste it by hand.
OneNote Desktop Agent connects Claude Code and Codex to the real Microsoft OneNote desktop app on Windows. It uses the local OneNote COM API through Windows PowerShell. No Microsoft Graph. No browser bridge. No Office.js add-in.
The plugin and skill name is onenote-desktop.
Install
Claude Code
claude plugin marketplace add takhoffman/onenote-desktop-agent
claude plugin install onenote-desktop@takhoffman
Then ask Claude Code:
Use the onenote-desktop skill to check my OneNote desktop COM install.
For local development from this repository:
claude plugin install .
Codex
codex plugin marketplace add https://github.com/takhoffman/onenote-desktop-agent
codex plugin add onenote-desktop@takhoffman
Then ask Codex:
Use the onenote-desktop skill to list my visible OneNote notebooks.
For Codex Desktop, open Plugins, add this marketplace URL, then install onenote-desktop:
https://github.com/takhoffman/onenote-desktop-agent
What It Gives Agents
- A map of visible notebooks, section groups, sections, and pages.
- Page XML, including IDs, timestamps, tags, media references, author metadata, and unknown elements.
- Page creation and targeted page updates.
- Search over indexed page text and metadata.
- Durable OneNote links to pages and objects.
- Desktop navigation to a page or object.
- Export to PDF, XPS, Word, MHTML, EMF,
.one, or .onepkg.
- Embedded audio and media extraction when OneNote exposes source/cache paths.
Why Desktop
This project is for Microsoft OneNote desktop for Windows.
That matters because many useful OneNote workflows are local: desktop notebooks, local cache, embedded recordings, exported pages, and the exact app state the user is looking at. Cloud APIs are useful, but they are not the same thing as controlling the desktop app that already has the notebook open.
OneNote Desktop Agent keeps that boundary clear. It automates the local app. It does not create a hosted service, a browser session, a localhost bridge, or a Microsoft Graph permission flow.
Requirements
- Windows.
- Microsoft OneNote desktop with COM automation available.
- Windows PowerShell via
powershell.exe.
- Claude Code or Codex if installing as an agent plugin.
OneNote COM calls should run under single-threaded apartment PowerShell:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation check-install
Use It Directly
You can run the PowerShell helper without Claude Code or Codex.
Check OneNote desktop and COM:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation check-install
List visible notebooks, sections, and pages:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation hierarchy -Scope pages
Read a page:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation get-page -PageId "<page-id>"
Create a page:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation create-page -SectionId "<section-id>" -Title "Agent note" -Text "Written through OneNote COM."
Export a page to PDF:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation publish -PageId "<page-id>" -TargetPath ".\exports\page.pdf" -PublishFormat pdf
Extract embedded media from a page:
powershell.exe -NoProfile -STA -ExecutionPolicy Bypass -File .\skills\onenote-desktop\scripts\Invoke-OneNoteCom.ps1 -Operation extract-media -PageId "<page-id>" -OutputDir ".\media-export"
COM Operations
The helper wraps the repeatable, lower-risk OneNote desktop COM operations: