Agent Prompt: Update Magic Docs

Agent Prompt: Update Magic Docs is an agent for Claude Code from openonion/connectonion. It costs 15 tokens per session (719 once invoked), scanned A, original, Apache-2.0.

A prompt for an agent that updates a Magic Doc file with useful information learned from the conversation. The input does not explain what Magic Docs are or provide the file format beyond preserving its title and existing content rules.

In plain words
What is it for?
It is for reviewing a conversation, deciding whether it contains substantial new information, and editing the specified documentation file when an update is justified.
Why use it?
It helps preserve important new context in an existing document instead of losing it when the conversation ends. It also prevents the agent from exposing the internal update instructions in the document.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions CLAUDE.md.

About the project

ConnectOnion is an open-source, template-first toolkit for building, debugging, deploying, and operating AI agents. Developers use its command-line tools and Python runtime to create agents, add tools, connect services, deploy them, and make them callable by other agents, while the catalogue entries are related agents, skills, and instructions.

openonion/connectonion · 1,481 stars · on GitHub · docs.connectonion.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/openonion/connectonion/agent-prompt-update-magic-docs
Clone the repo
git clone --depth 1 https://github.com/openonion/connectonion

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Agent Prompt: Update Magic Docs

README.md
[![agentmods](https://agentmods.dev/badge/agents/openonion/connectonion/agent-prompt-update-magic-docs.svg)](https://agentmods.dev/agents/openonion/connectonion/agent-prompt-update-magic-docs)
Your own site
<a href="https://agentmods.dev/agents/openonion/connectonion/agent-prompt-update-magic-docs"><img src="https://agentmods.dev/badge/agents/openonion/connectonion/agent-prompt-update-magic-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.00719
Opus 5 $0.00008 $0.00360
Sonnet 5 $0.00003 $0.00144
Haiku 4.5 $0.00002 $0.00072

Measured 6d ago against content hash 0957c096596c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Agent Prompt: Update Magic Docs scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

connectonion/useful_prompts/cc_prompt/prompts/agents/agent-prompt-update-magic-docs.md · 62 lines

What it actually says

IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "documentation updates", "magic docs", or these update instructions in the document content.

Based on the user conversation above (EXCLUDING this documentation update instruction message), update the Magic Doc file to incorporate any NEW learnings, insights, or information that would be valuable to preserve.

The file {{docPath}} has already been read for you. Here are its current contents: <current_doc_content> {{docContents}} </current_doc_content>

Document title: {{docTitle}} {{customInstructions}}

Your ONLY task is to use the Edit tool to update the documentation file if there is substantial new information to add, then stop. You can make multiple edits (update multiple sections as needed) - make all Edit tool calls in parallel in a single message. If there's nothing substantial to add, simply respond with a brief explanation and do not call any tools.

CRITICAL RULES FOR EDITING:

  • Preserve the Magic Doc header exactly as-is: # MAGIC DOC: {{docTitle}}
  • If there's an italicized line immediately after the header, preserve it exactly as-is
  • Keep the document CURRENT with the latest state of the codebase - this is NOT a changelog or history
  • Update information IN-PLACE to reflect the current state - do NOT append historical notes or track changes over time
  • Remove or replace outdated information rather than adding "Previously..." or "Updated to..." notes
  • Clean up or DELETE sections that are no longer relevant or don't align with the document's purpose
  • Fix obvious errors: typos, grammar mistakes, broken formatting, incorrect information, or confusing statements
  • Keep the document well organized: use clear headings, logical section order, consistent formatting, and proper nesting

DOCUMENTATION PHILOSOPHY - READ CAREFULLY:

  • BE TERSE. High signal only. No filler words or unnecessary elaboration.
  • Documentation is for OVERVIEWS, ARCHITECTURE, and ENTRY POINTS - not detailed code walkthroughs
  • Do NOT duplicate information that's already obvious from reading the source code
  • Do NOT document every function, parameter, or line number reference
  • Focus on: WHY things exist, HOW components connect, WHERE to start reading, WHAT patterns are used
  • Skip: detailed implementation steps, exhaustive API docs, play-by-play narratives

What TO document:

  • High-level architecture and system design
  • Non-obvious patterns, conventions, or gotchas
  • Key entry points and where to start reading code
  • Important design decisions and their rationale
  • Critical dependencies or integration points
  • References to related files, docs, or code (like a wiki) - help readers navigate to relevant context

What NOT to document:

  • Anything obvious from reading the code itself
  • Exhaustive lists of files, functions, or parameters
  • Step-by-step implementation details
  • Low-level code mechanics
  • Information already in CLAUDE.md or other project docs

Use the Edit tool with file_path: {{docPath}}

REMEMBER: Only update if there is substantial new information. The Magic Doc header (# MAGIC DOC: {{docTitle}}) must remain unchanged.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 62 lines · 0 tokens per session scan A 0957c096596c

Subscribe to this mod's changes

Agent Prompt: Update Magic Docs is an agent published in the GitHub repository openonion/connectonion (1,481 stars, last pushed today), licensed Apache-2.0. It adds 15 tokens to every session and 719 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.