Use with AI agents
Give Claude Code, Cursor or any coding agent these docs, and a prompt that adds Lyrelog to your project.
Every page here is also plain Markdown, so a coding agent can read the docs instead of guessing from memory, which for a new service like Lyrelog it gets wrong.
Files for agents
| Address | What it holds |
|---|---|
/llms.txt | An index of every page with its description, each linking to its Markdown. The llms.txt format agents look for. |
/llms-full.txt | Every page in one file, to put the whole docs in an agent's context at once. |
/<page>.md | One page, e.g. /sdks/go.md. |
Each page also has Copy Markdown, and Open to send it to ChatGPT, Claude or Cursor, under its title.
A prompt to add Lyrelog to your project
Paste it into your agent, with your ingest key in place of lyr_ing_... (the project's
API keys page, see Keys; it only writes, so it's safe to ship in an app). Keep the key out of the repository if you
prefer: put it in an environment variable and tell the agent its name.
Add Lyrelog logging to this project. Read https://docs.lyrelog.com/llms.txt first, then the
page of the SDK for this project's language (or the HTTP API page if there's no SDK for it).
Don't rely on what you remember about Lyrelog: follow the docs.
1. Install the SDK and start it once, where the app or service starts, with the ingest key
lyr_ing_... (or from the environment variable LYRELOG_KEY). Keep the default endpoint.
2. Make sure queued events are sent before the process ends: flush or close the client as the
SDK page says for this kind of program (server, CLI, serverless function, app).
3. Capture errors: unhandled ones the way the SDK page shows, and the places in this code that
catch an error and carry on.
4. Log a few events where something happens to a person: sign in, a payment, a sync, a failed
request. Use a stable snake_case name as the message (payment_declined), a level, an area
(category) and attributes with the details to filter by.
5. Identify the person with our own user id (setUser or the SDK's equivalent), never an email
address, and clear it on sign-out.
6. Never put passwords, tokens, keys, cookies, full request bodies or personal data in messages,
attributes or payloads.
7. Tell me which environment the events will arrive under, so I can pick it in the dashboard.The SDKs aren't published yet, so an agent can't install them today: the prompt works once they are. Until then it can send events over the HTTP API.
Let an agent read your events
The command-line tool lets a coding agent search events, read errors and follow a
person through a session, signed in as you. It writes JSON when an agent runs it. You sign in
once with lyrelog login; the agent can't sign in by itself. See
For agents and scripts, with a prompt to investigate an error.
Tips
- Name the page. "Read https://docs.lyrelog.com/sdks/python.md and add Lyrelog to the FastAPI app" is faster and more accurate than a search.
- Ask for a test event. Have the agent log one event when the app starts, run it, and check it arrives (see Quickstart): it's the quickest way to catch a wrong key or environment.
- Review what it logs. Agents tend to log too much. One event per thing that happened, with a stable name, is easier to search, chart and pay for than a line per function call.