# Expert Capsule: Turn Your AI Chat History Into a Skill

> Distills your own ChatGPT, Claude or Gemini chat history into a personal Agent Skill: rules learned from the moments you corrected, rejected or accepted an AI answer, each backed by 2+ quotes from 2 sessions. Installs into Claude Code, Claude.ai, ChatGPT or a system prompt.

Expert Capsule: Turn Your AI Chat History Into a Skill is a free AI agent skill on Agensi by hiếu hoàng, in Prompt & Skill Engineering. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [hiếu hoàng](https://www.agensi.io/creators/hiu-hiu-hoang)
- Category: [Prompt & Skill Engineering](https://www.agensi.io/skills/prompt-skill-engineering)
- Version: 1.0
- Last updated: 2026-11-25
- Security: scan passed (2026-11-25); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/expert-capsule-turn-your-ai-chat-history-into-a-skill
- Tags: prompt-engineering, ai-agents, llm-ops, personalization, chat-history, chatgpt, claude-code, writing-style

## About this skill

Turn your own ChatGPT, Claude or Gemini chat history into a personal Agent Skill that makes an AI work by your standards, style and domain rules.

### What it does

Expert Capsule turns **your own AI chat history** into `expert-<you>/`, an Agent Skill folder that makes an AI work by your standards, style and domain rules.

The strongest signal of how you work is not how you describe yourself, it's the moments you **corrected, rejected, challenged or accepted** an AI answer. Expert Capsule finds those moments, turns them into rules of the form *"When X, do Y, because Z"*, and packages them for whichever AI you use.

### How it works

| Step | What happens |
|---|---|
| 1. Ingest | Reads your ChatGPT / Claude export (or a `.txt` for Gemini), keeps edit and regenerate branches, **redacts API keys, passwords, emails and phone numbers** before any model call |
| 2. Domains | Labels each session by field and shows you the list: **you pick 1-4 domains** to distill |
| 3. Signal filter | Scores every turn (regenerations, correction keywords, repeated requests, short commands after long answers, specific praise) and keeps 200-400 |
| 4. Mining | Extracts feedback type, target aspect, how personal it is, and a **verbatim quote** (rejected if it isn't an exact substring) |
| 5. Synthesis | Domain rules, situations, playbooks, conflicts, shared core, style guide. Rules with fewer than 2 events or from only 1 session are dropped |
| 6. Quick check | On 15 held-out corrections: does the AI with the capsule anticipate your critique better than without it? |
| 7. Review | You keep, reword, narrow or delete every rule, right in the chat |
| 8-9. Package & install | One source, every export: Claude Code skill, Claude.ai ZIP, ChatGPT custom instructions, Projects / Gems instructions, API system prompt |
| 10. Blind taste test | You judge A/B answers to your own real questions without knowing which one used the capsule |

### What you get

```
expert-<you>/
  SKILL.md                     # always-on core: shared rules, style, three working modes (< 5,000 tokens)
  references/domains/<d>.md    # per-domain coded rules (KT-07), situations, playbooks, open questions
  references/style.md          # style guide with verbatim examples
  references/exemplars.md      # model answers that meet your bar
  exports/                     # custom_instructions.txt, project_instructions.md, system_prompt.md
  capsule.json                 # version, stats, quick-check result
  private/                     # never shared: evidence quotes, events, edit history
```

### Why it's different

- **No API key needed in Claude Code.** Haiku/Sonnet subagents answer the model requests through a queue, billed to your normal plan. Every result is cached, so reruns only pay for new work.
- **Evidence, not vibes.** Every rule points to at least two verbatim quotes from two different sessions.
- **You stay in control.** You choose the domains and approve every rule. Nothing is decided for you.
- **Private by design.** The workspace is git-ignored, evidence stays in `private/`, and `install` never ships `private/`. Want nothing to leave your machine? Run it with a local Ollama model.
- **Honest reporting.** The quick check and blind taste test report results even when the capsule loses to the plain AI.

### Good for

- Building an AI that answers "like me" in your own field (research, code review, investing, writing)
- Onboarding teammates or students to how you work
- Giving ChatGPT / Claude Projects a real, evidence-backed set of instructions instead of a hand-written persona

### Current limits

- The CLI messages and generated capsules are currently in **Vietnamese** (the agent translates for you).
- Needs enough history: domains with fewer than 15 sessions are marked thin; playbooks need 6+ sessions of the same task.
- The quick check is small and noisy (15 turns): use the blind taste test as the real judge.

### Free & open source ⭐

Expert Capsule is **100% free** and MIT-licensed. If it helps you, please give it a star on GitHub, it really helps a solo student developer keep improving it:

👉 **[github.com/HThiuhiu/expert-capsule](https://github.com/HThiuhiu/expert-capsule)**

Issues, ideas and pull requests are very welcome.

## Requires

- Python 3.11+
- PyYAML (pip install pyyaml)
- ChatGPT, Claude or Gemini chat history export
- Optional: Anthropic or OpenAI
- Optional: Ollama
- Optional: Claude Code

Free and open source (MIT). If it helps, a GitHub star means a lot: github.com/HThiuhiu/expert-capsule

## Known limitations

CLI messages and generated capsules are currently in Vietnamese. Needs enough history (domains under 15 sessions are marked thin). The built-in quick check is small (15 turns) and noisy, so use the blind A/B taste test. On Claude.ai (no subagents) it only suits small histories.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Expert Capsule: Turn Your AI Chat History Into a Skill skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### Do I need an API key?

No, not in Claude Code. In the default agent mode, Haiku/Sonnet subagents answer every model request through a queue, billed to your normal Claude Code plan. An Anthropic or OpenAI key (or a local Ollama model) is optional and only makes runs faster or keeps everything on your machine.

### Is my chat history safe?

Secrets and PII (API keys, passwords, emails, phone numbers) are redacted at ingest, before any model call. All data stays in your own workspace folder, which is git-ignored; delete the folder to delete everything. Verbatim evidence quotes live only in private/, which install never copies. For zero data leaving your machine, run with --mode ollama.

### Which chat exports are supported?

ChatGPT (Settings > Data controls > Export data) and Claude (Settings > Privacy > Export data) zip exports are read directly, including edit and regenerate branches. For Gemini or any other source, copy conversations into a .txt file where each turn starts with User: or Gemini:.

### Where can I use the capsule it creates?

Claude Code (installed into ~/.claude/skills/), Claude.ai (upload the ZIP as a skill), Claude / ChatGPT Projects and Gemini Gems (paste project_instructions.md), ChatGPT custom instructions (a compressed 1,500-character version), and any API as a system prompt. Each capsule ships an install guide.

### How much chat history do I need?

At least about 50 sessions overall, and ideally 15+ sessions in each domain you want to distill. Every rule needs evidence from 2 different sessions, so small histories produce few rules. Playbooks appear once you have 6+ sessions of the same kind of task.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
