By now you have given the agent the same instructions many times: “8.5 cm wide, no title, these colours, save as PDF and PNG”. Each new session starts from zero, and each figure comes out slightly different. This unit is about teaching the agent your way of working once, and about giving it new tools, such as a PubMed search.
Skills: a folder with a SKILL.md file of instructions. The agent loads it when a task needs it, or when you type its name.
A house style: one skill for figures (or reports), so every result looks like it came from the same lab.
MCP connectors: plug-ins that let the agent search PubMed or read your Zotero library.
Project or personal: a skill in the repository travels to your colleagues; a personal one travels with you.
Safety: third-party skills and connectors run code and see your data. Read before you install.
This is a hands-on unit. Running several agents is in Parallel workers; reading code you did not write comes next, in Reading other people’s code.
You have typed the same figure instructions twenty times
There are five ways to make the agent remember how you work
The instruction file holds facts about the project; a skill holds how to do one kind of job
CLAUDE.md / AGENTS.md
A skill
About
this project: data, folders, rules
one kind of job: figures, reports, a literature search
Read
at the start of every session
when the task matches, or when you call it
Lives
in the project folder
in the project, or in your personal folder for all projects
Example
“Raw data in data/raw is read-only.”
“Figures are 8.5 cm wide, Okabe-Ito colours, PDF and PNG.”
Length
short: it costs context every session
can be longer: it costs nothing until it is used
Rule of thumb: if it is true for one project, put it in the instruction file. If it is true for one kind of job, in any project, make it a skill.
A skill is a folder with one instruction file, SKILL.md
A house-style skill reads like a brief to a new student
---name: figure-styledescription: House style for all data figures. Use whenever you make, change or export a plot or chart.---Make every figure in this style:- Size: 8.5 cm wide and 6.5 cm high (one journal column). Save at exactly this size; do not crop or use "tight" bounding boxes.- Font: Arial or Helvetica, 8 pt everywhere. Axis labels with units in brackets, e.g. "Height (cm)".- Colours: Okabe-Ito, in this order: #000000, #E69F00, #56B4E9, #009E73. A control group is always black.- No title, no grey background, no box around the plot.- Save as PDF and as PNG at 300 dpi, in results/figures/, named after the script.- Write the figure as a script in scripts/, so it can be rerun.When done, report: file names, PNG size in pixels (about 1003 x 767),and which colour went to which group.
The description decides when the agent picks up the skill
You can also call a skill by name, like a command
Claude Code
Codex
Call a skill yourself
type /figure-style, then your request
type $figure-style in your message, or pick it from /skills
Let the agent decide
automatic when the request matches the description
automatic when the request matches the description
Pass details
/figure-style growth.csv, height over time (the text after the name goes to the skill)
write them in the same message
Old style “commands”
.claude/commands/*.md still work and count as skills
custom prompts in ~/.codex/prompts/ are deprecated; use skills
Calling by name is the reliable way. Automatic use is convenient, but check that it happened.
Skills live in the project or in your personal folder
One skill can serve both tools
Claude Code and Codex read the same SKILL.md format: a header with name and description, then instructions.
Only the folder differs: .claude/skills/figure-style/ and .agents/skills/figure-style/.
Simplest: keep two copies and ask the agent to keep them identical. Note it in CLAUDE.md/AGENTS.md.
Keep tool-specific details out of the skill. “Save as PDF” works everywhere; “press Shift+Tab” does not.
A good skill is short, concrete and ends with checks
Weak
Better
“Make nice figures.”
“8.5 × 6.5 cm, 8 pt Arial, no title.”
“Use good colours.”
“Okabe-Ito in this order: #000000, #E69F00, …; control is black.”
“Save the figure.”
“PDF and 300 dpi PNG in results/figures/, named after the script.”
(nothing)
“Report the PNG size in pixels and the colour of each group.”
A whole style guide, 10 pages
One screen of text; details in extra files if needed
The same rules as for a good prompt (Delegating well): describe the result, make it checkable, say what must not happen.
Test a skill on two different jobs in a fresh session
When you correct the agent twice, update the skill
The agent can write the first draft of a skill for you
We have now made two figures the way I like them. Write a skill called
figure-style that captures these rules, so that future sessions make
figures the same way. Put it in .claude/skills/figure-style/SKILL.md.
Keep it to one screen. The description must say when to use it.
End the skill with the checks the agent should report.
Show me the file before you save it.
Then read every line. The agent may add rules you never asked for.
The same idea works for reports
---name: report-styledescription: House style for short written reports and summaries (Quarto or Word). Use when asked to write or format a report.---- Start with a three-sentence summary: question, main result, caveat.- Sections: Background, Data, Methods, Results, Limitations.- Every number in the text must come from a file in results/; name the file.- Figures follow the figure-style skill. Captions say what one point is.- British English, short sentences, no "groundbreaking" or "novel".- End with "How this was made": tools used, AI use, date.
A skill can refer to another skill. Keep each one about one job.
Project skills travel with the repository
Connectors give the agent new tools, such as a PubMed search
A connector returns real records, but the agent still writes the summary
The PMIDs, titles and dates come from the database, not from the model’s memory.
What the agent says about those papers is still written by the model. Check it.
Adding a connector is one command
Claude Code
Codex
Add a remote connector
claude mcp add --transport http pubmed https://pubmed.mcp.claude.com/mcp
codex mcp add pubmed --url <address>
Add a local connector
claude mcp add <name> -- <command>
codex mcp add <name> -- <command>
Where it is stored
for you, in this project only (default); all your projects with --scope user; .mcp.json in the project with --scope project
~/.codex/config.toml, under [mcp_servers.<name>]
See status, sign in
/mcp inside a session; claude mcp list in the terminal
/mcp inside a session; codex mcp list
Run these in the terminal, not inside the agent session. Start a new session afterwards.
Local connectors run on your computer; remote ones run on a server
A Zotero connector lets the agent read your own library
What you can do: “Which papers in my collection Drought report field trials? Make a table with citation keys.”
How it works: a local connector reads your Zotero library on your computer. Zotero must be running, with the setting that lets other applications talk to it.
Options at the time of writing:zotero-mcp (a Python program) and a Zotero plugin with a built-in server. Both are third-party and maintained by volunteers. Check the README before installing.
Careful: your library holds notes, annotations and maybe unpublished PDFs. All of it can reach the cloud model if the agent reads it.
A project connector can be shared, but each person signs in themselves
claude mcp add --scope project ... writes .mcp.json into the project. Commit it, and colleagues get the same connector.
Claude Code asks each person to approve project connectors before they run.
Never put a password, API key or token in a file you commit. Each person adds their own key in their own settings.
In Codex, connectors live in your personal config.toml; share the one-line codex mcp add command in the README instead.
Third-party skills and connectors run with your permissions
Text from a connector or a skill can carry hidden instructions
Before you install anything, five questions
Who made it? The tool vendor, a known organisation, or an unknown account?
Is it maintained? Recent releases, open issues answered, more than one contributor.
What can it reach? Your files, your library, the web? Does it only read, or can it write and send?
Have you read it? For a skill, read every line of SKILL.md and look at any scripts. For a connector, read the README’s list of tools.
Is it allowed? Check your university’s policy on tools that process research data (Privacy, ethics and safety).
Fewer is better: install what you use, remove what you do not.
Every connector and skill also takes space in the agent’s context
Hooks run a command automatically at fixed moments
A hook is a command the tool runs by itself at a fixed point: before a tool runs, after a file is edited, when the agent stops.
Example: after every edit of a script, rerun it and check that the figure is still 1003 × 767 pixels.
Both Claude Code (settings.json) and Codex (hooks.json or config.toml) have hooks.
Hooks are not covered in this course. Skills are instructions the agent may follow; hooks are rules the tool enforces. Use them once a check matters enough to automate.
Where this goes wrong
The skill is not used. The description did not match the request. Call it by name, then fix the description.
The skill is followed halfway. Too long, or vague rules. Shorten it; make every rule checkable.
You test in the old session. The agent remembers your instructions anyway. Test in a fresh one.
Skills drift apart. The Claude and Codex copies, or your copy and the lab’s, stop matching. One rule, one place to change it.
The connector is trusted too much. Real PMIDs, invented summaries. Check the claims, not only the identifiers.
A stranger’s skill or connector. It runs with your permissions and sees your data. Read it first.
A key in the repository. Never commit passwords, tokens or API keys.