cyberine
UsageRun recipes

Ecosystem instruction files (AGENTS.md / CLAUDE.md)

Loop workers (raw-API, not CLI) automatically discover and read AGENTS.md / CLAUDE.md from the target repo and inject them as system-message context before the task. This gives every loop worker the same project-level conventions a native coding agent would read on startup.

Discovery: starting at the git root (or the task cwd when not a git repo), each directory from root down to cwd is scanned. At each level the first matching filename in CYBERINE_INSTRUCTION_FILENAMES (default: AGENTS.md,CLAUDE.md) wins; only one file per directory is picked. The resulting ordered list is concatenated root-first (broad) to cwd-last (specific), so the most project-specific instruction is nearest the task in context.

Layering: the order from outermost to innermost in the prompt is:

  1. Ecosystem instruction files (this feature) — repo-level conventions
  2. .cyberine/rules preamble — project-specific Cyberine overrides (injected into the task prompt)

The .cyberine/rules layer is injected AFTER the ecosystem instructions, so it acts as the highest-priority override for Cyberine-specific behavior.

CLI workers are excluded. Claude Code, Codex, Gemini, and OpenCode self-read their own AGENTS.md / CLAUDE.md from the cwd; injecting the same files again would double the instructions. Only loop (raw-API) workers receive this injection.

# Put project-level instructions for loop workers in your repo root
echo "# Project Conventions\nPrefer Bun over npm." > AGENTS.md

# Run a loop worker — it will see the AGENTS.md content as a system message
DEEPSEEK_API_KEY=... cyberine run "refactor the auth module"

# Disable entirely
CYBERINE_INSTRUCTION_FILES=false cyberine run "..."

# Change which filenames are searched (comma-separated, precedence left-to-right)
CYBERINE_INSTRUCTION_FILENAMES="AGENTS.md,CLAUDE.md,.agent-instructions.md" cyberine run "..."

# Raise the byte cap (default 32 KB covers most repos)
CYBERINE_INSTRUCTION_FILES_MAX_BYTES=65536 cyberine run "..."

When the combined byte size of discovered files exceeds CYBERINE_INSTRUCTION_FILES_MAX_BYTES, files are dropped from the root end (broad, less-specific files first) so the nearest-to-cwd instruction always survives the budget constraint. Discovery is best-effort — an unreadable file is skipped silently; a missing git binary falls back to using cwd as the discovery root.