medium.com 43 min read Original Source

A Blueprint for Agentic Coding Tools

This article is not about teaching you how to vibe code, it’s how to use the AI coding tools themselves — Codex and Claude Code together — which is turning into a science of its own at this point.

I’ve done a lot of research while building over the last few months (and years) and I think I’ve dumped around 35,000 words in a document. This is me trying to clean that up and make it easy for people to understand.

I will go through things like setting permissions and sandboxing, what people say about the AGENTS.md file and what it looks like, what rules are, how to set up your project’s source of truth, and how memory works.

But also how to build subagents and skills, which one you need for which task, how to mix the two, along with what the community says about building these and what it looks like to run.

I’m also sharing links to bigger projects and deciphering popular bundled skills and commands like /loop, /goal, and /batch.

I wanted to build the material I wish I’d had when I started, so this is for anyone starting to build with agents in the space who needs it.

I’m breaking down the article into levels, so skip what you already know. I am waiting with some more intermediate topics, as it’s already pretty long as it is.

I should note that I don’t believe a bloated harness is useful, however it is still important to understand the capabilities available.

Level 1.0: Permissions & sandboxing

YOLO mode or safety mode, it’s up to you to set what you want these agents to access. With Claude code you need to tweak your settings.json file, and with Codex you need to specify a config.toml file.

When you start working with these tools, and you grant access, you’re not just granting access to the project folder, by default it can read anywhere on your computer.

You need to specify how these tools are allowed to move around and what they are allowed to read and edit. This is important for various reasons, such as not wanting these tools to be able to read .env files or local secrets.

This is basic stuff, but if you’re just starting out, I’ve gathered a document on boilerplate settings and configs for both Claude Code and Codex here.

But let’s start by mentioning the working modes for Claude Code. These are usually Edit, Ask, Auto. The main one right now is Auto, this one executes actions approved by an automatic safety check (through a classifier I believe).

For Auto and Edit, you still need to set up a settings.json file for your specific allow, ask, and deny lists. This you do by creating it globally in ~/.claude/settings.json or for the project only at .claude/settings.json.

Here you can set general permissions and sandboxing. Permissions will say what actions Claude can take, and for which tools, while the sandbox makes sure an allowed command doesn’t reach outside of the project itself.

Once it’s on, the sandbox will deny writes, but reads are still allowed everywhere, so it can navigate wherever it needs to. This is why you can set denyRead lines.

So yes, this means that if you don’t turn on the sandbox, it is off. No one sets this up for you. So, if you want to make sure your agent doesn’t touch certain things, make sure to create this file before you start working.

I don’t want to clutter this article, so the boilerplate JSON you can use, you can find here.

For Codex, you need to set another file called config.toml. One global configuration applies to all local Codex projects: ~/.codex/config.toml

For Claude Code we can specify allowances for certain commands like git commit and add. For Codex we either allow git altogether or have it ask before. I always have my agents commit work they do, it’s the best way to backtrack bad work, so for me I want it to generally be able to add and commit, but not push or backtrack without my knowledge.

Once you’ve set it up for both tools, remember to test your setup before you call it successful.

Though some argue this is the basics (protection against accidental leaks) it won’t always protect you from prompt injections and other malicious behavior.

I should note that there are more things you can set in these config and settings files, such as what your default model is, what kind of writing style you want, and then other settings we’ll get to for agents and Skills.

To conclude, remember to read the repo I shared to understand how to set up your settings and configs. It’s a you problem to make sure your agent doesn’t touch something you don’t want it to touch; it doesn’t come out of the box.

If you have more information, or you think I should tweak something, be sure to comment.

Level 1.1: The main AGENTS.md

The main AGENTS.md file is optional but should be small and there to orient your agent around your project while referencing elsewhere for larger documents.

For anyone new to the main AGENTS.md file, when you build with these agents you usually have a main smaller file that is always loaded into the context. It should have instructions that help the agent work correctly within the project.

Right now you can simply create an AGENTS.md file that both Codex and Claude Code use inside your project. This file should be under 200 lines, because longer files take more context and are followed less reliably.

project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional
project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional

What we put in these documents is mostly important commands, how to work in the project, unusual conventions, where key systems live, things that must never be changed casually. For information on principles, architecture, design you should use other files that you reference from here that I’ll talk about in a bit (so this file is more of an index).

You’ll see bits of an AGENTS.md file for an iOS app below that I’ve worked on.

# Project instructions

## What this project is
[...] iOS app.

## Commands
- Dev on device: `nvm use 22 && npx expo start --dev-client`
- Rebuild the dev client `nvm use 22 && eas build --profile development --platform ios`
- Typecheck: `nvm use 22 && npx tsc --noEmit`
- Widget/Live Activity layouts: `npm run check:widget` after ANY edit to `src/widgets/`
- Dependency health: `npm run doctor` (expo-doctor).
- Release: `eas build --platform ios --profile production --clear-cache` → TestFlight.

## Gotchas
- Package versions are pinned to a known-good SDK 55 baseline (an iOS 26 crash traced to dependency
drift — `docs/PACKAGE-BASELINE-SDK55.md` has the story and the rollback). Dependency changes go
through the user first.
- Don't touch /docs/legacy files, they are stale

## How we work in this repo
- Changes land one at a time: build it → typecheck → commit with a what+why message → the user
verifies on device → next change.
- Every distinct change gets its own commit, and notable ones get a `docs/CHANGELOG.md` entry the same day
— `git log` + the changelog read as the story of the app, which is what makes rollbacks surgical.
- change architecture (agreed with the user FIRST — structural
calls are never made unilaterally) → update the implementation → update `docs/ARCHITECTURE.md` → verify
- The standing rules the loop protects (state ownership, local-first, the invariants) live in `docs/PRINCIPLES.md` — check a planned
change against it before building.
- Docs hygiene rides on every commit (a post-commit hook in `.claude/settings.json` injects the
routed checklist — act on it in the same turn). [...]
- Comment budget: lean. Default is no comment — naming and structure carry the what. Comment only a
constraint the code can't show (a native/timing race, an ordering requirement, a standing invariant),

## Project documentation
- `docs/PRINCIPLES.md` — how we build and the rules we don't break (state ownership, local-first,
  invariants, how to approach a new problem).
- `docs/ARCHITECTURE.md` — canonical current-state: screens, stores, proxy API, media identity,
  persistence, canvas patterns.
- `docs/BUGS.md` — the bug register with statuses.
- `docs/CHANGELOG.md` — dated log, newest first; notable changes get an entry.
- `docs/PENDING-FIXES.md` — agreed-but-unbuilt fixes, priority index on top. Check it before touching
  the code an entry names; a shipped fix leaves this file in the same commit.

[...]
# Project instructions

## What this project is
[...] iOS app.

## Commands
- Dev on device: `nvm use 22 && npx expo start --dev-client`
- Rebuild the dev client `nvm use 22 && eas build --profile development --platform ios`
- Typecheck: `nvm use 22 && npx tsc --noEmit`
- Widget/Live Activity layouts: `npm run check:widget` after ANY edit to `src/widgets/`
- Dependency health: `npm run doctor` (expo-doctor).
- Release: `eas build --platform ios --profile production --clear-cache` → TestFlight.

## Gotchas
- Package versions are pinned to a known-good SDK 55 baseline (an iOS 26 crash traced to dependency
drift — `docs/PACKAGE-BASELINE-SDK55.md` has the story and the rollback). Dependency changes go
through the user first.
- Don't touch /docs/legacy files, they are stale

## How we work in this repo
- Changes land one at a time: build it → typecheck → commit with a what+why message → the user
verifies on device → next change.
- Every distinct change gets its own commit, and notable ones get a `docs/CHANGELOG.md` entry the same day
— `git log` + the changelog read as the story of the app, which is what makes rollbacks surgical.
- change architecture (agreed with the user FIRST — structural
calls are never made unilaterally) → update the implementation → update `docs/ARCHITECTURE.md` → verify
- The standing rules the loop protects (state ownership, local-first, the invariants) live in `docs/PRINCIPLES.md` — check a planned
change against it before building.
- Docs hygiene rides on every commit (a post-commit hook in `.claude/settings.json` injects the
routed checklist — act on it in the same turn). [...]
- Comment budget: lean. Default is no comment — naming and structure carry the what. Comment only a
constraint the code can't show (a native/timing race, an ordering requirement, a standing invariant),

## Project documentation
- `docs/PRINCIPLES.md` — how we build and the rules we don't break (state ownership, local-first,
  invariants, how to approach a new problem).
- `docs/ARCHITECTURE.md` — canonical current-state: screens, stores, proxy API, media identity,
  persistence, canvas patterns.
- `docs/BUGS.md` — the bug register with statuses.
- `docs/CHANGELOG.md` — dated log, newest first; notable changes get an entry.
- `docs/PENDING-FIXES.md` — agreed-but-unbuilt fixes, priority index on top. Check it before touching
  the code an entry names; a shipped fix leaves this file in the same commit.

