MODEL ≠ AGENT
Separate the parts of the system.
A coding agent combines several parts: a model, instructions, context, tools, permissions, and a loop. Naming these parts helps us supervise the task and diagnose a failure carefully.
| Layer | What it contributes | Question to ask |
|---|---|---|
| LLM | Generates language, code, and tool requests from context. | Which source grounds this claim? |
| System instructions | Set durable behavior and boundaries. | What rules is the model following that I cannot see in my prompt? |
| Context | Files, history, documentation, and tool results available now. | Did the agent read the correct file and current version? |
| Tools | Read files, search, edit, run R or shell commands, and browse sources. | Which action actually produced this result? |
| Permissions | Limit which tools, paths, and external actions are allowed. | Did I grant more access than this task needs? |
| Loop | Returns each tool result to the model so it can continue. | What evidence should make the loop stop? |
The model is the language engine. The harness supplies the workshop, and the agent uses the engine inside it. Your prompt works as a work order. The diff records the change, while tests measure whether it worked. You remain the investigator.
Codex and Claude Code combine these layers in different ways. For this reason, the same model may behave differently in another product. Ask about the model together with the context, tools, permissions, and feedback provided by the current harness.
THE RECURRING LOOP
Use five steps, and keep the evidence visible.
Begin with an expectation.
State the question, inspect the inputs, and predict one result before asking for help.
Define a bounded task.
Specify the goal, relevant files, constraints, permissions, and an observable definition of done.
Watch what the system does.
Notice which files, commands, edits, outputs, and uncertainties the harness exposes.
Test the result.
Run the code, inspect the diff, test keys and ranges, and consult primary documentation.
Record your decision.
State what you accepted, revised, rejected, or left unresolved, and explain why.
Use source data, documentation, code behavior, statistical output, and research design as evidence. Treat an agent explanation as a proposal that still needs a check.
PROMPT ANATOMY
Define a result that you can observe.
| Part | Question it answers | Example |
|---|---|---|
| Goal | What outcome do I want? | Explain the join or update one indicator. |
| Context | Which files and facts matter? | Read the script and indicator dictionary. |
| Constraints | What must not happen? | Do not overwrite the frozen dataset. |
| Done when | How can I verify completion? | Keys are unique and year coverage is reported. |
Goal: [one concrete outcome] Context: [files, audience, question, relevant definitions] Constraints: [scope, source rules, no-edit boundaries, claim limits] Done when: [tests, output, comparison, or explanation I can inspect] Before acting, state any consequential assumption you need to make.
VERIFICATION MENU
Choose a check that matches the claim.
- □Code claim: run a small example and inspect the object.
- □Data claim: count rows, test keys, inspect ranges, and read source metadata.
- □Statistical claim: reproduce the output and restate it in units.
- □Policy claim: compare the wording with the research design.
- □Source claim: open the primary source and confirm the relevant detail.
You can ask the agent to propose checks. You should still choose and run the checks yourself when possible.
COMMON FAILURE MODES
Recognize an answer that looks plausible but is wrong.
| Failure | Signal | Response |
|---|---|---|
| Invented variable |
Code references a column absent from names().
|
Inspect the dictionary and exact file. |
| Silent row loss | A filter or model drops observations. | Compare row counts and missingness. |
| Many-to-many join | Rows unexpectedly multiply. | Test keys on both sides before joining. |
| Unsupported cause | Language shifts from “associated” to “caused.” | Return to the design and claim ladder. |
| Hidden state | Code works only after console experiments. | Restart R and run from the top. |
| False citation | A source cannot be opened or does not support the claim. | Use the primary source and verify manually. |
TRANSPARENCY
State what the agent contributed and how you checked it.
I used [Codex / Claude Code] to [explain, generate, debug, review, or update]. I provided it with [public project context]. I verified its contribution by [tests, source comparison, clean render, or manual review]. I revised or rejected [important example]. I remain responsible for the analysis and interpretation.
Do not send personal data, identifiable student records, credentials, private API keys, confidential research files, or unpublished sensitive material to a coding agent.