papyrus AGENTS.md

papyrus AGENTS.md is an instructions file for Codex, OpenCode from abhichat85/papyrus. It costs 1,444 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for coding agents working on Papyrus, a document-ingestion engine that turns files into Markdown and JSON Lines chunks. They define its architecture and rules for handling messy input.

In plain words
What is it for?
Use them when changing Papyrus, especially when adding parsers, renderers, or conversion behavior.
Why use it?
They help an agent avoid breaking the boundary between file parsers and output renderers, and require recoverable input problems to produce warnings where possible.

Instructions file for CodexOpenCode

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 instructions/abhichat85/papyrus/agents-md
Clone the repo
git clone --depth 1 https://github.com/abhichat85/papyrus

Made for: Codex, OpenCode.

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 papyrus AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/abhichat85/papyrus/agents-md.svg)](https://agentmods.dev/instructions/abhichat85/papyrus/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/abhichat85/papyrus/agents-md"><img src="https://agentmods.dev/badge/instructions/abhichat85/papyrus/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,444 This file is loaded in full into every session.
When invoked 1,444 The same file — it is already loaded in full.
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 $0.01444 $0.01444
Opus 5 $0.00722 $0.00722
Sonnet 5 $0.00289 $0.00289
Haiku 4.5 $0.00144 $0.00144

Measured 3d ago against content hash 3efb643aa1ac, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

papyrus AGENTS.md 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 3d 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.

AGENTS.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Instructions for AI coding agents working on Papyrus. Read this before changing anything. CLAUDE.md points here; this file is the source of truth.

What Papyrus is

A universal document ingestion engine. Any file in, agent-ready Markdown out. It is a deterministic library first, with a CLI, an HTTP API and a demo web app layered on top.

The one rule

bytes → detect → parser → Document IR → renderer → markdown
                              ↓
                          chunks.jsonl

Parsers never emit Markdown. Renderers never parse files. Everything meets at the Document IR (src/papyrus/ir.py). If you find yourself writing a # or a | inside src/papyrus/parsers/, stop — that string belongs in src/papyrus/renderers/markdown.py.

This is what makes a new format a single self-contained file. Breaking it costs the project its main property, so it is not a stylistic preference.

Core principles

  1. Degrade, don't crash. Messy input produces a Document with a warning appended. Only genuinely unreadable input raises ParseError. A parser that raises something unexpected is wrapped by Converter and surfaces as ParseError — never a bare traceback.
  2. Never trust a filename. detect() reads magic bytes first. A PDF named invoice.docx is a PDF.
  3. No LLM in the conversion path. Conversion is deterministic and free. Same bytes in, same Markdown out. An AI cleanup pass may exist later, but it is opt-in and it sits after the IR, never inside a parser.
  4. Use the format's own signal before a heuristic. Word marks header rows with w:tblHeader; HTML has <th>; PyMuPDF reports the header it detected; csv.Sniffer exists. Guessing from cell contents is the fallback, not the first move — see split_header(rows, hint).
  5. Preserve document order. python-docx hands you paragraphs and tables as separate collections; python-pptx hands you shapes in z-order; PDF text and tables come from two different passes. All three are reconstructed. A table rendered under the wrong heading is a correctness bug, not a formatting nit.
  6. Every uploaded file is hostile. Never execute input, never shell out, never write it outside a temp directory, always sanitise the filename with safe_name(). Every ceiling lives in Limits.
  7. Preserve provenance. sha256, source format, page anchors. A converted document must be traceable to the bytes it came from.

Read the full file on GitHub · 128 lines

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. 3d ago First seen · 128 lines · 1,444 tokens per session scan A 3efb643aa1ac

Subscribe to this mod's changes

papyrus AGENTS.md is an instructions file published in the GitHub repository abhichat85/papyrus (0 stars, last pushed 9d ago), licensed Apache-2.0. It adds 1,444 tokens to every session, about $0.0072 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-31.