[...]

I also have instructions on how I want it to commit work, where it should write bigger visual changes, where to report on bugs, and how to verify its work (though there are better ways to go about it), so basically how I want it to work with the project.

The key thing is that you should not tell the agent how to do proper software engineering, instead this file should work more around instructions pertinent to your project and your way of working.

The file that I share above probably isn’t following the best conventions, it’s just one I had for a project I finished.

There is some useful evidence from Stride with their analysis in September 2026 of 7,370 public GitHub repos. What they found was that 73.5% named a test, build, or lint command, 39.3% mentioned security or secrets, and 10.6% explicitly prohibited leaking secrets.

The median file was around 819 words, 105 lines.

Their AGENTS.md files named testing instructions (55.7%), code style and conventions (54.3%), project structure (54.3%), Git and pull-request procedures (47.6%) and commands (44.0%).

It’s kind of interesting that not everyone is using the same structure and what people commonly write is not necessarily what research suggests they should write either.

My agent gathered more research here that you can look over if you want to read more.

In essence though, keep this file small and add things as you go, keep it as slim as possible while making sure your agent understands how to orient itself for new sessions.

Level 1.2: Running /init on a project

It’s worth covering /init in Claude Code that proposes a starter CLAUDE.md file for legacy projects, but it can be a bit messier than one would like.

Claude Code’s /init inspects an existing repository and then creates a starter instructions file for you. Now it also has newer interactive functionality where it proposes Skills and hooks for you.

Re-running it on a project that already has a CLAUDE.md suggests specific changes rather than create it again.

I’ve tried this on one of the messiest projects I’ve built and it turned out pretty badly. Maybe running it on a cleaner project would do better.

But frankly most software is messy like this. Most truth lives in someone’s head, and people just know that file is connected to another file and to another file, but it took them a bit of working with the project and with their team to build that causal model in their head.

This process is something that agents shortcut, and in doing so will get some stuff right and some things wrong. It’s pretty vital to not document this contradiction, as it’s the first thing your agent will go for later, and you’ll tear your hair out trying to figure out why it fails all the time.

Your source of truth should ideally be vetted by you, and if you can’t do it at all, it’s better not to have an agent build something lackluster.

The research is also pretty critical of this.

A Zurich paper, Evaluating AGENTS.md, from February this year looked at issues such as overviews frequently repeating information already present in the codebase (which then becomes redundant), while stressing that /init can’t discover product decisions and domain understanding that are not represented in the repository.

That is, if the codebase doesn’t have the documentation needed to build that casual model, it won’t be able to build a good review, and if it does then the review may be redundant (as the code is already a source of truth).

For a clean project it’s worth a try as long as you have the patience to vet that information that is written, because having contradicting documentation with AI agents is worse than having no documentation at all.

Level 1.3: How to use Rules

If you have instructions you want to fire for the agent when working on specific files, then you set Rules. Here you need to structure it a bit differently for Codex and Claude Code.

Imaging your project is growing, and you have a repository containing a frontend, backend, and billing system, and each part should have different instructions on how to work.

This means that context should only get injected for certain paths. To do this in Claude Code you set your specific instruction files under .claude/rules/

project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional
├── .claude/
│   ├── rules/ # specific instructions (Claude)
│       ├── subscriptions.md
│       ├── billing-system.md
│       └── backend.md
project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional
├── .claude/
│   ├── rules/ # specific instructions (Claude)
│       ├── subscriptions.md
│       ├── billing-system.md
│       └── backend.md

Each file then sets markdown rules with a paths field.

---
paths:
  - "src/subscriptions/**/*.ts"
---

When working on subscriptions remember the rules (whatever they are)
---
paths:
  - "src/subscriptions/**/*.ts"
---

When working on subscriptions remember the rules (whatever they are)

As with anything here, you still need to test this to make sure it fires correctly. You can simply ask your agent to read a file and then ask it about the rules.

For Codex, it’s a bit tricker if you want to do this, you need to set an AGENTS.md file for each folder where you want it to fire.

project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional
├── .claude/
│   ├── rules/ # specific instructions (Claude)
│   │  ├── subscriptions.md
│   │  └── audio-pipeline.md
│   └── settings.json
├── .codex/
│   └── config.toml
├── src/
│   ├── audio/
│       ├── AGENTS.md # specific instructions (Codex)
│       └── script.ts
project/
│
├── AGENTS.md # always loaded
├── CLAUDE.md # now optional
├── .claude/
│   ├── rules/ # specific instructions (Claude)
│   │  ├── subscriptions.md
│   │  └── audio-pipeline.md
│   └── settings.json
├── .codex/
│   └── config.toml
├── src/
│   ├── audio/
│       ├── AGENTS.md # specific instructions (Codex)
│       └── script.ts

That is, if you want specific instructions injected for the /audio folder, you set the file there.

There is a limitation though, starting Codex at the project root does not guarantee that src/audio/AGENTS.md is automatically injected later when the agent edits src/audio/generation.ts

I have not tried this with Codex, so you need to test it out on your own. Maybe try setting AGENTS.override.md to see if that helps, but that will override the main AGENTS.md file when working in that folder.

Before you jump on this though, I need to mention that once your documentation grows it becomes more likely that you’ll have configuration drift and stale instructions across different agents. This can be a huge failure mode.

An agent may follow a CLAUDE.md instruction referencing a component or architecture that no longer exists. The result can look like hallucination even though the agent is following its supplied context.

There are some smaller projects that work on this, such as Stemma (how to maintain shared instructions across different coding agents), and config-drift-checker (to understand what each configured coding agent can load, why it is included, and what that repeated context could cost).

As for me, I use hooks to clean up documentation, but it costs tokens to have agents so focused on clean up. So, to each their own.

So, rules can separate context that should be injected for certain folders and paths, to be sure it follows rules when working on specific parts of the project. But adding on more and more docs can make it harder to clean up stale information.

Level 2: The project’s source of truth

Your docs folder should hold lengthier documentation, knowledge like principles, domain-model, architecture, and decisions. It is a way to persist knowledge across multiple-sessions and with several people.

Both Codex and Claude Code shares this folder, so they both know where to dig for information.

The source of truth will differ from Memory (which I’ll cover after this), because this folder holds information not just for one agent but everyone working within the project.

You can look at a neat structure for your source of truth below.

project/
│
├── AGENTS.md (always loaded)
├── docs/ (loaded on-demand)
│   ├── product.md
│   ├── domain-model.md
│   ├── architecture.md
│   ├── PRINCIPLES.md
│   ├── BUGS.md
│   ├── CHANGELOG.md
│   ├── PENDING-FIXES.md
│   │
│   └── decisions/
│   │   └── 001-character-voice-model.md
│   └── legacy/
│       └── handoff-activity-island-failure-11-11-2026.md
project/
│
├── AGENTS.md (always loaded)
├── docs/ (loaded on-demand)
│   ├── product.md
│   ├── domain-model.md
│   ├── architecture.md
│   ├── PRINCIPLES.md
│   ├── BUGS.md
│   ├── CHANGELOG.md
│   ├── PENDING-FIXES.md
│   │
│   └── decisions/
│   │   └── 001-character-voice-model.md
│   └── legacy/
│       └── handoff-activity-island-failure-11-11-2026.md

What you put in here will differ based on the project and how much information that is needed.

My agents keep pushing everything under the sun in this folder so instead of having something neat like above, I usually get something like this.

project/
│
└── docs/
    ├── legacy/
    ├── 2026-09-22-apple-subscriptions-integ...
    ├── ACCOUNT_SUPPORT_API.md
    ├── ARCHITECTURE.md
    ├── BUGS.md
    ├── CHANGELOG.md
    ├── CLEANUP.md
    ├── HANDOFF-REPORT-BLOCKED-VIDEO.md
    ├── LIVE-ACTIVITY.md
    ├── local-cache-and-project-load.md
    ├── PACKAGE-BASELINE-SDK55.md
    ├── PENDING-FIXES.md
    ├── POSTMORTEM-LOADING-2026-09-22...
    ├── PRINCIPLES.md
    ├── SKETCH-SYNC.md
    ├── SUBSCRIPTIONS_API.md
    └── VIDEO_ROUTER_DIRECTOR.md
project/
│
└── docs/
    ├── legacy/
    ├── 2026-09-22-apple-subscriptions-integ...
    ├── ACCOUNT_SUPPORT_API.md
    ├── ARCHITECTURE.md
    ├── BUGS.md
    ├── CHANGELOG.md
    ├── CLEANUP.md
    ├── HANDOFF-REPORT-BLOCKED-VIDEO.md
    ├── LIVE-ACTIVITY.md
    ├── local-cache-and-project-load.md
    ├── PACKAGE-BASELINE-SDK55.md
    ├── PENDING-FIXES.md
    ├── POSTMORTEM-LOADING-2026-09-22...
    ├── PRINCIPLES.md
    ├── SKETCH-SYNC.md
    ├── SUBSCRIPTIONS_API.md
    └── VIDEO_ROUTER_DIRECTOR.md

