Skip to content
The 31 guidesFREN中文
Guides
Part 4 · guide 1 of 8 Level: Intermediate Reading time: 15 min

Setting up your agents

Give your agent more tools, connect it to your data, delegate to sub-agents, and tighten its permissions. How to go from a default agent to one tailored to you.

In this guide
  1. 01Giving it more tools via MCP
  2. 02Sub-agents: delegate to stay clean
  3. 03Tightening permissions
  4. 04Config and memory
  5. 05Claude Code, Codex and OpenCode, side by side
  6. 06The steps to follow
  7. 07Frequently asked questions

In short

To tailor a coding agent to your needs, you work four levers: MCP servers that add tools (GitHub, databases, a browser), sub-agents that take on searches and parallel tasks, permissions that set what it may do without asking, and memory files that remind it of your rules every session. Start read-only, with as few tools as possible, and test on a small task before any serious use.

Do this first: What is an AI agent?Installing the agent (very early)

You now know what an agent is: a model, some tools, and a loop that keeps it going until the goal is reached. With Claude Code, Codex or OpenCode freshly installed, you already have a perfectly functional agent, file system, terminal, git, search. But it’s the default agent, everyone’s agent. This guide is the step up to your agent: we enrich its tools, plug it into your data, and shape its behavior so it works the way you want.

Giving it more tools via MCP

The most powerful lever is called MCP: Model Context Protocol. It’s an open standard that has become the universal socket between an agent and the rest of the world. The idea: instead of coding a custom integration for each service, you add a small program, an MCP server: and the agent instantly gains a handful of new actions.

The concept is clearer with examples. Connect your agent to Postgres, and it can query your database directly: “how many orders yesterday?”, it writes the query and answers you. Connect it to GitHub, and it manages your issues and pull requests without leaving the terminal. Plug in a web search server, access to your file system, your ticketing tool, your own homemade service: each MCP server is another arm for the agent.

Claude Code, Codex and OpenCode all support MCP. In practice, you declare a server in your agent’s config (a name, a command to run, sometimes an API key), you restart, and the new tools appear. The common servers, filesystem, GitHub, Postgres, Slack, already exist; you write nothing, you just point to them.

What people actually plug in

The list of available servers grows every month. The most useful day to day:

ServerWhat the agent can do
Meta AdsRead a campaign’s spend, ad review status, pause or restart delivery
GitHubOpen and comment on issues, read a pull request, follow the actions
Postgres, SQLiteQuery your databases in plain language, without writing the SQL yourself
A browser (Playwright, Puppeteer)Open a page, click, fill a form, capture the screen
Slack, TelegramRead a thread, post a message, alert you
The filesystemRead and write inside one directory you name

The Meta server is a good case study, because it shows the value and the danger in the same gesture. An agent that queries it spots in three seconds that a campaign has been paused for two days, something a human only sees by opening the ads manager and looking in the right place. That same agent can restart the campaign, and spend your money.

Claude Design: when the output is not text

An agent produces code, files, messages. It can also produce visuals.

Claude Design is Anthropic’s mockup tool, in beta on the Pro, Max, Team and Enterprise plans. It lives at claude.ai/design, and Claude Code reaches it directly: the /design command followed by a brief (“/design a settings screen for a banking app”) has the agent draw on a canvas, several artboards laid side by side. You open the result in a browser, select an element, change it, and your edits save on their own. Each artboard exports to PNG or PDF.

The shift is in that handover. Fixing one visual detail produced by an agent used to mean rephrasing the request and hoping the rest stayed put. Here you adjust exactly what bothers you. It also works the other way: a finished mockup in Claude Design can be sent to Claude Code to be built, and /design-sync uploads your repo’s React component system so the mockups use your real components.

Useful for interface mockups, screen flows, a landing page, social graphics, a poster. Keep in mind it is a beta: the tool moves fast, and /design needs a recent version of Claude Code.

Sub-agents: delegate to stay clean

An agent can call on sub-agents: auxiliary agents that it launches itself, each with its own brand-new context and a precise mission. A sub-agent that goes off to dig through the codebase while the main one keeps going. A “reviewer” sub-agent dedicated to code review. A sub-agent that tests a hypothesis in parallel.

Why does this matter? For two very concrete reasons. First, it keeps the main context clean: the wide-ranging search through fifty files happens inside the sub-agent’s head, which only reports back the conclusion. The main thread doesn’t drown in details. Second, it parallelizes: three sub-agents working at the same time on three independent pieces is three times faster.

Claude Code formalizes this with sub-agents and custom agent types (an “explorer” agent, an “architect” agent…), each with its own tools and its own instructions, stored in .claude/agents/ (project) or ~/.claude/agents/ (global). The easiest way to create one: describe it to Claude, which writes the file. Codex works the same way: it spawns sub-agents (the /agent command switches between them), and your custom agents are small TOML files stored in .codex/agents/ (project) or ~/.codex/agents/ (global). We’ll cover the concrete patterns, when to delegate, how to frame a sub-agent, in the next guide. For now, just remember the capability exists: your agent isn’t alone, it can put together a small team.

Tightening permissions

This is the single most important setting, and the one most often neglected. An agent acts, so it can break things. Tightening its permissions means deciding which tools and commands it’s allowed to run freely, and which require your go-ahead. This is, very concretely, where you set the autonomy dial we talked about in the previous guide.

