agentleFS
SeifBenayedSeifBenayed/cloclo/AGENTS.md

cloclo

AGENTS.md114 starsChanged 8 months agoMITView on GitHub

The file

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep core agent logic provider-agnostic.

    line 9
  2. Distinctive:

    When adding a provider, implement the full provider contract: detection, auth/base URL resolution, model transform, client creation, and …

    line 18
  3. Very specific:

    Keep deferred tools marked as deferred.

    line 20
  4. Distinctive:

    Add tests before changing behavior.

    line 33
  5. Distinctive:

    If you change NDJSON, deferred tools, provider detection, permissions, skills/hooks, or CLAUDE.md loading, update or add targeted tests.

    line 38
  6. Distinctive:

    Read files before editing.

    line 41
  7. Distinctive:

    Avoid introducing native dependencies or unnecessary package dependencies.

    line 42
  8. Distinctive:

    Do not break macOS-oriented auth/keychain flows.

    line 43
  9. Distinctive:

    Keep user-facing errors concise and consistent with existing CLI messaging.

    line 46

≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

cloclo — Project Conventions

Project

cloclo is an open-source Claude Code alternative: a multi-provider AI coding agent CLI. The shipped runtime is claude-native.mjs, a bundled single-file Node.js CLI with zero native dependencies. The editable source lives in src/. Supporting parity/reference implementations exist in claude-native.py, claude-native.go, and rust-sdk/.

Architecture

  • CRITICAL: claude-native.mjs is a build output. Do not edit it directly for normal feature or bug work. Make source changes in src/, then rebuild claude-native.mjs with node build.mjs.
  • Main source modules live in src/ (utils.mjs, config.mjs, providers.mjs, auth.mjs, security-rules.mjs, security.mjs, browser.mjs, tools.mjs, lsp.mjs, auto-memory.mjs, audit.mjs, teams.mjs, sandbox.mjs, context-refs.mjs, smart-routing.mjs, cron.mjs, engine.mjs, session.mjs, index.mjs). Start there before touching bundled output.
  • Keep core agent logic provider-agnostic. Provider differences belong in the PROVIDERS contract and client conversion layers, not in AgentLoop.
  • Built-in tools are registered through ToolRegistry; some tools are eager, others deferred and surfaced via ToolSearch.
  • Extensibility features are built into the main CLI: CLAUDE.md loading, .claude/settings*.json, rules, skills, hooks, memory, sessions, and MCP integration.
  • ink-ui.mjs contains the Ink terminal UI; avoid coupling UI-only behavior into non-interactive/NDJSON paths.
  • claude-tool-loop.js is the NDJSON bridge/runtime wrapper; keep bridge-specific behavior there rather than in provider code.
  • gstack/ is a separate subtree with its own docs/conventions; do not assume its patterns apply to the root CLI unless files explicitly integrate.

Key Patterns

  • Preserve the single-file distribution model for the main CLI unless a change explicitly requires otherwise.
  • When adding a provider, implement the full provider contract: detection, auth/base URL resolution, model transform, client creation, and capabilities.
  • Respect instruction-placement differences by provider (system-blocks, system-message, developer-message, instructions-field).
  • Keep deferred tools marked as deferred; register ToolSearch when deferred tools exist.
  • Maintain backward-compatible CLI behavior and help text for user-facing flags where possible.

Build / Run

  • node build.mjs — rebuild claude-native.mjs from src/
  • node claude-native.mjs — interactive REPL
  • node claude-native.mjs -p "explain this code" — one-shot mode
  • npm test or node test-suite.mjs — main test suite
  • npm run test:ink — Ink smoke test
  • npm run test:e2e — deferred-tools E2E test
  • npx cloclo — package entrypoint behavior

Testing Conventions

  • Add tests before changing behavior; do not ship untested changes.
  • Primary tests live in test-suite.mjs; this file mixes extraction-based unit tests with spawned-process E2E checks.
  • Unit tests often validate the bundled output in claude-native.mjs, so source edits in src/ usually need a rebuild before those tests reflect the change.
  • E2E tests spawn node claude-native.mjs; keep CLI I/O and exit codes deterministic.
  • API-backed E2E in test-suite.mjs --e2e require credentials; keep non-E2E tests runnable without API keys.
  • If you change NDJSON, deferred tools, provider detection, permissions, skills/hooks, or CLAUDE.md loading, update or add targeted tests.

Important Constraints

  • Read files before editing; do not make assumptions about uninspected code.
  • Avoid introducing native dependencies or unnecessary package dependencies.
  • Do not break macOS-oriented auth/keychain flows; current conventions assume macOS for OAuth helpers.
  • Preserve support for multiple invocation styles: REPL, one-shot, NDJSON bridge, packaged binary entrypoint.
  • Be careful with security-sensitive areas: Bash/tool permissions, hooks, file editing, auth handling, MCP tool registration.
  • Keep user-facing errors concise and consistent with existing CLI messaging.
  • Ignore generated/runtime state such as .claude-native/, node_modules/, target/, and packaged artifacts unless the task is specifically about them.

AICL — Agent Interlingua

Cloclo is a multi-agent runtime. Agents communicate using AICL (Agent Interlingua for Cooperative Labor). AICL is agent-to-agent only — never expose it to humans. Full protocol below:

@./AICL_ONBOARDING.md

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.