drost-ai/tinker-ai-skill

Agent Skill for fine-tuning an agentic model on your own Claude Code sessions with Tinker. Works in Claude Code, Codex and OpenCode.

What this project is

tinker-ai-skill is a plug-in "skill" that turns your own coding-agent chat sessions (like Claude Code transcripts) into a custom AI model you can train and run on your own computer. It's the exact recipe the author used to build the Tess-4 and Tess-4.5 coding models.

The core idea: every session you have with a coding agent is a worked example of how you want a model to behave — your repos, your conventions, your debugging style. This skill packages that idea into a complete, tested pipeline.

What problem it solves

Generic fine-tuning tutorials treat agent transcripts like ordinary chat data, which leads to models that look good on paper but fail in practice. This project encodes hard-won lessons from real releases — things like per-session anonymization, keeping tool definitions on every training row, and serving the model with the same settings used during training.

How it works: a 9-step pipeline

The README lays out a clear workflow from raw transcripts to a runnable local model:

  1. Collect — Copy Claude Code transcripts verbatim, with checksums; skip subagents and tiny sessions; exclude projects that must stay private.
  2. Clean — Normalize to a standard message format, drop harness noise, replace credentials, and give each session a random fake identity (usernames, folders, emails, etc.) so nothing leaks.
  3. Slice — Cut sessions to fit the model's context length, measured with the model's real tokenizer, never splitting a tool call from its result.
  4. Compact — For long sessions, add a working-context summary and a continuation bridge, mimicking how a real harness compacts.
  5. Split — Hold out whole sessions (using a seeded hash) so rebuilds and other models can be compared fairly.
  6. Train — Run a LoRA fine-tune on Tinker (a model by Thinking Machines Lab) with tool definitions on every row, an offline smoke test first, and the cost shown before launch.
  7. Check — Sample the base model vs. checkpoints with identical rendering; judge by behavior, not just loss numbers.
  8. Merge — Download the trained LoRA and merge it into the base model as a standalone model (or a PEFT adapter for vLLM/SGLang).
  9. Ship — Convert to GGUF format, quantize, and serve with llama.cpp using the training-matched template and sampling settings.

What's in the repository

  • One SKILL.md — instructions your agent follows, with decision points and rules.
  • Eleven small scripts — plain Python and shell, each with an offline default and --help documentation.
  • Six reference notes — covering transcript format, anonymization policy, chunking/compaction design, Tinker training settings, export/serving, and lessons learned.
  • A synthetic transcript generator — lets you dry-run the whole pipeline in five minutes without real data or spending money.

Quick start (synthetic demo)

You can clone the repo into your agent's skills directory and run a demo pipeline on fake data. The README shows commands that generate a sample transcript, collect it, normalize, anonymize, build a dataset, and run an offline smoke test — all free and local. Adding --train launches a real run.

What it costs

Training costs are based on Tinker's per-token pricing. The README gives ballpark figures (November 2026 prices, one epoch of 64K rows):

  • 100 rows (a personal corpus, ~5M tokens): roughly $6–$21 depending on model
  • 1,000 rows (what the Tess releases used, ~45M tokens): roughly $55–$185

Dataset preparation steps are free and run on your laptop. The smoke test prints the token count before you commit to spending.

Requirements

  • Python 3.11+ and uv (or pip)
  • tinker-cookbook>=0.6.0 and wandb
  • A Tinker API key; a Weights & Biases key is optional but recommended
  • Claude Code transcripts under ~/.claude/projects/ (other agents can emit the same message schema)
  • For steps 8–9: a built llama.cpp checkout and disk space for the base model plus merged copy

Data safety

  • data/, demo-*/, runs/, export/, wandb/ and .env are git-ignored.
  • The anonymizer fails rather than writing a file that still leaks.
  • The README advises reviewing anonymized rows before training and never publishing datasets built from someone else's transcripts without consent.

Who made it

Written by Migel Tissera, creator of the Tess models, under the MIT license. Tinker and tinker-cookbook are products of Thinking Machines Lab; this skill is an independent guide built on top of them.

Key caveats from the README

  • The pipeline is designed for Claude Code transcripts by default, though other agents can work if they emit the same message schema.
  • The skill stops before anything that costs money — you must explicitly add --train to launch a real run.
  • The directory name must be tinker-ai-skill for the skill to be recognized.
  • It works with Claude Code, OpenAI Codex, and OpenCode, plus any agent supporting the Agent Skills standard.

In short: if you use a coding agent and want a model that behaves like you (your style, your tools, your conventions), this project gives you a tested, documented path from your own session logs to a locally runnable fine-tuned model — with a free synthetic dry-run to try before you spend anything.

Related

  • Project
  • Project
  • Project
  • Project