For some projects I clean it up and force it to push old docs into a legacy folder.

Make sure to set the correct documents in the AGENTS.md file that I introduced earlier. This one should reference the most important files such as architecture, domain model, principles that you put in the docs folder.

# AGENTS.md

[...]

## Project documentation
- `docs/PRINCIPLES.md` - how we build and the rules we don't break (state ownership, local-first,
  invariants, how to approach a new problem).
- `docs/ARCHITECTURE.md` - canonical current-state: screens, stores, proxy API, media identity,
  persistence, canvas patterns.
- `docs/BUGS.md` - the bug register with statuses.
- `docs/CHANGELOG.md` - dated log, newest first; notable changes get an entry.
- `docs/PENDING-FIXES.md` - agreed-but-unbuilt fixes, priority index on top. Check it before touching
  the code an entry names; a shipped fix leaves this file in the same commit.
# AGENTS.md

[...]

## Project documentation
- `docs/PRINCIPLES.md` - how we build and the rules we don't break (state ownership, local-first,
  invariants, how to approach a new problem).
- `docs/ARCHITECTURE.md` - canonical current-state: screens, stores, proxy API, media identity,
  persistence, canvas patterns.
- `docs/BUGS.md` - the bug register with statuses.
- `docs/CHANGELOG.md` - dated log, newest first; notable changes get an entry.
- `docs/PENDING-FIXES.md` - agreed-but-unbuilt fixes, priority index on top. Check it before touching
  the code an entry names; a shipped fix leaves this file in the same commit.

Remember the AGENTS.md file should work as an index to your source of truth.

You can also try to give your AGENTS.md file instructions on how to structure the docs, which I’ve tried on a few new projects (so you don’t get so much clutter in there).

Some people also separate their truth and their decision history in the docs, making sure to keep Architecture Decision Records (ADRs) documented. I find this quite interesting.

project/
│
├── docs/
│   │
│   └── decisions (ADRs)/
│   │   ├── 001-character-voice-model.md
│   │   └── 002-server-entitlements.md
project/
│
├── docs/
│   │
│   └── decisions (ADRs)/
│   │   ├── 001-character-voice-model.md
│   │   └── 002-server-entitlements.md

Let’s say you have a project where some things should live on the server, and some things should stay local. You’ve made these decisions with your agent in the past, and you’ve written an architecture docs to reflect this.

However, later on an agent decides that saving things locally seems more efficient. The architecture document tells it not to do that. The decision record would then explain why.

# decisions/002-server-entitlements.md
Status: Accepted
## Decision
Keep subscription entitlements server-authoritative.
## Reasons
- Notifications may arrive out of order.
- Users can have multiple devices.
- Event processing must be idempotent.
## Rejected alternative
Client-maintained credit balances with periodic synchronization.
# decisions/002-server-entitlements.md
Status: Accepted
## Decision
Keep subscription entitlements server-authoritative.
## Reasons
- Notifications may arrive out of order.
- Users can have multiple devices.
- Event processing must be idempotent.
## Rejected alternative
Client-maintained credit balances with periodic synchronization.

It’s something you can backtrack to instead of digging into old sessions or memory or spread out docs.

For some projects those decisions live in my head, which means I can get exhausted explaining something over and over again, having to go into the problem every time. Having a trail of decisions and why something works the way it does may help the amnesia problem.

If you want to be sure your agent gets the correct information, and looks in the right place, you can test if the agent discover the docs. Look into the some independent projects like trigger_tree, which works by tracking which local project documents an agent discovers.

Before I round off, I touched on this before, docs can go stale. If these agents keep adding documentation with new and contradicting information it will cause problems.

Level 2.1: How memory works

I’ve written about building memory systems in the past, but Claude Code works a bit differently writing information into .md files. The main memory file is small, while reference files can grow as the project grows.

Just as we work with the AGENTS.md file and the docs folder, the main memory file works as an index that should be smaller than 200 lines or 25 KB.

The main document then refers to other docs for more descriptive information. You’ll find them by navigating to ~/.claude/projects/<project>/memory/ and should be structured something like this:

<button data-code="~/.claude/projects//memory/
├── MEMORY.md
├── user_role.md
├── feedback_testing.md
└── …” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

~/.claude/projects/<project>/memory/
├── MEMORY.md
├── user_role.md
├── feedback_testing.md
└── ...
~/.claude/projects/<project>/memory/
├── MEMORY.md
├── user_role.md
├── feedback_testing.md
└── ...

For the reference files, Claude reads them when it thinks it needs to. There may be a classifier that loads reference files as well (though not confirmed).

If the project is small you’ll often only have one MEMORY.md file and not much referencing to other files.

The difference from the AGENTS.md file is that the agent writes and updates these files on its own. You can inspect them with /memory and edit if needed.

You’ll see the mess up there for an iOS app that I built that was pretty extensive. It has 36 reference files, and a lot of it is outdated information.

What it should be doing is saving memories of four types, how you prefer to work, corrections you’ve given it, ongoing work or decisions that aren’t obvious from the repository, and then where relevant information lives outside the repo.

You can see them classified as project, feedback, reference and so on.

If I analyze these documents from this project, most are on how to work with me, then about architecture rules and invariants, diagnoses to reuse, and then references to other files (backend API, Expo setup, codebase map).

A lot of the files are outdated and haven’t been edited in a long time.

I can find a codebase-map.md that describes the app from March which is no longer relevant, a designs.md file that still uses incorrect information that Claude have created by itself, and a file called openai_tool_calling.md which applies to a voice agent, which has been removed the first week of the project.

So an interesting theme with this one, and general docs too, is that it can be wrong and then stay that way.

The problem isn’t just that Claude might forget something. It can remember something that’s not correct, keep that mistake across sessions, and then use it as the basis for future work. You’ll experiences this as amnesia.

Session 1 → Claude concludes that the client owns a particular piece of state, even though the server actually owns it. You correct it.
Session 2 → The memory is loaded again, so Claude starts from the incorrect assumption. You correct it, but the old note isn't necessarily replaced.
Session 3 → The amnesia is back again and you have to keep correcting it.
Session 1 → Claude concludes that the client owns a particular piece of state, even though the server actually owns it. You correct it.
Session 2 → The memory is loaded again, so Claude starts from the incorrect assumption. You correct it, but the old note isn't necessarily replaced.
Session 3 → The amnesia is back again and you have to keep correcting it.

This is just something to keep in mind, and do better than me when you find it.

There is a bunch of practitioner-built memory systems that try to address this problem in different ways.

I found Dejavu, which tries to stop outdated information from continuing to influence the agent. Friday, which uses versioned facts so that an earlier decision can be replaced. Beacon, that tries to stop every conversation, including the agent’s mistaken conclusions, from automatically becoming permanent knowledge.

The key to remember is that not everything an agent learns should become a permanent fact, and not every previously saved fact should remain valid forever.

For Codex, I don’t have as much information on its memory system and I haven’t done as much research around it either, if you’ve done research please do comment.

Level 3: Planning a task with an agent

Planning is about deciding together how to approach a problem, though some people argue it’s about pushing the agent to stay with the problem for longer rather than jump into it right away.

To plan with agents you simply use /plan mode.

/plan figure out how to add subscription upgrades without
changing how existing subscriptions work.
/plan figure out how to add subscription upgrades without
changing how existing subscriptions work.

The key thing is that agents can still be capable at implementation while still making bad decisions about the problem they’re solving.

You can’t just say something like this and expect that it will read your thoughts.

Add the ability to upgrade a subscription in my iOS app.
Add the ability to upgrade a subscription in my iOS app.

You still need answer questions like what are the subscriptions and how should they work? Should certain functions be paywalled and how? What happens to unused credits if they user gets these? What happens if they downgrade? What happens if they upgrade?

It takes time to get good at planning with agents, because you don’t want to be too specific and you need to be specific enough so it understands what you want.

That is, mentioning something like “find all edge cases” is useless with an agent, you’ll get overwhelmed with information. But asking something like “if a user generates a video but it fails how are we planning on making sure that we return those credits?” then you can decide what should be done.

We can look into a study from June 2026 from Anthropic, that studied 400,000 Claude Code sessions, which found that humans contributed ~70% of planning decisions (what to build, which approach, what counts as done), with only ~20% of the execution decisions (which files to change, what code to write, which commands to run).

The planning stuff is what that the agent can’t reliably do on its own yet, which usually means system architecture, domain knowledge of the project, prioritization, and so on.

They found that people showing greater expertise in the task were more successful and better at recovering when the agent encountered problems. Expertise may not be coding expertise but also outcome expertise, product expertise, etc.

