lessons-learned

lessons-learned is an agent for coding agents from vercel-labs/open-agents. It costs 0 tokens per session (4,554 once invoked), scanned C, original, MIT.

A shared record of mistakes, discoveries, and non-obvious behavior found while developing a codebase.

In plain words
What is it for?
Documenting bugs, tool behavior, project rules, and decisions that future contributors should know.
Why use it?
It keeps useful lessons from being forgotten or rediscovered. Developers and coding agents can check known pitfalls before making similar changes.

Agent

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/vercel-labs/open-agents/lessons-learned
Clone the repo
git clone --depth 1 https://github.com/vercel-labs/open-agents

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 lessons-learned

README.md
[![agentmods](https://agentmods.dev/badge/agents/vercel-labs/open-agents/lessons-learned.svg)](https://agentmods.dev/agents/vercel-labs/open-agents/lessons-learned)
Your own site
<a href="https://agentmods.dev/agents/vercel-labs/open-agents/lessons-learned"><img src="https://agentmods.dev/badge/agents/vercel-labs/open-agents/lessons-learned.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,554 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.04554
Opus 5 $0.00000 $0.02277
Sonnet 5 $0.00000 $0.00911
Haiku 4.5 $0.00000 $0.00455

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

Security

Grade C, and why

lessons-learned scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Bash approval heuristics should reserve prompts for clearly destructive commands (for example `rm -rf`, `sudo`, or mutating git/package-manager operations); treating pipes/chaining and common filesystem reads as danger
docs/agents/lessons-learned.md · 114 lines

How it starts

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

Lessons Learned

Hard-won knowledge from building this codebase. When you make a mistake or discover a non-obvious behavior, add it here.

General / Tooling

  • Skill discovery de-duplicates by first-seen name, so project skill directories must be scanned before user-level directories to allow project overrides.
  • The system prompt should list all model-invocable skills (including non-user-invocable ones), and reserve user-invocable filtering for the slash-command UI.
  • Glob patterns ending in ** (for example "**" or "src/**") should be treated as recursive, even when ** is the final segment.
  • In shell tools, avoid piping primary command output directly to head when exit-code handling matters; pipeline semantics can mask real failures from the primary command.
  • Bash approval heuristics should reserve prompts for clearly destructive commands (for example rm -rf, sudo, or mutating git/package-manager operations); treating pipes/chaining and common filesystem reads as dangerous creates too many false-positive approvals for normal inspection commands.
  • Verification instructions must tell the agent to consult AGENTS.md / package.json scripts before listing generic steps like "typecheck -> lint -> build"; otherwise models default to raw commands (npx tsc, eslint .) which bypass project-specific tool config (turbo pipelines, tsconfig references, ultracite, etc.) and produce incorrect or incomplete results.
  • Tool renderer part.output values may be unknown; when accessing fields like files or matches, add runtime narrowing/type guards first (in both TUI and web renderers) to satisfy strict typecheck.
  • AI SDK stream handles may return PromiseLike values (not full Promise), so avoid methods like .finally() and use then/catch patterns that work with PromiseLike.
  • After schema edits, review generated Drizzle migrations for unrelated schema drift changes before committing (for example defaults on untouched columns), since drizzle-kit generate can include those alongside intended changes.
  • pnpm 11 requires an explicit allowBuilds map in pnpm-workspace.yaml; approve required native/tooling builds deliberately and keep non-functional lifecycle scripts disabled.
  • Keep pnpm release-age policy explicit in pnpm-workspace.yaml: enforce a strict one-day minimumReleaseAge and fail closed when publish timestamps are missing.
  • Use pnpm run ci for the repository verification script. pnpm ci invokes pnpm's built-in clean-install command instead of the package script.
  • Keep Kysely pinned to 0.28.x until Better Auth's bundled Kysely adapter stops importing migration constants from Kysely's root entrypoint; Kysely 0.29.x removed those root exports and breaks the Next production bundle.
  • Node 24's built-in TypeScript support uses native ESM resolution and ignores tsconfig path aliases, so utility-script dependency chains need explicit .ts extensions and relative imports.
  • bunx @vercel/config validate executes the CLI under Node via its shebang and cannot parse TypeScript-style vercel.ts imports; use bunx --bun @vercel/config validate (or bun node_modules/@vercel/config/dist/cli.js validate) for reliable local validation.
  • Successful Vercel CLI auth (vercel whoami, team/project REST APIs, .vercel linking) does not guarantee Workflow observability access. workflow inspect ... --backend vercel can still fail with 401 {"error":{"code":"unauthorized","message":"You are not allowed to access this endpoint."}} when the user/token lacks the Vercel product permission documented as Vercel Workflow (and possibly related Observability access), even if WORKFLOW_VERCEL_AUTH_TOKEN is passed explicitly from the Vercel CLI auth file.

Read the full file on GitHub · 114 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 · 114 lines · 0 tokens per session scan C abfc1395aeac

Subscribe to this mod's changes

lessons-learned is an agent published in the GitHub repository vercel-labs/open-agents (5,798 stars, last pushed 5d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,554 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.