[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-110320":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":10,"pushedAt":26,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":15,"starSnapshotCount":15,"syncStatus":30,"lastSyncTime":31,"discoverSource":32},110320,"tinker-ai-skill","drost-ai\u002Ftinker-ai-skill","drost-ai","Agent Skill for fine-tuning an agentic model on your own Claude Code sessions with Tinker. Works in Claude Code, Codex and OpenCode.","",null,"Python",336,39,1,0,3,10,103,13,65.81,"MIT License",false,"main",true,[],"2026-11-07 17:15:54","2026-11-23 15:09:00","# tinker-ai-skill\n\n**Turn your own coding-agent sessions into a fine-tuned model you can run locally. This is the recipe behind Tess-4 and Tess-4.5.**\n\n[![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-blue.svg)](LICENSE)\n[![Agent Skill](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAgent%20Skill-agentskills.io-black)](https:\u002F\u002Fagentskills.io)\n[![Works with](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fworks%20with-Claude%20Code%20%C2%B7%20Codex%20%C2%B7%20OpenCode-brightgreen)](#install-the-skill)\n[![Trains on](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftrains%20on-Tinker-7b3fe4)](https:\u002F\u002Fthinkingmachines.ai\u002Ftinker)\n\nEvery session you run with a coding agent is a worked example of how you want a\nmodel to behave: your repositories, your conventions, your tools, your way of\ndebugging. This skill hands your agent the complete, production-tested pipeline to\nturn those sessions into a supervised fine-tuning dataset, train a LoRA on\n[Tinker](https:\u002F\u002Fthinkingmachines.ai\u002Ftinker), merge it, and ship a GGUF that runs in\nllama.cpp on your own machine. One afternoon, a few dollars to a few hundred, and a\nmodel that works the way you do.\n\nInstall it once and say: *\"fine-tune Qwen3.6-35B-A3B on my Claude Code sessions from\nthe last three months.\"* The agent takes it from there and stops before anything\nthat costs money.\n\n## Proven on real releases\n\nWe built the Tess family of agentic coding models from our own Claude Code sessions\nwith exactly this method, and shipped them as open weights on Hugging Face:\n[Tess-4-27B](https:\u002F\u002Fhuggingface.co\u002Fmigtissera\u002FTess-4-27B)\n([GGUF](https:\u002F\u002Fhuggingface.co\u002Fmigtissera\u002FTess-4-27B-GGUF),\n[EAGLE-3 draft](https:\u002F\u002Fhuggingface.co\u002Fmigtissera\u002FTess-4-27B-EAGLE3)) and\n[Tess-4.5-27B](https:\u002F\u002Fhuggingface.co\u002Fmigtissera\u002FTess-4.5-27B)\n([GGUF](https:\u002F\u002Fhuggingface.co\u002Fmigtissera\u002FTess-4.5-27B-GGUF)). Read about them at\n[continuityresearch.ai\u002Ftess-4-5](https:\u002F\u002Fcontinuityresearch.ai\u002Ftess-4-5).\n\nWhat is in this repository is the distilled, cleaned-up version of the pipeline that\nproduced them, from raw transcripts to a quantized GGUF, including the mistakes we\nmade so you do not have to.\n\n## What you get\n\n- **One `SKILL.md`** your agent follows: a nine-step workflow with the decision\n  points spelled out and the rules that cost us runs.\n- **Eleven small scripts**, plain Python and shell on top of tinker-cookbook and\n  llama.cpp, each with an offline default and a `--help` that explains every flag.\n- **Six reference notes**: the transcript format, the anonymization policy, the\n  chunking and compaction design, Tinker training settings with the learning-rate\n  evidence, export and serving, and the lessons learned.\n- **A synthetic transcript generator** so you can dry-run the whole pipeline in\n  five minutes without touching real data or spending a cent.\n\n## The method, from transcripts to a local model\n\n| Step | What happens | Script |\n|---|---|---|\n| 1. Collect | Copy Claude Code transcripts verbatim, with checksums; skip subagents and tiny sessions; exclude whole projects that must stay private | `collect_sessions.py` |\n| 2. Clean | Normalize to OpenAI-style messages; drop harness noise; replace every credential by value; give each session its own random identity for usernames, folders, names, emails, orgs; fail if anything leaks | `normalize_sessions.py`, `anonymize_sessions.py` |\n| 3. Slice | Cut sessions to the model's context length, measured with the model's real renderer, never splitting a tool call from its result | `build_dataset.py` |\n| 4. Compact | Give every slice after the first a deterministic working-context block and a continuation bridge, the way a real harness compacts | `build_dataset.py` |\n| 5. Split | Hold out whole sessions with a seeded hash so rebuilds and other models compare | `build_dataset.py` |\n| 6. Train | LoRA on Tinker with the cookbook trainer, tool definitions on every row, W&B connected, offline smoke test first, cost shown before launch | `train_tinker.py` |\n| 7. Check | Sample base vs checkpoints with identical rendering; judge behaviour, not loss | `sample_checkpoint.py` |\n| 8. Merge | Download the LoRA from Tinker and merge it into the base model as a standalone bf16 HuggingFace model (or a PEFT adapter for vLLM\u002FSGLang) | `export_checkpoint.py` |\n| 9. Ship | Convert to GGUF, quantize, export the vision projector and draft head, and serve with llama.cpp using the training-matched template and sampling settings | `make_gguf.sh`, `serve_gguf.sh` |\n\n## Why this and not a generic SFT tutorial\n\nAgent transcripts are not chat data. The details below are the difference between a\nmodel that works and one that looks fine on the loss curve and falls apart in use.\n\n- **Per-session anonymization.** A single constant fake world in every row was\n  memorized and later asserted over the real environment. Randomize per session.\n- **Compaction context on continuation slices.** Long sessions outlive the context\n  window; the model must learn to continue from a summary, not from nothing.\n- **Tool definitions and the system prompt on every row.** Rows without them\n  regressed tool use even though NLL improved.\n- **Thinking kept in history.** Hybrid renderers silently strip earlier reasoning and\n  train empty think blocks; the scripts rebuild the renderer to keep it.\n- **Measure with the real tokenizer.** A tokenizer change moved rows by 14% and\n  overflowed the budget. Rebuild per model.\n- **Judge by behaviour.** Two \"collapses\" had monotonically falling loss. Sample.\n- **Serve the way you trained.** A chat template that strips earlier thinking, or\n  llama.cpp's default min-p, turned a good checkpoint into garble. The serve script\n  carries the right flags.\n\n## Quick start: five minutes on synthetic data\n\n```\ngit clone https:\u002F\u002Fgithub.com\u002Fdrost-ai\u002Ftinker-ai-skill.git ~\u002F.claude\u002Fskills\u002Ftinker-ai-skill\ncd ~\u002F.claude\u002Fskills\u002Ftinker-ai-skill\nuv venv && source .venv\u002Fbin\u002Factivate && uv pip install -r requirements.txt\n\npython scripts\u002Fmake_sample_transcript.py --out .\u002Fdemo-claude-projects --turns 14 --long-results\npython scripts\u002Fcollect_sessions.py   --claude-dir .\u002Fdemo-claude-projects --data-dir .\u002Fdemo-data --min-bytes 1000\npython scripts\u002Fnormalize_sessions.py --data-dir .\u002Fdemo-data\npython scripts\u002Fanonymize_sessions.py --data-dir .\u002Fdemo-data --name \"Taylor Quintrell\"\npython scripts\u002Fbuild_dataset.py      --data-dir .\u002Fdemo-data --model Qwen\u002FQwen3.6-35B-A3B --max-len 8192 \\\n                                     --system-prompt-file assets\u002Fsystem-prompt.md\npython scripts\u002Ftrain_tinker.py       --data-dir .\u002Fdemo-data --name qwen3.6-35b-a3b-8k   # offline smoke test\n```\n\nThe last command prints a decoded training row, the token count and the resolved\nconfiguration. Add `--train` to launch a real run; afterwards\n`export_checkpoint.py` and `make_gguf.sh` take it to a GGUF you can run.\n\n## Then on your own sessions\n\n1. Raise Claude Code's transcript retention first: `\"cleanupPeriodDays\": 3650` in\n   `~\u002F.claude\u002Fsettings.json`. The default deletes sessions after 30 days.\n2. Copy `.env.example` to `.env` and add your `TINKER_API_KEY` and `WANDB_API_KEY`.\n3. Write `identity.json` (see `identity.example.json`): your usernames, full name,\n   emails, handles, company, domains.\n4. Follow `SKILL.md`, or let your agent drive. The decisions that stay yours: which\n   projects to exclude, which model and context length, the system prompt and tool\n   definitions of the harness you will serve in, and the learning rate when Tinker\n   has no calibrated default.\n\n## Install the skill\n\nClone into your agent's skills directory. The directory name must be\n`tinker-ai-skill`, which `git clone` gives you by default:\n\n| Agent | Personal (all projects) | Project (this repo) |\n|---|---|---|\n| Claude Code | `~\u002F.claude\u002Fskills\u002Ftinker-ai-skill\u002F` | `.claude\u002Fskills\u002Ftinker-ai-skill\u002F` |\n| OpenAI Codex | `~\u002F.agents\u002Fskills\u002Ftinker-ai-skill\u002F` | `.agents\u002Fskills\u002Ftinker-ai-skill\u002F` |\n| OpenCode | `~\u002F.config\u002Fopencode\u002Fskills\u002Ftinker-ai-skill\u002F` | `.opencode\u002Fskills\u002Ftinker-ai-skill\u002F` |\n\n```\n# Claude Code\ngit clone https:\u002F\u002Fgithub.com\u002Fdrost-ai\u002Ftinker-ai-skill.git ~\u002F.claude\u002Fskills\u002Ftinker-ai-skill\n# Codex\ngit clone https:\u002F\u002Fgithub.com\u002Fdrost-ai\u002Ftinker-ai-skill.git ~\u002F.agents\u002Fskills\u002Ftinker-ai-skill\n# OpenCode\ngit clone https:\u002F\u002Fgithub.com\u002Fdrost-ai\u002Ftinker-ai-skill.git ~\u002F.config\u002Fopencode\u002Fskills\u002Ftinker-ai-skill\n```\n\nOpenCode also reads `.claude\u002Fskills` and `.agents\u002Fskills`, so one project copy serves\nall three. Any other agent that supports the [Agent Skills](https:\u002F\u002Fagentskills.io)\nstandard works the same way. Invoke it directly with `\u002Ftinker-ai-skill` in Claude\nCode; Codex and OpenCode pick it up from its description.\n\n## What it costs\n\nTinker bills per token. Training cost is train tokens times the model's train price\n(see the [price list](https:\u002F\u002Ftinker-docs.thinkingmachines.ai\u002Ftinker\u002Fmodels\u002Fmodels_and_pricing\u002F));\nthe smoke test prints the token count before you launch. Ballpark figures at\nNovember 2026 prices, one epoch of 64K rows:\n\n| Dataset | Train tokens | Qwen3.6-35B-A3B | Inkling 2 Small | Qwen3.8-27B |\n|---|---|---|---|---|\n| 100 rows (a personal corpus) | ~5M | ~$6 | ~$8 | ~$21 |\n| 1,000 rows (what our releases used) | ~45M | ~$55 | ~$70 | ~$185 |\n\nDense models cost more per token than MoE models of similar quality (Tinker prices\nby active parameters); Qwen3.8-27B is the base of Tess-4.5.\n\nSampling and periodic evaluation are extra and small. The dataset steps are free\nand run on your laptop.\n\n## Requirements\n\n- Python 3.11+ and [uv](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F) (or pip)\n- `tinker-cookbook>=0.6.0` (installs `tinker`, `torch`, `tml-renderers`) and `wandb`\n- A [Tinker](https:\u002F\u002Ftinker.thinkingmachines.ai) API key; a [Weights & Biases](https:\u002F\u002Fwandb.ai\u002Fauthorize) key is optional but recommended\n- Claude Code transcripts under `~\u002F.claude\u002Fprojects\u002F` (other agents: emit the message\n  schema in `references\u002Fclaude-code-transcripts.md` and continue from step 2)\n- For steps 8-9: a built [llama.cpp](https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp) checkout,\n  and disk for the base model plus the merged copy\n\n## Layout\n\n```\nSKILL.md                            instructions the agent follows\nscripts\u002Fcollect_sessions.py         step 1\nscripts\u002Fnormalize_sessions.py       step 2a\nscripts\u002Fanonymize_sessions.py       step 2b\nscripts\u002Fbuild_dataset.py            steps 3-5\nscripts\u002Ftrain_tinker.py             step 6\nscripts\u002Fsample_checkpoint.py        step 7\nscripts\u002Fexport_checkpoint.py        step 8: download the LoRA, merge, optional PEFT adapter\nscripts\u002Fmake_gguf.sh                step 9: BF16 GGUF, quantize, mmproj, MTP draft\nscripts\u002Fserve_gguf.sh               step 9: llama-server with training-matched flags\nscripts\u002Fmake_sample_transcript.py   synthetic transcript for a dry run\nscripts\u002Fcommon.py                   shared rendering (builder, trainer and sampler render identically)\nreferences\u002F                         format, anonymization, chunking, training, export and serving, lessons\nassets\u002Fsystem-prompt.md             a generic agent system prompt to start from\nidentity.example.json, .env.example\n```\n\n## Data safety\n\n`data\u002F`, `demo-*\u002F`, `runs\u002F`, `export\u002F`, `wandb\u002F` and `.env` are git-ignored. The anonymizer\nfails rather than writing a file that still leaks. Review anonymized rows before\ntraining, and never publish a dataset built from transcripts that belong to someone\nelse without their consent.\n\n## Author and license\n\nWritten by [Migel Tissera](https:\u002F\u002Fhuggingface.co\u002Fmigtissera), creator of the Tess\nmodels. MIT license. Tinker and tinker-cookbook are products of Thinking Machines\nLab; this skill is an independent guide built on them.\n\nIf this saved you a failed training run, star the repository and share what you\ntrained.\n","tinker-ai-skill 是一个用于将用户在 Claude Code、Codex 或 OpenCode 等编程代理环境中的真实会话记录，自动构建成监督微调数据集并训练本地可运行模型的工具链。它基于 Tinker 平台实现 LoRA 微调、权重合并与 GGUF 量化全流程，支持一键启动、成本可控（自动拦截付费操作），输出兼容 llama.cpp 的轻量本地模型。核心特点是面向开发者工作流定制：复用个人代码风格、调试习惯、工具链和项目上下文。适用于希望在本地部署个性化编程助手、快速迭代领域适配模型，或复现 Tess 系列开源编码模型的中高级 AI 开发者与研究者。",2,"2026-11-24 04:38:41","CREATED_QUERY"]