That is, an accountant who understands reconciliation rules can be much effectie at building accounting software. Someone with deep knowledge of UX for kids apps, will be effective at building kids apps.

I would think the higher the level of the task, the more judgment the agent needs.

But alas, this may change in time and certain things may move up to new abstraction levels.

I should mention a September 2026 paper An Empirical Study of Harness Design for Coding Agents that is relevant here.

They found that with weaker models, planning substantially improved success. Whereas, in stronger models planning generally reduced wasted work and cost, but had little effect on accuracy and sometimes even reduced it.

Both OpenAI and Anthropic have also warned in 2026 about overly elaborate instructions, long planning procedures and forcing agents to follow steps they don’t actually need.

So don’t just plan just because, do it when there is a concrete reason, such as needing to investigate unfamiliar code, explain the domain, compare architectural approaches, coordinate a complicated change, or establish how something can be verified.

Level 4: How to build subagents

Subagents are agents with their own context (usually). Think of it like branching off for a separate task than the main agent. They usually have their own instructions, tools, and can receive selected Skills.

You can have your main agent spawn agents on its own, and then you can use built-in agents like explore, plan, general-purpose, or you can build your own custom agent definitions.

If you want to create your own agents, you create a markdown file for Claude Code and a toml file for Codex.

Where you put your custom agents differs for these two but I’m guessing they’ll figure out how to reconcile this in the future.

your-project/
├── .claude/
│   └── agents/
│       └── ux-reviewer.md
└── .codex/
    └── agents/
        └── ux-reviewer.toml

~/.claude/
└── agents/
~/.codex/
└── agents/
your-project/
├── .claude/
│   └── agents/
│       └── ux-reviewer.md
└── .codex/
    └── agents/
        └── ux-reviewer.toml

~/.claude/
└── agents/
~/.codex/
└── agents/

For Claude Code, you need to specify at least name and description in the file but also what the agent should be doing.

---
name: ux-reviewer
description: Review implemented UI for product and UX problems
model: sonnet
effort: high
tools: Read, Grep, Glob, Agent
maxTurns: 12
---
Review the implemented UI against the product model
and the approved requirements.
Find concrete behavior or UX problems.
Return file references and describe the impact.
Do not edit the implementation.
---
name: ux-reviewer
description: Review implemented UI for product and UX problems
model: sonnet
effort: high
tools: Read, Grep, Glob, Agent
maxTurns: 12
---
Review the implemented UI against the product model
and the approved requirements.
Find concrete behavior or UX problems.
Return file references and describe the impact.
Do not edit the implementation.

You have quite a bit of things you can add in here in the configurations, so I’ve gathered them all here.

For instance, you have tools up there based on what it can use. This agent is allowed to call other agents as a tool as well as read, use grep and glob.