The building blocks are the same everywhere:

  • The allowlist. You approve in advance the harmless, reversible actions: reading files, running the tests, doing a git status. The agent chains them without interrupting you.
  • The “ask before X” rule. For anything that modifies or destroys, deleting, pushing to a remote branch, touching the network, installing a package, the agent stops and asks. This is the everyday setting: smooth on the harmless, cautious on the rest.
  • Never root blindly. Never let an agent chain sudo commands without review. A badly formed privileged command doesn’t break a project, it breaks the machine.
  • Confine the working directory. The agent works in your project folder and nowhere else. An agent that can only write under ~/projects/my-app can’t, even by mistake, touch anything elsewhere.

Config and memory

At startup, your agent reads its configuration and its memory files. That’s where the permanent instructions live: “this project uses pnpm, not npm”, “write commit messages in French”, “never touch the legacy/ folder”. You write it once, the agent remembers it every session, without you having to repeat it. That’s what turns a generic agent into one that knows your project and your habits.

We won’t detail it here, memory has its own complete guide, in Memory files. Remember the roles: config defines what the agent can do and with which tools, memory defines what it permanently knows about your world.

Claude Code, Codex and OpenCode, side by side

All three agents share the same philosophy, each with its own ecosystem. And they don’t offer the same models: Quelle IA’s coding tools page (in French) lists which models you’ll find in which tool (Claude Code, Codex, OpenCode, Cursor…), with each one’s score.

Claude Code comes with a rich, integrated ecosystem: MCP out of the box, sub-agents and custom agent types, hooks on events, skills (which have absorbed custom commands) and plugins that bundle it all. All the config, MCP servers, permissions, agents, memory, lives in the .claude/ folder (at the project level) or ~/.claude/ (global, across all your sessions).

For the exact format of each file (MCP declaration, sub-agent definition, hook syntax), refer to the official docs, links in Resources. It moves fast, better to go to the source.

The steps to follow

Here’s the checklist to go from the default agent to one tailored to you.

0 of 5 steps done Your ticks stay in this browser.

  1. Decide which tools it needs

    Start from the task at hand, the tech will follow. Do you want it to query your database? Manage your GitHub issues? Search the web? List the missing capabilities, they dictate what comes next. No need to plug in everything “just in case”: each tool added is one more door to watch.

  2. Plug in an MCP server if useful

    For each capability you spotted, check whether a ready-made MCP server exists (filesystem, GitHub, Postgres, Slack… there are dozens). Declare it in your agent’s config following the up-to-date format in its docs, restart, and verify the new tools appear.

  3. Set the permissions and the allowlist

    Before any serious use: decide what goes through without asking (reads, tests) and what requires your approval (deletion, push, network, sudo). Confine the working directory. When in doubt, tighten, you can loosen later. The details are in Securing access.

  4. Lay down memory and rules

    Write the permanent instructions in the memory file: project conventions, preferred tools, off-limits areas. That’s what saves you from repeating the same things every session. See Memory files.

  5. Test on a small task

    Don’t launch your freshly configured agent on the big job. Give it a tiny task first that exercises the new tools, “list me the last 5 issues”, “how many rows in the users table”. You check that everything’s plugged in, that the permissions trigger as expected, and you fix things calmly.

You now have an agent that’s like you: the right tools, the right data, the right limits. What’s left is learning to make it live in a real project: where to put the files, how the team shares the config, which sub-agent patterns work day to day.

Frequently asked questions

Do Claude Code, Codex and OpenCode all support MCP?

Yes, all three support MCP. You declare the server in your agent's configuration (a name, a command to run, sometimes an API key), restart, and the new tools show up. Common servers such as filesystem, GitHub, Postgres or Slack are ready-made. The exact syntax varies by agent and version, so take it from your agent's up-to-date docs.

Is it risky to connect an MCP server to a real account?

Yes: the agent gets the same powers as the key you give it. A Meta key lets it create ads or change budgets, a GitHub key lets it push code. Use a dedicated service account with the narrowest possible scope, and keep manual approval on anything that costs money or is publicly visible.

Where do custom sub-agents go in Claude Code and Codex?

For Claude Code, in .claude/agents/ at project level or in ~/.claude/agents/ for all your sessions; the easiest way is to describe the agent you want to Claude, which writes the file. For Codex, they are small TOML files stored in .codex/agents/ or ~/.codex/agents/, and the /agent command switches from one sub-agent to another.

Which permission setting should I use day to day with Codex?

Codex combines a sandbox (read-only, workspace-write or danger-full-access) with an approval policy (on-request or never). The everyday setting is codex --sandbox workspace-write --ask-for-approval on-request: it works freely in the project folder and asks before leaving it or going on the network. The /permissions command adjusts all of this during a session.

What are a coding agent's hooks for?

Hooks plug your own scripts into the agent's events: run the linter after each modified file, play a sound when a task ends, refuse a commit that contains a secret. The harness itself triggers them, regardless of what the model decides, which makes them reliable. The exact format is in your agent's docs.

Terms in this guide: AgentClaude CodeCodexOpenCodeGitMCPAPI keyRepository (repo)Sub-agentMemory fileCommit

Spotted a mistake?

A command stopped working, a price changed?

Tools change every month. Tell me what is wrong in this chapter and I will fix it and update its date.

Only the page, your message and the optional contact are kept. Nothing else.

Guide 19 of 31 · part 4 no guides read yet Open the list of guides