Home / Guides / Teach your agent
Guide 03

Teach the agent your engine

A general AI knows a lot about engines in general. It knows nothing about yours: the fuel, the injectors, what "Lambda 1" means in your log, or where your limits are. Five layers of context fix that.

Updated By the KrispyGauge team4 min read

The five layers

Think of it as briefing a new tuner who has never seen your car. The bottom layers rarely change. The top one grows every session.

① Engine brief engine, fuel, turbo, injectors, ECU, wideband ② Channel dictionary CSV column → meaning → units ③ Hard limits min λ, max timing, max step ④ Method the order you analyse in ⑤ Tune journal what's been tried changes every session ↑ set once ↓
LayerWhat goes in itWithout it, the agent…
① Engine briefEngine, build, fuel, turbo, injectors, ECU & firmware, wideband, use caseassumes petrol targets on an E85 car
② Channel dictionaryEvery CSV column name, what it means and its unitsconfuses absolute and gauge boost, or lambda and AFR
③ Hard limitsMinimum lambda, maximum timing, knock threshold, max change per stepsuggests changes that are technically right and dangerous
④ MethodSensor check → segment → lag shift → compare → rank → (then) proposeflags overrun as "dangerously lean"
⑤ Tune journalDated notes: log, finding, change, resultre-suggests things you already tried

Where to put it

The goal is for the agent to read your context automatically every time, so you never paste it in by hand.

Claude Projects

Paste the brief into the project instructions and upload your table exports as project knowledge. Every chat in the project starts with it loaded.

Claude Code

Keep a tuning folder with a CLAUDE.md (or a skill in .claude/skills/). The agent reads it whenever you work in that folder.

Agent Skills

A SKILL.md with a name and description. The agent loads it whenever a task matches, such as "analyse this log". Write it once and use it everywhere.

A tuning folder that works

my-2jz-tune/
my-2jz-tune/
├── CLAUDE.md                    # or the skill below, the agent reads this first
├── .claude/skills/ecu-log-analyst/
│   └── SKILL.md                 # engine brief, channels, limits, method
├── TUNE-JOURNAL.md              # dated session notes (agent appends)
├── maps/
│   ├── 2026-10-20_baseline.map     # never edited
│   └── 2026-11-02_ai-working-copy.map
├── tables/                      # VE / ignition tables copied out as CSV
│   ├── ve1.csv
│   └── ign1.csv
├── logs/
│   └── 2026-11-02_wot-3rd_E85_18psi.csv
└── scripts/
    └── log_summary.py           # repeatable analysis the agent wrote

The skill template

Download it, fill in the <…> placeholders and put it where your agent will find it. Here's the part that matters most:

Download SKILL.md

ecu-log-analyst/SKILL.md (excerpt)
---
name: ecu-log-analyst
description: Analyse aftermarket ECU datalogs for my car. Use whenever I
  share a datalog CSV, ask about fuelling, ignition, knock, boost or temps.
---

# ECU log analyst: <CAR NAME>
You help me tune my car by analysing datalogs. You are the analyst; I am the
tuner. You never apply changes yourself unless I approve each one.

## 3. Hard limits (never suggest beyond these)
- Minimum lambda under boost (> 150 kPa): 0.78. Leaner than 0.82 is HIGH.
- Knock above 0.8 V under load is HIGH. Never suggest adding timing
  in or next to a cell that has knocked.
- Never suggest more than 4% fuel or 1° timing per cell per step.

## 4. Method (in order, every time)
1. Load with code. Report rows, sample rate, channels; flag missing ones.
2. Sanity-check sensors first. If one is faulty, stop and report it.
3. Segment: idle, cruise, tip-in, full load, overrun. Analyse separately.
4. Ignore lean readings during overrun and fuel cut.
5. Shift lambda by 0.1 s for wideband lag before comparing to target.
6. Rank findings HIGH / MED / INFO with time, RPM, load and numbers.
7. Only after I agree: bin into my table axes, skip cells < 5 samples,
   suggest HALF the correction, capped at the limits above.

Teach by example

Rules only go so far. The fastest way to teach judgement is annotated logs: a few short logs where you've written down what really happened.

Example note you save with a log2026-10-14_pull-4th.csv: knock level spikes to 1.1 V at 6,800 rpm, but that's the rev limiter (cut at 6,850). It's mechanical noise, not knock. Ignore spikes within 100 rpm of the limiter.
Example note you save with a log2026-10-20_cruise.csv: lambda oscillating ±0.04 at 2,200–2,600 rpm is real. It turned out to be an exhaust leak before the wideband. Fixed on 10-22, so ignore this pattern in earlier logs.

Put these in an examples/ folder and add one line to your skill: "Before analysing, read examples/ for known quirks of this car." Over time the agent picks up the quirks of your setup.

Keep a tune journal

End every session with: "Append today's session to TUNE-JOURNAL.md." Next week, the agent reads it before it starts.

TUNE-JOURNAL.md
## 2026-11-02 · WOT 3rd gear · E85 · 200 kPa
Log:      logs/2026-11-02_wot-3rd_E85_18psi.csv
Found:    HIGH lean 5,100–5,300 rpm (+9.9% peak). HIGH knock 6,050–6,100 rpm (1.24 V, ~3° pulled).
Changed:  VE1 5000×200 84.2 → 85.7 (+1.8%), 5250×200 83.1 → 86.3 (+3.9%). Ignition untouched.
Result:   pending re-log
Next:     Re-log same gear/boost at IAT < 35 °C. Watch knock at 6k after fuel change.

Test what it learned

Before you trust it with your own logs, give it our sample log. We know what's in it. A well-taught agent should find all four of these:

CheckPass if the agent says…
Lean spot~5,000–5,300 rpm at ~200 kPa, peak about +10% lean of target
Knock~6,050–6,150 rpm, peak 1.24 V, ignition down ~3°
Tip-inBrief lean at the start of the pull. Transient fuel, not VE
Overrunλ 1.25 after throttle closes is expected and ignored
RestraintSuggests no timing increase near 6,000 rpm, and caps fuel changes

If it flags the overrun as the worst problem in the file, go back to layer ④ and tighten the method.

Building the car properly from the start? Krispy Workshop installs ECUs, widebands and dashes so your logs are clean from day one.

Krispy Workshop →