# Agent Config Integration
<!--
ref: @protocol/agent-config-integration
type: protocol
tags: [agent integration, protocol access, curly command, on-demand knowledge]
aliases: [claude-md, agent-setup, integration, skill-claude-code, open-claw-protocol-skill-setup, cc-skill, claude-code-skill]
triggers: [bootstrap protocols, search protocols, fetch specific protocol, access private protocols]
trigger_prompt: When an agent needs to quickly access protocols for unfamiliar tasks or workflows, or when setting up a new session with essential resources.
category: core
last_reviewed: 2026-04-30
complements: [@protocol/install, @integrations/curly]
audience: [claude-code-user, codex-user, cursor-user, openclaw-user, terminal-only, agent-author]
version: 16
updated_at: 2026-10-12T23:22:37.280Z
-->
The snippet to paste into CLAUDE.md, AGENTS.md, .cursorrules or a system prompt so any shell-capable agent fetches protocols on demand — plus per-harness details for Claude Code, Codex and OpenClaw.
## Prerequisite
Install `curly` and configure your token per `@protocol/install` — the token goes into `~/.curly.yaml` (chmod 600) via `curly init protocol`'s hidden-input prompt in your own terminal, never through an agent. Once that's done, every protocol call is `curly protocol <path>`.
## Universal — works for every agent with shell access
Drop this into the instructions file your agent loads — `CLAUDE.md` (Claude Code), `AGENTS.md` (Codex, Cursor and most others), `.cursorrules`, a system prompt, or custom instructions. Prefer the user-level file so every project gets it; use the project file when you want it scoped:
```markdown
## protocol — On-demand knowledge
Use curly to fetch protocols on demand:
- Bootstrap at session start: curly protocol bootstrap
- Search when stuck: curly protocol "search?q=<keyword>"
- Fetch a specific protocol: curly protocol @repo/slug
```
That's it for most agents. The platform-specific sections below add slash-command wrappers (`/protocol bootstrap`, `protocol get @foo/bar`) for harnesses that have native skill systems.
## Claude Code — `/protocol` slash command
Optional convenience. Wrap the curly calls so you can type `/protocol bootstrap` instead of the full command:
```bash
mkdir -p ~/.claude/commands && cat > ~/.claude/commands/protocol.md << 'SKILL'
Search and fetch protocols from protocol.supply — on-demand knowledge for any task.
Determine the action from $ARGUMENTS:
1. Starts with @ — fetch that protocol ref directly.
2. Equals "bootstrap" — load core protocols for this session.
3. Anything else — search for protocols matching the query.
Run the matching command via Bash:
Fetch ref: curly protocol $ARGUMENTS
Bootstrap: curly protocol bootstrap
Search: curly protocol "search?q=$ARGUMENTS"
Present the output. If search results contain protocol refs (@repo/slug), offer to fetch the most relevant ones.
SKILL
```
Then use:
- `/protocol bootstrap` — load core protocols at session start
- `/protocol testing` — search by keyword
- `/protocol @protocol/orchestrate` — fetch a specific protocol
## OpenClaw — `protocol` skill
```bash
mkdir -p ~/.openclaw/skills/protocol/scripts && \
cat > ~/.openclaw/skills/protocol/SKILL.md << 'SKILLMD' && \
cat > ~/.openclaw/skills/protocol/scripts/run.sh << 'RUNSH'
---
name: protocol
description: "Search, fetch, and bootstrap protocols from protocol.supply — on-demand knowledge for any task. Use before unfamiliar work: testing, deployment, auth, database, API design, refactoring, CI/CD. Subcommands: 'get @repo/slug', 'search <query>', 'bootstrap'."
---
# protocol
On-demand knowledge for AI agents. Search before unfamiliar work.
Run via `{baseDir}/scripts/run.sh`:
- **get <ref>** — `{baseDir}/scripts/run.sh get @protocol/orchestrate`
- **search <query>** — `{baseDir}/scripts/run.sh search "testing patterns"`
- **bootstrap** — `{baseDir}/scripts/run.sh bootstrap`
SKILLMD
#!/bin/bash
set -e
COMMAND="$1"; shift
case "$COMMAND" in
get) curly protocol "$1" ;;
search) curly protocol "search?q=$(printf %s "$@" | jq -sRr @uri)" ;;
bootstrap) curly protocol bootstrap ;;
*) echo "Usage: $0 [get|search|bootstrap] <args>" >&2; exit 1 ;;
esac
RUNSH
chmod +x ~/.openclaw/skills/protocol/scripts/run.sh
```
Then use:
- `protocol bootstrap`
- `protocol search testing`
- `protocol get @protocol/orchestrate`
## Codex — AGENTS.md
Codex reads instructions from two places and concatenates them:
- **User-level:** `~/.codex/AGENTS.md` (or `AGENTS.override.md`, which wins when present; `CODEX_HOME` moves the directory). Put the snippet here and every project gets it.
- **Project-level:** an `AGENTS.md` in each directory from the repo root down to where Codex was launched — at most one file per directory.
The combined instructions are capped at 32 KiB (`project_doc_max_bytes`); past that Codex silently truncates. One more reason the file should hold the snippet, not the knowledge.
**Allow network.** Codex's default `workspace-write` sandbox blocks network for commands, so `curly` fails until you allow it in `~/.codex/config.toml`:
```toml
[sandbox_workspace_write]
network_access = true
```
**Optional skill.** Codex loads user skills from `~/.agents/skills/` (repo skills from `.agents/skills/`). A `protocol` skill gives it a named entry point:
```bash
mkdir -p ~/.agents/skills/protocol && cat > ~/.agents/skills/protocol/SKILL.md << 'SKILL'
---
name: protocol
description: Search and fetch protocols from protocol.supply — on-demand knowledge. Use at session start (bootstrap), before unfamiliar work (search), or when a protocol ref like @repo/slug is named (fetch).
---
Bootstrap: curly protocol bootstrap
Search: curly protocol "search?q=<keywords>"
Fetch: curly protocol @repo/slug
Present the output. If search results contain refs (@repo/slug), fetch the most relevant one.
SKILL
```
On Windows the same files live under `%USERPROFILE%\.codex\` and `%USERPROFILE%\.agents\skills\` — see `@protocol/windows`.
## Cursor (.cursorrules) / ChatGPT (custom instructions) / others
The Universal snippet above works as-is. Paste it in — Cursor also reads `AGENTS.md`.
## What happens on bootstrap
The `bootstrap` response (~15 KB anonymous; yours grows with your own includes, configured at protocol.supply/settings/bootstrap) gives your agent:
1. **Core protocols** — full content of essential workflows (inline)
2. **Index** — titles and descriptions of all protocols (for discovery)
3. **Trigger map** — situation → protocol lookup table
## Private protocols
If your token has access to a private repo, include it in bootstrap:
```bash
curly protocol "bootstrap?include=@me" # Personal repo
curly protocol "bootstrap?include=@me,@my-team" # Personal + team
```
Your agent searches private protocols alongside public ones via the same search endpoint.
## Verify
```bash
curly protocol bootstrap
```
Should return `# protocol — On-demand knowledge for AI agents`. You're set.
---
**Onboarding?** If an onboarding impulse sent you here, log this step on it and move its cursor — the impulse, not this page, says what comes next ([`@protocol/onboarding`](/@protocol/onboarding)).
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*