Skip to content

Tool Configuration Reference

This page is the single source of truth for how each major agentic coding tool implements the universal patterns described in this guide. Every concept — configuration files, skills, sub-agents, context management — exists in some form across all tools. The names and file paths differ; the ideas do not.

Bookmark this page. When another section says “see your tool’s configuration file” or “use the plan mode for your tool,” come here for specifics.


The “agent configuration file” is a markdown file that loads automatically at the start of every session. It is the always-available context: project structure, build commands, coding conventions, and anything the agent needs to know in every interaction. See Agent Configuration Files for what to put in this file.

ToolFileLocationHierarchy Support
Claude CodeCLAUDE.mdProject root + subdirectoriesYes — auto-loads root, then working directory, plus any @imported files
OpenAI CodexAGENTS.mdProject root; ~/.codex/AGENTS.md for globalYes — global → project → subdirectory override chain
Gemini CLIGEMINI.md or AGENT.mdProject root; ~/.gemini/GEMINI.md globalYes — global → project; more-specific files override general ones
AiderCONVENTIONS.mdProject root (loaded via --read)Partial — manual inclusion; .aider.conf.yml for auto-loading
Cursor.cursorrules or .cursor/rules/*.mdcProject root / .cursor/rules/ directoryYes — per-directory rule files with glob-based auto-attach
Windsurf.windsurfrulesProject root; global_rules.md for globalYes — global rules + project rules merged
GitHub Copilot.github/copilot-instructions.md.github/ directoryPartial — single file per project, no subdirectory hierarchy
opencodeAgent config in opencode.jsonProject rootYes — custom agents with per-agent system prompts

File: CLAUDE.md in the project root. Subdirectories can contain their own CLAUDE.md files, which are loaded in addition to the root when the agent’s working directory is inside that subdirectory. Use @path/to/file to import other files.

# Project: Payments API
## Tech Stack
- Runtime: Node.js 22 / TypeScript 5
- Framework: Fastify
- Database: PostgreSQL via Drizzle ORM
- Testing: Vitest + Supertest
- Package manager: pnpm
## Commands
- Dev: `pnpm dev`
- Test: `pnpm test`
- Test single: `pnpm vitest run path/to/test`
- Typecheck: `pnpm tsc --noEmit`
- Lint: `pnpm lint`
## Architecture
- src/routes/ — Fastify route handlers, one file per resource
- src/services/ — Business logic, no direct DB access
- src/repos/ — Database layer via Drizzle
- src/types/ — Shared TypeScript interfaces
## Conventions
- Result<T, E> pattern for error handling — never throw
- All endpoints must have integration tests in tests/integration/
- Use zod for all external input validation

Global instructions go in ~/.claude/CLAUDE.md and apply to every project.


A skill is context loaded only when relevant — not every session. This keeps the always-loaded configuration file small and high-signal, while still making detailed domain knowledge available when needed. See Skills & Agents Architecture for the full pattern.

The concept is universal; the file paths and invocation mechanisms vary by tool.

Location: .claude/skills/<name>/SKILL.md

Invocation: Skills double as slash commands — /skill-name invokes the skill. The agent also loads relevant skills automatically based on the task description.

.claude/skills/db-migrations/SKILL.md
---
name: db-migrations
description: Database migration conventions and procedures
---
# Database Migration Conventions
## Creating a migration
1. Run `pnpm drizzle-kit generate` to create migration files
2. Review the generated SQL in drizzle/migrations/
3. Test against a local Postgres instance: `pnpm db:migrate:dev`
4. Never hand-edit generated migration files
## Naming conventions
- Migrations are auto-named by Drizzle based on schema diff
- Add descriptive comments to complex migrations
## Rollback
- All migrations must have a corresponding down migration
- Test rollbacks in local environment before deploying

Invoke with: /db-migrations or reference by name in a prompt.


Sub-agents are specialized AI instances that run in their own context window with their own tool permissions. The key benefit is context isolation: research or review work does not pollute the main agent’s conversation history. See Sub-Agent Context Isolation for the architecture rationale.

Location: .claude/agents/<name>.md

Claude Code sub-agents are defined as markdown files with YAML frontmatter. The orchestrating agent spawns them via the Task tool; they run in isolated context and return a result.

.claude/agents/security-reviewer.md
---
name: security-reviewer
description: Reviews code changes for security vulnerabilities and returns a structured report
tools: Read, Grep, Glob, Bash
model: claude-sonnet-4-5
---
You are a senior security engineer. Review the specified code for:
## Checklist
- [ ] Injection vulnerabilities (SQL, XSS, command injection)
- [ ] Authentication and authorization flaws
- [ ] Secrets or credentials hardcoded in source
- [ ] Insecure data handling (PII exposure, missing encryption)
- [ ] CSRF protection on state-changing endpoints
## Output Format
For each finding: Severity (Critical/High/Medium/Low), file:line, description, suggested fix.

The main agent invokes this with: “Use the security-reviewer agent to review the changes in src/payments/.”


How each tool handles the most common context management operations:

ActionClaude CodeOpenAI CodexGemini CLIAiderCursorWindsurf
Clear context/clearStart new session/clear/clearNew chatNew chat
Compact context/compactAutomaticAutomaticN/AAutomaticAutomatic
Plan / read-only modeCtrl+G or say “plan mode”--approval-mode planN/A (use prompting)/architectAgent mode toggleCascade (always agentic)
Named sessions--session <name>Tab management in UISession tabsN/AChat history panelChat history panel
Show token usageShown in UIShown in UI--debug flagShown in UIShown in UIShown in UI
Abort current actionEscapeCtrl+CCtrl+CCtrl+CEscapeEscape

Plan mode (read-only / no-edit mode) is one of the highest-leverage context management techniques in this guide. It prevents the agent from making premature edits and forces research and planning to happen in a separate phase.

Toggle plan mode with Ctrl+G or by saying “enter plan mode” / “let’s plan this without making changes.” In plan mode, Claude Code can read files and reason but will not edit them.

The three-phase workflow (Research → Plan → Implement) uses plan mode explicitly between phases. See The Three-Phase Workflow.


Common operations across tools for headless / scripted / session usage:

Terminal window
# Interactive session
claude
# Named session (resumable)
claude --session my-feature
# Start with an initial prompt
claude "Research how the payment flow works"
# Non-interactive / pipe a prompt
echo "List all TODO comments in src/" | claude --print
Terminal window
# Use a specific model
claude --model claude-opus-4-5
# Or set in environment
export ANTHROPIC_MODEL=claude-opus-4-5
claude

In agent definition files, set model: in the YAML frontmatter to assign a model per sub-agent — use a more capable model for complex reasoning, a lighter model for read-only review tasks.

Headless mode is useful for CI pipelines, automated review tasks, or chaining agents in shell scripts.

Terminal window
# Print mode — outputs result to stdout, no interactive loop
claude --print "Review src/payments.ts for security issues"
# Pipe output to a file
claude --print "Generate a test plan for the checkout flow" > test-plan.md
# In CI — combine with --no-interactive
claude --print --no-interactive "Run the linter and fix any errors"