ai-context-docs

ai-context-docs is an agent for coding agents from beerandcodeteam/beer-and-code-harness. It costs 78 tokens per session (2,232 once invoked), scanned A, original, MIT.

A writing agent for an AI-context documentation process. It creates or refreshes eight Markdown files that describe the code that currently exists, rather than proposed future behavior.

In plain words
What is it for?
Use it as step four of the /ai-context process to document selected parts of a repository from an inspector's code summary and the relevant source files.
Why use it?
It keeps generated code documentation aligned with the implementation and avoids presenting plans or guesses as facts. It also checks ownership and writes files only when their contents change.

Agent

Part of the bc-harness plugin — 3 commands, 6 agents, 1 hook shipped together

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/beerandcodeteam/beer-and-code-harness/ai-context-docs
Clone the repo
git clone --depth 1 https://github.com/beerandcodeteam/beer-and-code-harness

Or install bc-harness, the plugin that ships this one along with the rest of its 3 commands, 6 agents, 1 hook.

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 ai-context-docs

README.md
[![agentmods](https://agentmods.dev/badge/agents/beerandcodeteam/beer-and-code-harness/ai-context-docs.svg)](https://agentmods.dev/agents/beerandcodeteam/beer-and-code-harness/ai-context-docs)
Your own site
<a href="https://agentmods.dev/agents/beerandcodeteam/beer-and-code-harness/ai-context-docs"><img src="https://agentmods.dev/badge/agents/beerandcodeteam/beer-and-code-harness/ai-context-docs.svg" alt="Measured on agentmods" height="20"></a>
Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,232 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 $0.00078 $0.02232
Opus 5 $0.00039 $0.01116
Sonnet 5 $0.00016 $0.00446
Haiku 4.5 $0.00008 $0.00223

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

Security

Grade A, and why

ai-context-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 4d 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/ai-context-docs.md · 181 lines

How it starts

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

You write the 8 files under <target>/docs/agents/. The inspector digest is your map; read actual source files through it when a doc needs depth (domain rules, payload examples). Everything you write describes what is implemented — nothing prescriptive, nothing aspirational.

Inputs (injected by the router)

  • target — absolute repo path
  • digest — full inspector digest
  • include_files — subset of the 8 file ids to generate; skip the rest with status disabled
  • adopt — boolean; governs handling of not-owned files

Ownership contract

Same as the whole pipeline: absent → create; owned (banner present) → regenerate + byte-diff; not-owned → skip with skipped (not owned) unless adopt=true, then fold hand-written facts in and overwrite with status adopted.

Hard exclusions

  • Never read or cite .spec/, .specs/, spec/ — this tree documents the code, not the plan.
  • Never read .env; env var names come from the digest.
  • Existing generated docs are a byte-diff target only — never recycle their prose as evidence. Regenerate from code every run.

Grounding rules

  • Every claim about language, framework, pattern, rule, or contract cites something you or the inspector actually read (file path, class name, config key, dependency version).
  • Never invent content. A section without evidence → the N/A shape (below), with the evidence of absence cited.
  • Realistic payload examples come from fixtures, tests, or factories — never "string"/"value" placeholders.

Style — caveman docs

Dense from the first draft. Bullets over paragraphs, tables over lists, no meta-prose, no hedging, active imperative voice, numbers as digits, code blocks verbatim. Heading states the topic; body starts with facts.

Common shape — every file

# <Canonical Title>

<!-- Generated by /ai-context. Manual edits are overwritten on re-run. -->

## AS IS — Current state

### <subsection>
<bullets / tables / fenced code>

## Related documents

- [`<peer>.md`](<peer>.md) — <one-line scope>
- [`<peer>.md`](<peer>.md) — <one-line scope>

Read the full file on GitHub · 181 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. 4d ago First seen · 181 lines · 78 tokens per session scan A eff0aa0c5d07

Subscribe to this mod's changes

ai-context-docs is an agent published in the GitHub repository beerandcodeteam/beer-and-code-harness (45 stars, last pushed 16d ago), licensed MIT. It adds 78 tokens to every session and 2,232 once invoked, about $0.0004 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.