agentflare AGENTS.md

A configuration guide for AgentFlare, a command-line tool that improves how coding agents handle text, code, and conversation history. It covers integrations, compression, saved context, and web-search behavior.

In plain words
What is it for?
Use it when configuring AgentFlare or its `optimize` commands. It helps compress written output, simplify code, shorten session history, and recover an earlier original version.
Why use it?
It helps agents work with less repeated or unnecessary context during long sessions. It also explains which commands and integrations apply to different coding tools.

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

Made for: Codex, OpenCode.

Per session 1,158 This file is loaded in full into every session.
When invoked 1,158 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.01158 $0.01158
Opus 5 $0.00579 $0.00579
Sonnet 5 $0.00232 $0.00232
Haiku 4.5 $0.00116 $0.00116

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

Security

Grade A, and why

agentflare 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 2d 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 · 97 lines

How it starts

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

agentflare rules

Static fallback for agents with no MCP support and no hook mechanism (e.g. Aider). Everything else (Claude Code, Codex, Cursor, Windsurf, VS Code/Copilot, Cline, Continue) gets a real integration via the agentflare CLI — see https://github.com/getappz/agentflare. Use this file only if your tool isn't one of those.

Flare optimize module

agentflare ships a single consolidated compression/optimization module (optimize) with four layers:

Layer Command What it does
output agentflare optimize output LLM-based prose compression (was caveman)
code agentflare optimize code Lazy senior dev code minimalism (was ponytail)
context agentflare optimize context Session transcript compaction via BM25
runtime (automatic via hooks) Session hygiene, model routing nudges

agentflare flare / agentflare opt still work as backward-compatible aliases for agentflare optimize. caveman/ponytail are not live command aliases — only legacy ~/.config/{caveman,ponytail}/ cleanup on uninstall.

agentflare optimize retrieve <id> (and MCP mcp__flare__optimize action=retrieve) recovers an original that the output layer compressed away (CCR pattern). lean-ctx-compressed reads are instead recovered via ctx_read mode=raw — agentflare does not re-cache them, because lean-ctx is a separate sidecar not in agentflare's read path.

Context compression — lean-ctx

MANDATORY for code intelligence — do NOT use native Grep / Read-on-full-file / shell cat/grep/rg/find to search or read code. Route ALL of it through lean-ctx instead. lean-ctx is in shadow mode: native file/search/shell calls auto-route to ctx_* — but the rule below is the contract so agents without shadow routing (Aider, plain shells) still comply.

  • Code searchctx_search (action=regex | semantic | symbol), NOT Grep/grep/rg.
    • exact symbol: ctx_search(action=symbol, name=...)
    • by meaning: ctx_search(action=semantic, query=...) (uses the on-demand dense index — no pre-build needed)
    • by pattern: ctx_search(action=regex, pattern=...)
  • Callers/calleesctx_callgraph (NOT grep for "who calls X").
  • Orient in unfamiliar codectx_compose FIRST (one call vs search→read→search chain).
  • Read filesctx_read (compressed reader), prefer mode=anchored/full. Recover a compressed read verbatim via ctx_read mode=raw.
  • Shellctx_shell (auto-compresses output).

Read the full file on GitHub · 97 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. 2d ago First seen · 97 lines · 1,158 tokens per session scan A c3cdb09b0330

Subscribe to this mod's changes

agentflare AGENTS.md is an instructions file published in the GitHub repository getappz/agentflare (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 1,158 tokens to every session, about $0.0058 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.