If you want to specify allowed tools further for the subagent, let’s say you want your agent to be able to use git but not all commands, you need to specify this in your settings.json file.

 .claude/settings.json
{
  "permissions": {
    "allow": ["Bash(git add *)", "Bash(git commit *)", "Bash(npm test)"],
    "deny":  ["Bash(git push *)", "Bash(git merge *)", "Bash(rm *)"]
  }
 .claude/settings.json
{
  "permissions": {
    "allow": ["Bash(git add *)", "Bash(git commit *)", "Bash(npm test)"],
    "deny":  ["Bash(git push *)", "Bash(git merge *)", "Bash(rm *)"]
  }

Obviously you need to also allow Bash in it’s tools first for this to work. Also remember that setting it in the settings.json file makes it apply everywhere.

If we go back to the configs in the subagent, you can also set omitClaudeMd which removes the CLAUDE.md file (or the AGENTS.md file) for the subagent’s context. I read about a guy that decreased his tokens for the agent by 88% by doing this but you should try it on your own.

It’s also worth mentioning the difference between a subagent, a subtask, and a fork as well.

A normal subagent usually has a fresh context + delegated task. Whereas a subtask gets a copy of the whole conversation and then returns the result in the conversation. A fork should spin-off from the main agent as a separate background session that you can return to or message.

A subtask may be beneficial as it will share the parent’s prompt cache which will be cheaper than a fresh worker for the same-context tasks.

Remember that for both tools, you can describe the agent you want in ordinary language and ask the coding assistant to create the relevant configuration file as well (no need to do it on your own).

For Codex setting up an agent will look different.

name = "ux_reviewer"
description = "Review implemented UI for product and UX problems"
model = "gpt-6-luna"
model_reasoning_effort = "high"
developer_instructions = """
Review the implemented UI against the product
model and approved requirements.
Use the verify-product-ui Skill when applicable.
Return concrete findings with file references.
Do not modify code.
"""
name = "ux_reviewer"
description = "Review implemented UI for product and UX problems"
model = "gpt-6-luna"
model_reasoning_effort = "high"
developer_instructions = """
Review the implemented UI against the product
model and approved requirements.
Use the verify-product-ui Skill when applicable.
Return concrete findings with file references.
Do not modify code.
"""

You have more information gathered here in the repository. For instance, Codex has no tools allowlist. A custom agent inherits the parent session’s tools, sandbox, approvals, MCP servers and skills.

You remember the config.toml we built before for permissions, this is the one you want to tweak for Codex in the project folder.

[agents] # apply to every spawned agent
enabled = true                              # false turns multi-agent off
max_depth = 2                               # nesting; root = 0, default 1
max_concurrent_threads_per_session = 8      # legacy alias: max_threads
default_subagent_model = "gpt-6-luna"
default_subagent_reasoning_effort = "medium"
interrupt_message = true                    # record a model-visible note when an agent turn is interrupted
[agents] # apply to every spawned agent
enabled = true                              # false turns multi-agent off
max_depth = 2                               # nesting; root = 0, default 1
max_concurrent_threads_per_session = 8      # legacy alias: max_threads
default_subagent_model = "gpt-6-luna"
default_subagent_reasoning_effort = "medium"
interrupt_message = true                    # record a model-visible note when an agent turn is interrupted

The Codex agent file can turn things off though.

name = "docs_lookup"
description = "Answers questions from documentation only"
model = "gpt-6-luna"
model_reasoning_effort = "low"
developer_instructions = """
Answer from the docs. Do not run commands or edit files.
"""

[features]
shell_tool = false
request_permissions_tool = false
name = "docs_lookup"
description = "Answers questions from documentation only"
model = "gpt-6-luna"
model_reasoning_effort = "low"
developer_instructions = """
Answer from the docs. Do not run commands or edit files.
"""

[features]
shell_tool = false
request_permissions_tool = false

If you need more information here, please use the research dump document I have here.

As for what benefits from separate context or parallel execution, it can be everything from large codebase investigations (needs clean context), several different documentations for running models (run parallel subagents to gather documentation), and reviewing an implementation (benefits from independent context).

For instance, let’s say you found a bug where generated media attached to the wrong sketch (I know a bit out of context). But tracing it is twenty files, IDs across services, several possible causes. A subagent could possibly do the exploration and returns file locations and evidence.

I once tried running them to gather documentation for implementing different models where the main agent was allowed to spawn them on its own, and this just didn’t work well.

If I can’t specify them myself they sometimes spend time on useless stuff and wastes quite a bit of tokens (you’ll see just how much above).

So what do we have to watch out for? The token cost is obvious. Workers can miss information (especially if the main agent is delegating to another agent). Duplicate work and more waste in tokens. More work doesn’t necessarily mean efficient work.

Before rounding off, it’s worth it to mention Agent Teams and Ultracode (dynamic workflows) in Claude Code which is still in an experimental phase.

The difference between subagents and agent teams, is that agent team permits more direct communication between workers.

As of October 2026, Claude Code agent teams are still experimental and disabled by default, but you can turn it on in the settings.json file.

{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}
{
  "env": {
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
  }
}

Then you can simply ask Claude to create a team, rather than merely asking for parallel subagents.

This feature still has known limitations around resuming teammates, shared task status and cleanup.

Ultracode on the other hand is a way to automatically orchestrate parallel subagents using a generated JavaScript script.

Instead of Claude manually delegating tasks to subagents one at a time, it generates a script that controls which agents run, and how their results are combined (I have not tried though so I can’t sprinkle a heavy dose of critique on this one yet).

You can simply turn on in the settings or in your code editor.

The script executes in a separate runtime, outside Claude’s main conversation context. Unlike ordinary parallel subagents, the workflow can also manage loops, conditional branching, verification rounds and retries programmatically.

So, subagents can be great when a task needs clean context or real parallel work. There is a ton of configuration you can do with them in both Claude Code and Codex. However, they cost tokens, and they can fail the task if the delegation fails.

Let’s run through worktrees quickly as well, as it’s relevant when working with several subagents.

Level 4.1: Worktrees (for vibers)

Let’s go through git and how we can use worktrees in our repository to separate work. The focus is on using several agents at once to work on a codebase, and how Claude Code can help.

Git worktrees existed long before AI coding agents. They’re just becoming more interesting now that people have multiple agents writing code.

For beginners, git is a way to keep several copies of the same project in sync, each copy can change independently, and Git can merge the changes back together, telling you when two copies changed the same thing. It’s how development teams typically work together on projects.

Git worktrees is a way to maintain multiple active development environments.

Say you have a copy of a codebase on your computer and you want to work on a bigger feature in separation while also keeping this copy for smaller fixes. You can then create another worktree with a new branch, this one will duplicates the working files, shares the Git database and maintains its own checkout state.

Your computer
├── project/
│   ├── Code files (your-branch)
│   └── .git/  ← Shared Git repository
│
├── project-new-design/ - new worktree
    └── Code files (feature/new-design - new branch)
Your computer
├── project/
│   ├── Code files (your-branch)
│   └── .git/  ← Shared Git repository
│
├── project-new-design/ - new worktree
    └── Code files (feature/new-design - new branch)

Both initially have the same committed code, but future changes are independent. You can now keep working on both independently.

You can check the main periodically and merge the changes from there into your new separate state as you keep working, and you can switch between branches locally if someone asks for smaller changes to be pushed.

The main advantage isn’t simply that worktrees are neater. They’re multiple working directories managed by one git repository, rather than multiple git repositories that you have to synchronize.

I mention all this because when you create subagents with Claude Code you have the option to set a new worktree, isolation: worktree.

---
name: builder
description: Implements independent features
model: opus
effort: high
tools: Read, Grep, Glob, Edit, Write, Bash
isolation: worktree
maxTurns: 30
---

You are responsible for implementing a delegated feature.
---
name: builder
description: Implements independent features
model: opus
effort: high
tools: Read, Grep, Glob, Edit, Write, Bash
isolation: worktree
maxTurns: 30
---

You are responsible for implementing a delegated feature.

When this agent builds, it works on a separate worktree, and once it’s done, it reports back, and its changes sit on a branch in that worktree until you or the main agent merge them in.

This is interesting as you can have multiple agents working to modify the same project concurrently, while keeping each agent’s file changes separate until integration.

One session might investigate a bug, another implement a feature, and another experiment with an architectural change.

Now when Claude Code does this for you, even if it works with git worktrees underneath, it decides where they go, fences the agent in, and cleans up after.

To have Claude do this, you can simply ask for it, or specify it like I did above for an agent.

Just note, that there can still be issues using worktrees. Just because they work on different features doesn’t mean that the agents’ implementations are compatible, there can still be a conflict. Furthermore, their code might merge fine while introducing a bug.

I should also mention semantic conflicts.

Let’s say agent A changes a function’s return type in one file, and agent B writes code in another file that expects the old type. It may merge without issues because they are in different files, but something would break. You need compilation, tests, code review or other verification for this.

Also remember each worktree still uses disk space for its files.

So, worktrees is good to know of when you work with several agents at once, Claude can help you set this up and manage the process for you.

Level 5: How to build Skills

A Skill is a blueprint on how to do something. It can have instructions, references, scripts, tests and evals, which is then given to the agent to carry out. I’ll go through what belongs in a Skill, how to configure it, and what the research says.

Oppose to an agent, a Skill describes what to do and how, whereas an agent is about who runs it and with what capabilities.

So if you need to run a task in a separate context, you’re should aim to use a subagent, if you want to document a repeatable way of carrying out a task, you create a Skill.

So the point is not to teach your coding tool how to do software engineering, instead it’s about teaching it a specific process and different gotchas that are not obvious, so you don’t have to explain it every time.

It also works the other way around, if someone else has already figured out a process, you can pull their Skill into your own workflow instead of building it yourself.

As an example, instead of telling your agent to “always make good UI,” you document a specific UI review procedure that runs through the app and captures evidence. Instead of saying “be careful with databases,” you document a workflow, with scripts and references, for running a validated migration and rollback.

I should note that verification Skills have some of the strongest evidence.

Anthropic reported that product verification Skills had the most measurable impact on Claude’s output quality internally. Examples included running signup and checkout flows in a browser, verifying invoice states, and interacting with terminal applications.

What should you ideally put in a Skill? You can simply define a markdown file with a name, description, and workflow steps but you can also build it out further.

The description is important as a first step, as it will be used as discovery. It controls whether a Skill gets selected in the first place.

A database-migration Skill with the description “Use for databases, queries, models or persistence” might trigger on nearly any database task. A description specifically mentioning schema migrations and rollouts is much more useful.

As to what to put in the main instructions file, one observation is that the most valuable part of a Skill seems to be their gotchas sections, the stuff that is non-obvious and learned from real failures.

If I check Anthropic, they give examples like unexpected behavior in internal libraries, misleading identifiers, and deployment commands that appear successful despite downstream failures.

You can add scripts for repeatable mechanics that benefit from deterministic execution as well. An example is where an agent repeatedly recreates Python code to compare database schemas, the Skill can include a tested compare_schema.py script that has already been validated.

The Skill supplies the procedure and tools while the model decides how to apply them to the current task.

As for how you organise your Skills with both Claude Code and Codex, you need to specify them in two places.

project/
├── .claude/
│   └── skills/
│       └── inference-engineer/  # the real folder
│           ├── SKILL.md
│           ├── references/
│           ├── scripts/
│           ├── tests/
│           └── evals/ # Claude-only, Codex never reads it
└── .agents/
    └── skills/
        └── inference-engineer → ../../.claude/skills/inference-engineer  # symlink
project/
├── .claude/
│   └── skills/
│       └── inference-engineer/  # the real folder
│           ├── SKILL.md
│           ├── references/
│           ├── scripts/
│           ├── tests/
│           └── evals/ # Claude-only, Codex never reads it
└── .agents/
    └── skills/
        └── inference-engineer → ../../.claude/skills/inference-engineer  # symlink

The main description file is SKILL.md, this is where you put the name, description, configs, and then the main instructions that should reference everything else.

Once a Skill body is loaded its instructions remain in context for every new message. This is why Anthropic recommends keeping the main file concise, under 500 lines, for further instructions and workflows you can use the /reference folder.

For code such as fetch data from an API, you can put in the /scripts folder. For testing whether the code works put scripts into the /tests folder.

The /evals folder I will go through for the next section, but this one can contain questions that you’ll test the Skill with to see if it behaves correctly.

So, scripts/ contains executable helpers, tests/ verifies those helpers, and evals/ tests whether an agent using the Skill correctly.

When you share Skills like this between Claude and Codex, remember they have some difference in capabilities and if one doesn’t support anything it will most likely just ignore it.

As for how to create Skills with Claude Code, you can do it manually or invoke the/skill-creator.

/plugin install skill-creator@claude-plugins-official
/plugin install skill-creator@claude-plugins-official

You can also just create a /skills folder and set it up on your own, creating the SKILL.md file yourself.

Investigate statistics using the internal API, including
following relationships between summary and detail results.
when_to_use: >
Use for investigations requiring statistics to be traced
through multiple API responses.
—

Instructions
1. do this
2. then this
Note: this is important too.” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>

---
name: stats-api
description: >
  Investigate statistics using the internal API, including
  following relationships between summary and detail results.
when_to_use: >
  Use for investigations requiring statistics to be traced
  through multiple API responses.
---

Instructions
1. do this
2. then this
Note: this is important too.
---
name: stats-api
description: >
  Investigate statistics using the internal API, including
  following relationships between summary and detail results.
when_to_use: >
  Use for investigations requiring statistics to be traced
  through multiple API responses.
---

Instructions
1. do this
2. then this
Note: this is important too.

The when_to_use field is just appended to the description, but they cap it combined to 1,536 characters.

There is a lot of configs you can add to a Skill in its header, so I’ve collected them all here. But let’s run through some of them.

First, you can set how you want the Skill discovered. By default Claude should be able to discover it, but not if you set disable-model-invocation: true, if you set user-invocable: false you can’t invoke it but Claude can.

We can also add in arguments to a Skill when you want it to accept a specific input, such as an identifier.

---
name: investigate-stat
description: Investigate a statistics record through the internal API
argument-hint: "[stat-id]"
arguments:
  - stat_id
disable-model-invocation: true
user-invocable: true
---

Investigate statistics record $stat_id.
Follow the documented drill-down workflow in /references/drill-down.md.
Use the script scripts/get_data.py to get API data, validate in tests/validate_data.py
Report the records and evidence used.
---
name: investigate-stat
description: Investigate a statistics record through the internal API
argument-hint: "[stat-id]"
arguments:
  - stat_id
disable-model-invocation: true
user-invocable: true
---

Investigate statistics record $stat_id.
Follow the documented drill-down workflow in /references/drill-down.md.
Use the script scripts/get_data.py to get API data, validate in tests/validate_data.py
Report the records and evidence used.

This one should then only be able to be invoked by me, running something like this:

/investigate-stat id-123
/investigate-stat id-123

You should even be able to add in more arguments.

---
name: investigate-stat
description: Investigate a statistics record through the internal API
argument-hint: "[workflow] [topic] [period]"
arguments:
  - workflow
  - topic
  - period
---

Requested workflow: $workflow
Topic (optional): $topic
Period (optional): $period
If a value is omitted, use the documented default when one
exists, or determine whether clarification is necessary.
---
name: investigate-stat
description: Investigate a statistics record through the internal API
argument-hint: "[workflow] [topic] [period]"
arguments:
  - workflow
  - topic
  - period
---

Requested workflow: $workflow
Topic (optional): $topic
Period (optional): $period
If a value is omitted, use the documented default when one
exists, or determine whether clarification is necessary.

Then you can call it in different ways.

/stats-api keyword "artificial intelligence" 30d
/stats-api trending
/stats-api content "renewable energy"
/stats-api keyword "artificial intelligence" 30d
/stats-api trending
/stats-api content "renewable energy"

I kind of like the idea of adding arguments because I can think of a lot of automatic processes that could use it (might be a fun use case in the future).

Let’s move on to tools as well. You can specify allowed and disallowed tools for your Skill.

---
name: inspect-project
description: Investigate project files and report findings
allowed-tools:
  - Read
  - Grep
  - Glob
disallowed-tools:
  - Write
  - Edit
---
---
name: inspect-project
description: Investigate project files and report findings
allowed-tools:
  - Read
  - Grep
  - Glob
disallowed-tools:
  - Write
  - Edit
---

Remember forbidding Write and Edit alone doesn’t establish complete read-only if the agent can still use unrestricted Bash commands.

Anthropic also supports granular permissions, such as Bash(git status *).

As for what all these tools mean, you can check [this table](http://Anthropic also supports granular permissions, such as Bash(git status *).) to read more. You can specify Agent here too, which means it’s allowed to delegate to another subagent.

For Claude Code we can also specify context:fork, that instead of loading it in to the context of the main agent uses another fresh context to run the Skill. See an example below where we use the built-in explore agent specified earlier to run the Skill.

---
name: review-api
description: Independently investigate an API issue
model: sonnet
effort: high
context: fork
agent: Explore
background: false
---

Investigate the API issue supplied in $ARGUMENTS.
Read relevant code and documentation.
Return findings with evidence.
Do not modify files.
---
name: review-api
description: Independently investigate an API issue
model: sonnet
effort: high
context: fork
agent: Explore
background: false
---

Investigate the API issue supplied in $ARGUMENTS.
Read relevant code and documentation.
Return findings with evidence.
Do not modify files.

With background: false set, the main agent has to wait for the subagent to finish its task with the skill.

We can even have a Skill activate only on certain paths (think of the Rules I defined earlier).

Let’s use an example such as a Skill for making changes to your subscription implementation, where you only want it to invoke when the agent is working on scripts that pertain to your subscriptions, you would then define paths in its header.

# SKILL.md
---
name: subscription-review
description: Review changes to the subscription and credit system
paths:
  - "src/payments/**/*.ts"
  - "src/subscriptions/**/*.ts"
---
# SKILL.md
---
name: subscription-review
description: Review changes to the subscription and credit system
paths:
  - "src/payments/**/*.ts"
  - "src/subscriptions/**/*.ts"
---

Now there is more, such as defining hooks in your skills which I will wait with until I get to tests and verification. Do read the document for further research though if needed.

Let’s run through Codex quickly as well. You can use a a built-in creator here too.

$skill-creator
$skill-creator

It supports creating or updating a Skill.

Codex has a few differences in structure and files than Claude.

.agents/skills/review-schema-migration/
├── SKILL.md              # name, description and instructions
├── agents/
│   └── openai.yaml       # display information, invocation policy and external tool dependencies
├── scripts/              # supporting resources
├── references/
└── assets/
.agents/skills/review-schema-migration/
├── SKILL.md              # name, description and instructions
├── agents/
│   └── openai.yaml       # display information, invocation policy and external tool dependencies
├── scripts/              # supporting resources
├── references/
└── assets/

For the SKILL.md file you set the name, description and instructions, just like in Claude.

---
name: review-schema-migration
description: Review schema migrations for breaking changes
  and deployment risks. Use when creating or reviewing
  a database schema migration.
---

# Instructions
1. Do this first
2. Do this after
3. Do this last
---
name: review-schema-migration
description: Review schema migrations for breaking changes
  and deployment risks. Use when creating or reviewing
  a database schema migration.
---

# Instructions
1. Do this first
2. Do this after
3. Do this last

The difference is the agents/openai.yaml file. Here you set a bit of configs, like display name, icons, default prompts, allow implicit invocation, and tools. See an example of this file below.

interface:
  display_name: "Stats API Guide"
  short_description: "Investigate statistics using the Safron API"
  icon_small: "./assets/stats-small.svg"
  icon_large: "./assets/stats-large.png"
  brand_color: "#3B82F6"
  default_prompt: "Use this skill to investigate a tech trends"

policy:
  allow_implicit_invocation: true

dependencies:
  tools:
    - type: "mcp"
      value: "techStats"
      description: "Safron MCP server"
      transport: "streamable_http"
      url: "https://example.com/mcp"
interface:
  display_name: "Stats API Guide"
  short_description: "Investigate statistics using the Safron API"
  icon_small: "./assets/stats-small.svg"
  icon_large: "./assets/stats-large.png"
  brand_color: "#3B82F6"
  default_prompt: "Use this skill to investigate a tech trends"

policy:
  allow_implicit_invocation: true

dependencies:
  tools:
    - type: "mcp"
      value: "techStats"
      description: "Safron MCP server"
      transport: "streamable_http"
      url: "https://example.com/mcp"

Does Codex need this file? No. A basic Codex Skill only requires SKILL.md so this one is optional.

Now you can add some things to the general config.toml file too for Codex. To decrease or increase the token budget for the catalogue of available Skills you can set max_context_tokens. You can also disable skills if you want.

[skills]
max_context_tokens = 6000

[[skills.config]]
path = "/Users/me/projects/my-app/.agents/skills/old-api/SKILL.md"
enabled = false
[[skills.config]]
path = "/Users/me/projects/my-app/.agents/skills/stats-api/SKILL.md"
enabled = true
[skills]
max_context_tokens = 6000

[[skills.config]]
path = "/Users/me/projects/my-app/.agents/skills/old-api/SKILL.md"
enabled = false
[[skills.config]]
path = "/Users/me/projects/my-app/.agents/skills/stats-api/SKILL.md"
enabled = true

I should probably also add in some examples that are mine here. I’m bad at creating a lot of skills, except for some verification flows. I do have one that works as an inference-engineer add-on that I can share some bits off.

---
name: modal-inference-engineer
description: Researches, builds, reviews, tunes, and benchmarks efficient GPU inference services on Modal. Use for adding or changing a model, choosing prompts and input splitting, establishing image/token/output limits, selecting GPUs and inference engines, implementing in-container batching, configuring warm replicas and autoscaling, or calculating defensible latency, throughput, and cost per result.
---

# Modal Inference Engineer

Treat the model, preprocessing, inference engine, GPU, batching, and traffic shape as one system. Establish correctness on representative inputs before optimizing throughput.

## Load the relevant references

- For every new model or model-version change, read [model-research.md](references/model-research.md).
- For Modal implementation, batching, GPU selection, or metrics, read [modal-architecture.md](references/modal-architecture.md).
- When working on Qwen3-VL, DeepSeek-OCR, GLM-OCR, MinerU, Marker, or PaddleOCR-VL, also read [ocr-benchmark-case-study.md](references/ocr-benchmark-case-study.md). Treat its numbers as a pinned case study, not universal defaults.

## Follow this workflow

### 1. Research and write a model contract

Use current primary sources: the model author's model card/repository and the selected engine's official support documentation. Use papers for architecture details, not as a substitute for the released inference recipe. Record URLs and access date.

Before implementation, produce a compact contract containing:

| Field | Required finding |
|---|---|
| Artifact | Exact model ID, revision, license, trust-remote-code requirement |
| Task boundary | Whole document, page, crop/element, or multi-stage pipeline |
| Inputs | Supported formats, image count, PDF/multipage behavior, resolution policy |
| Prompt | Exact task prompt, chat template, special tokens, thinking/reasoning flags |
| Context | Hard total context, visual-token/pixel limits, prompt allowance, output cap |
| Output | Text/Markdown/JSON contract, stop behavior, repetition controls |
| Backend | Supported engine and version, required processors/plugins, sync/async API |
| Numeric mode | Supported dtype/quantization and hardware restrictions |
| Batching | Native batch API, continuous batching, dynamic batching, or neither |
| Resources | Weight memory, KV-cache/intermediate memory, CPU/RAM, likely GPU candidates |

If a required fact is undocumented, say so and design a probe. Never invent a prompt or token limit by analogy with a similarly named model.

### 3. Decide whether to split the input

...

### 4. Choose one batching owner

...

### 5. Select the GPU

...

### 6. Build the Modal container

...
---
name: modal-inference-engineer
description: Researches, builds, reviews, tunes, and benchmarks efficient GPU inference services on Modal. Use for adding or changing a model, choosing prompts and input splitting, establishing image/token/output limits, selecting GPUs and inference engines, implementing in-container batching, configuring warm replicas and autoscaling, or calculating defensible latency, throughput, and cost per result.
---

# Modal Inference Engineer

Treat the model, preprocessing, inference engine, GPU, batching, and traffic shape as one system. Establish correctness on representative inputs before optimizing throughput.

## Load the relevant references

- For every new model or model-version change, read [model-research.md](references/model-research.md).
- For Modal implementation, batching, GPU selection, or metrics, read [modal-architecture.md](references/modal-architecture.md).
- When working on Qwen3-VL, DeepSeek-OCR, GLM-OCR, MinerU, Marker, or PaddleOCR-VL, also read [ocr-benchmark-case-study.md](references/ocr-benchmark-case-study.md). Treat its numbers as a pinned case study, not universal defaults.

## Follow this workflow

### 1. Research and write a model contract

Use current primary sources: the model author's model card/repository and the selected engine's official support documentation. Use papers for architecture details, not as a substitute for the released inference recipe. Record URLs and access date.

Before implementation, produce a compact contract containing:

| Field | Required finding |
|---|---|
| Artifact | Exact model ID, revision, license, trust-remote-code requirement |
| Task boundary | Whole document, page, crop/element, or multi-stage pipeline |
| Inputs | Supported formats, image count, PDF/multipage behavior, resolution policy |
| Prompt | Exact task prompt, chat template, special tokens, thinking/reasoning flags |
| Context | Hard total context, visual-token/pixel limits, prompt allowance, output cap |
| Output | Text/Markdown/JSON contract, stop behavior, repetition controls |
| Backend | Supported engine and version, required processors/plugins, sync/async API |
| Numeric mode | Supported dtype/quantization and hardware restrictions |
| Batching | Native batch API, continuous batching, dynamic batching, or neither |
| Resources | Weight memory, KV-cache/intermediate memory, CPU/RAM, likely GPU candidates |

If a required fact is undocumented, say so and design a probe. Never invent a prompt or token limit by analogy with a similarly named model.

### 3. Decide whether to split the input

...

### 4. Choose one batching owner

...

### 5. Select the GPU

...

### 6. Build the Modal container

...

It works alright but it keeps ignoring parts of the workflow, like selecting the correct GPU so I have to force it to follow it. I’ve created it with an agent after many failures running smaller and mid-sized models.

This one though helps me run smaller OCR models to process images within a second, and without it Claude will probably 6–10x that latency (though it’s still new so have to keep working with it).

So what does the research say? I checked out SWE-Skills-Bench, that you should too, that did a test on approximately 565 repository-level tasks with 49 public software-engineering Skills (using Claude Code and Claude Haiku 4.5).

What they found was very interesting, 39/49 Skills made no change in pass rate, 7/49 Skills improved pass rate, whereas 3/49 Skills reduced pass rate.

We can probably say that there are a lot of redundant skills out there, using a skill in itself doesn’t tell you if you’re more productive.

Moreover, they also found three harmful Skill, springboot-tdd (−10.0 pp), linkerd-patterns (−9.1 pp), anddjango-patterns (−9.1 pp).

The authors call the problem context interference as in Skill guidance that was related to the topic but incompatible with the specific task, repository version or required behavior. In the Linkerd case for instance, the agent got the API version right without the Skill, with it, it copied an older API version and added an unrelated resource.

The two ends of the seven that helped was risk-metrics-calculation went from 70% to 100% while using 34.8% fewer tokens. tdd-workflow went from 21.4% to 28.6% but used 78.6% more tokens.

I did some more digging around SkillsBench to look at what skills in what domains actually improved the task.

Healthcare, manufacturing, cybersecurity all had dumps with using specialist skills whereas software engineering had the least.

So, tasks requiring specialized domain procedures that are less familiar to the base model have more opportunity to benefit from additional knowledge.

Though do check out their new research from July as well here. For the July dtufy the strongest models gained around 10 pp on SWE tasks rather than just 4.5 pp but I think they are different measurements.

This brings us to how to evaluate them too.

Level 5.1: Evaluating Skills (Claude Code)

A Skill triggering is not evidence that the Skill works which is why evals are coming onto the scene now. Let’s run through how it works quickly with Claude Code using the Skill Creator plugin.

The idea is to run fresh-session tests with and without the Skill. Anthropic (i.e. Claude Code) since March 2026 provide the skill-creator specifically to evaluate that difference.

If you have the Skill creator already installed, you don’t have to write any tests on your own. This one can propose the test prompts, positive and negative triggering examples, and expected outcomes. You then review them especially if it needs your knowledge to estimate success.

Evaluate the stats-api Skill using Skill Creator. Review the cases and expected behavior with me, then run fresh evaluations with and without the Skill. Grade the actual results, and show the output comparison, failures and token costs.
Evaluate the stats-api Skill using Skill Creator. Review the cases and expected behavior with me, then run fresh evaluations with and without the Skill. Grade the actual results, and show the output comparison, failures and token costs.

The first file that will be created is an evals.json file with task prompts and expected outputs, it will be put in the skills file with all the other items.

stats-api/
├── SKILL.md
├── references/
├── scripts/
├── tests/
└── evals/
    ├── evals.json # talking about this one
stats-api/
├── SKILL.md
├── references/
├── scripts/
├── tests/
└── evals/
    ├── evals.json # talking about this one

It will look something like this.

{
  "skill_name": "stats-api",
  "evals": [
    {
      "id": 1,
      "prompt": "Investigate why keyword traffic for 'renewable energy' dropped last month.",
      "expected_output": "A traced investigation across the summary and detail endpoints, with the records and evidence used.",
      "files": []
    }
  ]
}
{
  "skill_name": "stats-api",
  "evals": [
    {
      "id": 1,
      "prompt": "Investigate why keyword traffic for 'renewable energy' dropped last month.",
      "expected_output": "A traced investigation across the summary and detail endpoints, with the records and evidence used.",
      "files": []
    }
  ]
}

If a test needs an input file, say a dataset the agent should work from, that file goes in evals/files/ and the test points to it.

└── evals/
    ├── evals.json
    └── files/
        └── sample_dataset.json
└── evals/
    ├── evals.json
    └── files/
        └── sample_dataset.json

For each test case it starts two subagents at the same time: one with the Skill, one without. Both get the same prompt, and both start from a clean context. If you’re improving a Skill that already exists, the baseline is the old version instead of nothing: it snapshots the Skill before editing and runs the baseline from the snapshot.

After this you’ll see a /workspace folder appear. It is a separate folder next to the Skill, so the run outputs don’t end up inside the Skill, and it is created as the runs go, not upfront

stats-api/
stats-api-workspace/              # created now
└── iteration-1/
    └── keyword-drop/             # one folder per test case, named after what it tests
        ├── eval_metadata.json    # the prompt + expectations for this case
        ├── with_skill/
        │   └── outputs/          # what the agent produced
        └── without_skill/
            └── outputs/
stats-api/
stats-api-workspace/              # created now
└── iteration-1/
    └── keyword-drop/             # one folder per test case, named after what it tests
        ├── eval_metadata.json    # the prompt + expectations for this case
        ├── with_skill/
        │   └── outputs/          # what the agent produced
        └── without_skill/
            └── outputs/

When a run finishes, it saves how many tokens and how long it took (timing.json in that run’s folder). When all runs are done, a grader agent reads each output and checks every expectation, saving the result next to the output.

stats-api-workspace/
└── iteration-1/
    ├── keyword-drop/
    │   ├── eval_metadata.json
    │   ├── with_skill/
    │   │   ├── outputs/
    │   │   ├── timing.json       # tokens, duration
    │   │   └── grading.json      # each expectation: text, passed, evidence
    │   └── without_skill/
    │       ├── outputs/
    │       ├── timing.json
    │       └── grading.json
    ├── benchmark.json            # pass rate, time, tokens with vs without
    └── benchmark.md
stats-api-workspace/
└── iteration-1/
    ├── keyword-drop/
    │   ├── eval_metadata.json
    │   ├── with_skill/
    │   │   ├── outputs/
    │   │   ├── timing.json       # tokens, duration
    │   │   └── grading.json      # each expectation: text, passed, evidence
    │   └── without_skill/
    │       ├── outputs/
    │       ├── timing.json
    │       └── grading.json
    ├── benchmark.json            # pass rate, time, tokens with vs without
    └── benchmark.md

Based on your feedback it rewrites the Skill, then it can rerun all the test cases into iteration-2/, baseline included.

Now this test if the Skill does any good, you can also test if it gets picked for the correct situations, with a separate file, and the Skill Creator offers it once the Skill itself is done in an eval_set.json.

[
  { "query": "Investigate why keyword traffic for 'renewable energy' dropped last month.", "should_trigger": true },
  { "query": "Fix the failing unit test in api_client.py.", "should_trigger": false }
]
[
  { "query": "Investigate why keyword traffic for 'renewable energy' dropped last month.", "should_trigger": true },
  { "query": "Fix the failing unit test in api_client.py.", "should_trigger": false }
]

Then it runs the optimization loop in the background, it splits the set with 60% train, runs each query three times to get a reliable trigger rate, asks Claude to propose a better description based on what failed, and re-tests.

This process I should test a bit more to show you what it looks like, because I love to benchmark and I love data (working on a bigger OCR evaluation as we speak).

Let’s move on to some popular built-in Skills and Commands as well that I have to cover in this intro too.

Level 5.2: /loop, /goal, and /batch

There is a bunch of bundled Skills that come out of the box with these tools, I want to at least cover three of them that are good to know of.

First there is /loop, which is a Skill, it schedules recurring work (a normal cron job really for tech people out there) that runs inside your local Claude Code session.

You can schedule a prompt like so /loop 5m check the deploy, have the agent chose the interval and iteration with /loop check CI and address any new review comments or just run /loop which should pick up your loop.md file and run the prompt in there.

The dynamically chosen intervals is interesting, Claude basically evaluates what it observes and chooses when to run again, between 1 minute to and hour, and then repeats the process based on what it finds.

Good to understand that Claude only gets information after each iteration, rather than this being continuous autonomous reasoning.

You can also combine a Skill with a loop, as long as Claude is allowed to invoke that Skill itself. This can look like /loop 20m /review-pr 1234 or /loop 30m /slack-feedback.

I also mentioned a .claude/loop.md file, where you can set up a default maintenance workflow. Claude uses that file when you invoke /loop without a custom prompt.

# .claude/loop.md
Check the pull request associated with the current branch.
Use the review-pr Skill to inspect new review comments and failing CI checks.
Address actionable issues and verify changes.
If there is nothing new, report that no action is needed.
Do not push changes without authorization.
# .claude/loop.md
Check the pull request associated with the current branch.
Use the review-pr Skill to inspect new review comments and failing CI checks.
Address actionable issues and verify changes.
If there is nothing new, report that no action is needed.
Do not push changes without authorization.

A limitation is obviously that the loop requires a running Claude Code session, plus it expires after seven days. What you can do instead is use the cloud version with /schedule or /routines.

Each scheduled execution starts a new cloud session, clones the selected GitHub repository, and can invoke Skills committed to that repository.

The difference is that there will be a fresh session each time, and you can’t run it every 5 minutes (it’s minimum one hour I think).

Cloud tasks can also respond to GitHub events or API calls, which may be more useful than repeatedly checking whether something happened.

/loop is obviously not loop engineering, for that you need to establish independent verification, reliable progress tracking or good stopping criteria so that is a topic for later.

After this we have /goal, which is very good to know of. This one is more of a built-in command rather than a Skill. Running /goal different than running /plan, instead of focusing on how, this is a focus on the outcome or goal.

If you’ve worked with agents you know that they can retain the original objective and still become increasingly occupied with solving the wrong problem. If you ask them, it gets what you’re after but then it goes off and does something you didn’t ask for. Some kind of rabbit holing.

I’ve called this goal hierarchy collapse in my notes (a subordinate task gradually displaces the higher-level objective), not really sure if the research calls it the same.

Nevertheless, this problem helps to understand what /goal can actually improve. It should keep it focused on a specific goal.

To run /goal (which works in both Claude Code and Codex), you should define observable success, constraints and a stopping condition.

/goal Reduce p95 checkout latency below 120 ms on the checkout benchmark while keeping the correctness suite green.
/goal Reduce p95 checkout latency below 120 ms on the checkout benchmark while keeping the correctness suite green.

I once tried the command /goal examine this AI benchmark and establish if it is fair and then left the computer running, it ran for 5 hours and ended up in a rabbit hole. This is a bad prompt for a goal, it’s way too heavy, it can’t define what “fair” means and can’t prioritize what I find “fair.”

So the more concrete the better, and smaller tasks are obviously ideal.

As for how it works, after each turn, a smaller model evaluates whether the condition has been met, not met, or is impossible. Claude or Codex can then continue without a new human prompt.

So it is some kind of execution-control mechanism but that doesn’t independently guarantee the goal has been met. It judges the evidence already surfaced in the conversation so if it says something that isn’t true, the evaluator doesn’t automatically discover this.

So it very much depends if there is trustworthy evidence being shared.

If you add in some kind of deterministic verification, it should improve. But do look ino reward hacking, and perhaps read “SpecBench: Measuring Reward Hacking in Long-Horizon Coding Agents if you’re keen to learn” more.

Lastly, I want to cover /batch which is a Skill. It should work as large-scale parallel execution and uses both subagents and worktress which we covered earlier.

The documented example is around migrating code.

/batch migrate src/ from JavaScript to TypeScript
/batch migrate src/ from JavaScript to TypeScript

The documented workflow should decompose the work into 5 to 30 independent units, and present a plan. It should then spawns one background subagent per unit in an isolated worktree. Each subagent implements its unit, runs tests, and publishes its change.

This can be useful if workers have separable file ownership but they can make contradictory choices.

I haven’t tried /batch, but thought it was a good example of how to mix a Skill with subagents and worktrees. For this use case though, a tightly coupled migration may be easier to implement sequentially, even if it looks like the files are contained enough to do something like this.

Let’s now turn to community Skills, what people say, the most popular stuff, and where to look for them.

Level 5.3: Community skills

The idea of a Skill only came out last year, but it’s now become a substantial ecosystem around Claude Code, Codex and other coding agents. I’ll cover how to find the most popular ones, but also whether they help, and the risks involved.

If you’re working with something, you can look for a Skill to help out. For instance, if you’re working with iOS apps you need to give your agent some way of verifying its work (very important), you can check out XcodeBuildMCP and its Skill.

If you’re struggling with the design of the activity island for iOS apps, you can try your luck with this ActivityKit Skill. Some back story, Claude Fable really struggled with this one when we built it, I didn’t know there was a skill for it so it took some time to implement.

This ecosystem of skills is pretty big by now. Vercel’s September 25, 2026 report documents 1 million Skills in the registry by August 2026 with 280 million recorded installs.

The installation activity is concentrated though as 62% of all installs come from the top 0.04% (375) Skills, while the next 32% come from the top 1.16%. Nearly half of the Skills in that dataset had reportedly been installed exactly once.

You can check the leaderboard at skills.sh to test some of them.

As for where to find Skills, you can check Anthropic’s official skills here, ComposioHQ collection here, and a collection by VoltAgent here.

A useful observation from a few Reddit discussions is that many developers still discover Skills through GitHub and Reddit rather than from a marketplace.

As for community skills worth checking out, you can go to mattpocock/skills and emilkowalski/skills. I have not check out either myself yet, I should have a more obsession in skills but it just haven’t come up, I go looking when I need something.

I do know of JuliusBrussee/caveman (that should reduce unnecessary responses), DietrichGebert/ponytail (should prevent unnecessary code), and then obra/superpowers.

I’ve heard mixed things about superpowers though, I’ve heard people argue that the added process consumed too many tokens and duplicated capabilities already available in newer models.

So what’s the negatives?

I mentioned this before, but just because there is a skill doesn’t mean it will perform well. Furthermore, community Skills can become redundant as models improve. You saw the research from before, software engineering had the least improvement. These models do quite well on their own.

Installation counts and GitHub stars are not effectiveness measurements either. You remember I also mentioned the SWE-Skills-Bench study, the skills they used were all very popular but most didn’t really change the outcome and sometimes did worse than no skill at all.

The biggest thing though is security related, as in installing untrusted instructions and code. This isn’t a hypothetical issue.

We can check out two studies here from Snyk and Nvidia. Snyk examined 3,984 skills, found 76 malicious ones while 13.4% had at least one critical-level security issue.

Nvidia analyzed 31,132 skills and found indications of malicious intent in 5.2% and vulnerabilities in 26.1%. They checked things like prompt injections, exfiltration, and unsafe dependencies.

So before installing something check out Snyk Skill Inspector and NVIDIA SkillSpector.

I’ll round off here as this one is getting long.

This article became much longer than I had anticipated.

I still have to cover sections on writing tests, setting up hooks, more on evals, MCPs & tools, compaction, handoffs, more on goals and working around context limitations, loop engineering, and how to understand where your tokens go.

So if you want me to release the second part too clap + comment + follow, and I’ll push it in a few weeks.

As for how to use these tools correctly, don’t listen to people when they say they have mastered this, we’re all learning as we go along, but if you do, listen to people who have built software that works.

❤