Agent skill

Chat History Import

by dashhuang in dashhuang/openclaw-chat-history-import

A skill your agent uses when the user wants to import external chat exports into OpenClaw.

MITAuto-check passed

Install Chat History Import

skills CLI
$ npx skills add dashhuang/openclaw-chat-history-import --skill chat-history-import -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install dashhuang/openclaw-chat-history-import chat-history-import --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
chat-history-import
GitHub stars
144
Token cost
~3.8k tokens
SKILL.md length
1,885 words
Files
14 (incl. scripts, references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user wants to import external chat exports into OpenClaw.

  • Works in 6 steps: Inspect → Normalize Raw Archive → Distill Daily Memory → …
  • The user wants to import external chat exports into OpenClaw
  • SKILL.md covers What This Skill Owns, Related OpenClaw Components, What Scripts Do vs. What The… and Core Rules, plus 5 more sections
  • Runs Python scripts from its folder; calls python3

What it does

Chat History Import is an agent skill from dashhuang/openclaw-chat-history-import. Use when the user wants to import external chat exports into OpenClaw. This skill normalizes raw chat history into conversation-archive-compatible JSONL, then guides the model to distill daily memory and MEMORY.md candidates before applying merges with user confirmation.

Its SKILL.md is about 3.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 18 other files, including scripts and reference files (for example `.github/workflows/validate.yml`, `README.md` and `references/prompts.md`).

It works with OpenAI and Telegram. The repository describes itself as: OpenClaw skill for importing external chat history into archive, daily memory, and MEMORY.md workflows. The licence is MIT.

When your agent uses it

  • The user wants to import external chat exports into OpenClaw

Example prompts

  • “/chat-history-import”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Inspect
  2. Normalize Raw Archive
  3. Distill Daily Memory
  4. Distill MEMORY.md Candidates
  5. Stage Review Payload
  6. Apply

What it can do on your machine

Read from SKILL.md and the folder at commit 31de67f. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 6 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Chat History Import loads about 3.8k tokens when it runs, and up to ~6.6k if it reads all its reference files. Until then it costs about 73 tokens; SKILL.md has 1,885 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~73
When it runs · the whole SKILL.md, loaded when a task matches
~3.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from dashhuang/openclaw-chat-history-import at commit 31de67f, republished under its MIT licence (© dashhuang). 1,885 words, ~3,795 tokens.

Download SKILL.mdSave it as .claude/skills/chat-history-import/SKILL.md (or your agent's skills folder). This skill also uses 13 other files; get the full folder from GitHub.
name
chat-history-import
description
Use when the user wants to import external chat exports into OpenClaw. This skill normalizes raw chat history into conversation-archive-compatible JSONL, then guides the model to distill daily memory and `MEMORY.md` candidates before applying merges with user confirmation.

Chat History Import

Use this skill when a user wants to import chat history from Claude, ChatGPT, Telegram Desktop exports, Slack exports, markdown logs, JSON/JSONL transcripts, or similar archives into an OpenClaw workspace.

The most common source formats for this skill are ChatGPT exports and Claude exports. Telegram Desktop HTML exports are also supported when the user wants to backfill a Telegram direct chat or group into OpenClaw's raw archive. If the user has not exported data yet, suggest the usual official export entry points first:

  • ChatGPT: Settings -> Data Controls -> Export
  • Claude: Settings -> Privacy -> Export data

These exports usually arrive as ZIP files and are good candidates for the built-in import flow.

What This Skill Owns

  • raw archive import into logs/message-archive-raw/
  • daily memory distillation into memory/YYYY-MM-DD.md
  • MEMORY.md candidate generation
  • review and apply workflow for memory merges

This skill is not a replacement for the live archive plugin or archive search skill.

  • conversation-archive plugin
    • Recommended when the workspace wants future live chats written into the same logs/message-archive-raw/ tree.
    • This skill should emit archive files that are fully compatible with that plugin's raw archive layout.
  • conversation-history skill
    • Strongly recommended when the user wants agents to search imported history after import.
    • This import skill writes archive files; it does not replace archive recall/search workflows on its own.

Preferred combined setup:

  1. use chat-history-import to backfill old history
  2. use conversation-archive to keep new history flowing in
  3. use conversation-history to search both imported and live archive data

What Scripts Do vs. What The Model Does

Scripts handle deterministic work:

  • inspect the source archive
  • normalize messages into the archive schema
  • validate archive compatibility
  • write review artifacts
  • apply approved memory merges

Validation must be reported in two layers when relevant:

  • import-batch validation: whether the files written by this import are valid
  • full-archive validation: whether the entire existing archive tree is valid

If full-archive validation fails because of pre-existing files outside this import batch, do not describe the new import itself as failed. Report the historical archive issue separately.

The model handles semantic work:

  • decide what each day is worth remembering
  • rewrite imported history into the style of existing OpenClaw daily memory
  • decide what belongs in MEMORY.md
  • compare imported MEMORY.md candidates against existing MEMORY.md

Do not try to replace this semantic step with Python heuristics.

Also do not assume the bundled Python parsers can recognize every source format. For unknown input formats, the model may need to inspect the source and write a temporary format-specific parser.

Core Rules

  1. Do not import external history into agents/<agentId>/sessions/.
  2. Treat logs/message-archive-raw/ as the canonical destination for imported raw chat history.
  3. Imported archive output must pass {baseDir}/scripts/validate_archive.py and stay compatible with the conversation-archive plugin's archive contract.
  4. Daily memory should merge into the existing memory/YYYY-MM-DD.md file for that date.
  5. Daily memory body should look like normal OpenClaw memory: concise Chinese bullets, minimal metadata, no “Claude 备份里显示” phrasing.
  6. Use a short HTML comment only to mark import provenance.
  7. MEMORY.md is the default memory file here and is always review-required before apply.

Large Export Handling

If the user says they already uploaded an archive, but the current chat channel only exposes a placeholder or incomplete file payload, treat that as a transport limitation first.

For large ChatGPT or similar exports, guide the user toward a smaller text-focused package before retrying upload:

  1. unzip the export locally
  2. keep the conversation JSON files first
  3. keep optional small metadata files only when useful
  4. remove bulky attachments such as images, audio, video, PDFs, Office files, and other binary artifacts
  5. re-zip the reduced package and retry import

For ChatGPT-style exports, the most important files are usually:

  • conversations.json
  • conversations-*.json
  • optional: group_chats.json
  • optional: export_manifest.json

If the reduced archive still cannot be uploaded through the chat channel, ask for one of these instead:

  • a direct download URL
  • a host-local file path
  • a cloud storage link that can be fetched from the host

Use a temp path or another host-local staging path for large imports rather than polluting workspace/.

Import Workflow

1. Inspect

Start by inspecting the source:

bash
python3 {baseDir}/scripts/inspect_import.py /path/to/archive-or-file

Use local file structure first. Use web research only as fallback for unclear formats.

When helpful, check whether the current workspace already has conversation-archive and conversation-history available, so the user can be told what will happen after import:

  • archive-only import
  • import plus future live archive
  • import plus searchable archive recall
2. Normalize Raw Archive

Normalize the source into the archive schema described in {baseDir}/references/schema.md:

bash
python3 {baseDir}/scripts/normalize_import.py /path/to/archive --archive-root logs/message-archive-raw --workspace workspace --agent-id main --apply
python3 {baseDir}/scripts/validate_archive.py logs/message-archive-raw

After validation, explicitly separate these outcomes:

  1. whether the newly written files from this import batch are valid
  2. whether the pre-existing archive tree is fully valid

If validation errors point to old archive files unrelated to the current import, report that clearly as a historical archive issue rather than an import-batch failure.

Unknown Format Handling

When the bundled parser does not recognize the input format, use this fallback sequence:

  1. Inspect the source files directly.
  2. Determine whether the structure is simple enough to map by hand.
  3. If not, write a temporary Python parser under a temp directory.
  4. Make that parser output the canonical archive JSONL shape from {baseDir}/references/schema.md.
  5. Run {baseDir}/scripts/validate_archive.py on the result before claiming success.

Preferred order:

  1. bundled parser
  2. model-assisted direct mapping
  3. model-authored temporary parser

Guardrails for temporary parsers:

  • only transform source data into canonical archive JSONL
  • do not write directly into MEMORY.md
  • do not bypass the archive validator
  • keep source-specific logic isolated; do not pollute the skill with one-off code unless the format is worth supporting permanently

If a bundled parser is missing for a format that seems broadly reusable, mention that it may be worth promoting the temporary parser into a maintained parser later.

Show full SKILL.md (937 more words)Show less
3. Distill Daily Memory

This step is model-driven.

Before writing any daily memory, switch into Plan Mode (or an equivalent explicit checklist workflow) and review the import one date at a time.

When the runtime supports subAgents or delegated parallel review, prefer using them to review imported dates one by one or in very small date batches. The goal is coverage and auditability, not speed alone.

Use the helper script to build the review checklist whenever possible:

bash
python3 {baseDir}/scripts/build_review_checklist.py logs/message-archive-raw \
  --source-archive <archive-name> \
  --source-provider <provider> \
  --md-out tmp/chat-import-review-checklist.md \
  --json-out tmp/chat-import-review-checklist.json

This helper gives you a date-by-date checklist with entry counts so the Plan Mode review can be explicit and auditable.

Required review process:

  1. list every imported YYYY-MM-DD.jsonl date file first
  2. create a checklist covering all imported dates
  3. when subAgents are available, assign imported dates one by one, or in very small date batches, so every date has an explicit review owner
  4. read each date fully before deciding what to write
  5. do not infer from titles, conversation names, or sampling alone
  6. do not apply MEMORY.md standards when deciding daily memory
  7. after finishing review for one date, mark that checklist item as done immediately
  8. only claim daily-memory completion after every imported date has been marked reviewed
  9. when a date already has a local daily memory file, still check for missing imported bullets before deciding no change is needed

Checklist discipline is part of the workflow, not an optional nicety. If a date was reviewed, the checklist should show that review explicitly.

Before writing any memory, first read the local memory rules from the current OpenClaw environment.

Read in this order when available:

  1. local openclaw.json
    • focus on agents.defaults.compaction.memoryFlush.prompt
    • focus on agents.defaults.compaction.memoryFlush.systemPrompt
  2. workspace AGENTS.md
    • look for memory-writing rules, what counts as worth remembering, and what to exclude
  3. existing MEMORY.md
    • learn the default memory style already in use
  4. recent memory/YYYY-MM-DD.md
    • learn the local daily memory writing style from actual files, not assumptions

Use these local rules as the primary source of truth. If local rules conflict with anything in this skill, follow the local rules. The generic guidance in this skill is not an equal second source of truth; it is fallback-only scaffolding for cases where the local environment is missing rules or is still too vague to decide.

For ready-to-use prompt templates, read {baseDir}/references/prompts.md.

For each relevant date:

  • read the imported archive entries for that day
  • decide what is important enough to preserve in that day's log by applying the local OpenClaw memory rules first
  • only if those local rules are missing or too vague, fall back to the generic daily-memory heuristics bundled with this skill
  • write only the few items that survive that local-rule-first judgment
  • match existing OpenClaw daily memory style

Daily memory is a day log, not a default-memory summary. Do not over-filter it using long-term-memory standards.

Good output shape:

md
# 2024-04-14

<!-- imported-memory provider=claude archive=data-...zip -->
- 开始用 Claude 辅助起草中文股东信,采用“逐段整理,最后整合全文”的工作方式。

Bad output shape:

  • profile dumps
  • long autobiographical summaries
  • “Claude 备份显示……”
  • verbose provenance in the body
4. Distill MEMORY.md Candidates

Choose one of these modes explicitly:

  1. source-memory only Use a dedicated memory-like file from the import source when available, such as Claude memories.json.

  2. archive-distill only Distill MEMORY.md candidates directly from the imported archive.

  3. hybrid Use source memory as the base, then refine or supplement it from archive evidence.

Default:

  • if source memory exists, prefer source-memory only
  • only use archive-distill only or hybrid when the user explicitly wants the heavier path

Before choosing wording and granularity, read local MEMORY.md and recent daily memory files so the imported candidates match the current workspace style.

Preferred user-facing wording:

  • call MEMORY.md the default memory or 默认记忆
  • only use “长期记忆” when needed to contrast it with daily logs
  • avoid treating “long-term memory” as the canonical product term

Warn the user that archive-wide MEMORY.md distillation is slower and more dependent on model quality.

5. Stage Review Payload

After the model writes daily memory bullets and MEMORY.md bullets, save them in a JSON payload with this shape:

json
{
  "daily_memory": [
    {
      "date": "2024-04-14",
      "source_provider": "claude",
      "source_archive": "claude-export.zip",
      "bullets": [
        "开始用外部模型辅助起草正式中文文稿,采用“逐段整理,最后整合全文”的工作方式。"
      ]
    }
  ],
  "memory_md": [
    {
      "section": "关于用户",
      "source_provider": "claude",
      "source_archive": "claude-export.zip",
      "bullets": [
        "用户可在多语言环境中自然切换,个人交流常偏好中文。",
        "长期关注科技、游戏与时事。"
      ]
    }
  ]
}

Then stage or apply with:

bash
python3 {baseDir}/scripts/memory_merge.py /path/to/payload.json --review-root tmp/chat-history-import-review

Use memory_md as the preferred payload key. long_term_memory is still accepted for compatibility, but new work should use memory_md.

6. Apply

Daily memory can be applied directly:

bash
python3 {baseDir}/scripts/memory_merge.py /path/to/payload.json --memory-root memory --apply-daily

MEMORY.md candidates must be confirmed first:

bash
python3 {baseDir}/scripts/memory_merge.py /path/to/payload.json --memory-file MEMORY.md --apply-long-term

After a successful import, ask the user whether they want to delete the source archive, extracted source directory, and temp files to save disk space. Do not delete them without explicit confirmation.

Output Expectations

When reporting progress or completion, include:

  • detected source format
  • archive root written
  • import-batch validation result
  • full-archive validation result (if checked)
  • reviewed dates / total imported dates
  • which daily memory dates were updated
  • whether MEMORY.md candidates were only staged or also applied

Guardrails

  • Do not claim imported archive compatibility unless validation passes.
  • Do not describe the current import as failed when only pre-existing archive files failed full-archive validation.
  • Do not imply that imported history will automatically be searchable unless the workspace also has an archive-retrieval workflow such as conversation-history.
  • Do not imply that future live chats will keep flowing into the same archive tree unless conversation-archive or equivalent live archive plumbing is enabled.
  • Do not let imported daily memory read like a profile summary.
  • Do not silently overwrite existing MEMORY.md facts.
  • Do not add bulky metadata into daily memory bodies.
  • Do not skip daily-memory review based only on titles, thread names, or sparse sampling.
  • Do not apply MEMORY.md filtering standards to daily memory distillation.
  • Do not assume unknown source formats can be handled safely without inspection.
  • Do not promote a temporary parser into the skill unless it is stable and broadly reusable.
  • Do not invent memory-writing preferences when the local OpenClaw environment already exposes them in config or existing memory files.

Read {baseDir}/references/schema.md before changing archive output.

© dashhuang, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 13 other files (scripts, references) in the repository root of dashhuang/openclaw-chat-history-import.

  • SKILL.md
  • .github/workflows/validate.yml
  • .gitignore
  • LICENSE
  • README.md
  • references/prompts.md
  • references/schema.md
  • scripts/archive_contract.py
  • scripts/build_review_checklist.py
  • scripts/inspect_import.py
  • scripts/memory_merge.py
  • scripts/normalize_import.py
  • scripts/validate_archive.py
  • tests/test_telegram_desktop_import.py

Open the folder on GitHubat commit 31de67f

Compare with similar skills

Chat History Import next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Chat History Import compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Chat History Import this skilldashhuang/openclaw-chat-history-import144—~3.8kAutomated safety check: PassMIT
Project Managerpwrdrvr/openclaw-codex-app-server265—~1.5kAutomated safety check: PassMIT
Releasepwrdrvr/openclaw-codex-app-server265—~2.2kAutomated safety check: PassMIT
Test Ocas Openclawpwrdrvr/openclaw-codex-app-server265—~4kAutomated safety check: PassMIT
Claude To Codex Migrationgrandamenium/cortextos101—~12kAutomated safety check: WarnMIT
OrlixBankrBot/skills1.2k—~2.7kAutomated safety check: PassNone

Similar skills

  • Project Manager

    pwrdrvr/openclaw-codex-app-server

    Manage GitHub issues and the GitHub Project board for the current repository, while keeping the local tracker in sync.

    265 GitHub stars~1.5k tokensUpdated 1 mo ago
    Product & Project ManagementAuto-check passed
  • Release

    pwrdrvr/openclaw-codex-app-server

    Plan and publish a GitHub Release in a tag-driven repository.

    265 GitHub stars~2.2k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Test Ocas Openclaw

    pwrdrvr/openclaw-codex-app-server

    Regression test the OpenClaw Codex App Server plugin against a live local OpenClaw instance in Telegram or Discord.

    265 GitHub stars~4k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Claude To Codex Migration

    grandamenium/cortextos

    Migrate ANY cortextOS agent from the claude-code runtime to the live codex-app-server runtime.

    101 GitHub stars~12k tokensUpdated 18 days ago
    Agent WorkflowsAuto-check: warnings
  • Orlix

    BankrBot/skills

    Personal AI Operating System on Base. An agent skill from BankrBot/skills.

    1.2k GitHub stars~2.7k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Buffy Agent

    LeoYeAI/openclaw-master-skills

    Free habit tracking, todo, and routines — create and track up to 25 habits, 100 tasks, and 15 routines; schedule reminders and daily briefings across ChatGPT, Telegram, Slack, and OpenClaw.

    2.2k GitHub stars~4.1k tokensUpdated 2 mo ago
    Productivity & AutomationAuto-check passed

More from dashhuang/openclaw-chat-history-import

  • Conversation History

    dashhuang/openclaw-chat-history-import

    A skill your agent uses when the user asks what was said earlier in a chat, wants an old decision, exact wording, prior links, or suspects the agent forgot conversation context across Telegram…

    144 GitHub stars~912 tokensUpdated 6 mo ago
    Auto-check passed

Works with

Questions about Chat History Import

What does Chat History Import do?

A skill your agent uses when the user wants to import external chat exports into OpenClaw. Chat History Import is an agent skill from dashhuang/openclaw-chat-history-import. Use when the user wants to import external chat exports into OpenClaw.

When should I use Chat History Import?

Chat History Import fits situations like: the user wants to import external chat exports into OpenClaw.

How do I install Chat History Import in Claude Code?

Run `npx skills add dashhuang/openclaw-chat-history-import --skill chat-history-import -a claude-code`. Or copy the skill folder (the dashhuang/openclaw-chat-history-import repository) into .claude/skills/chat-history-import in your project. Claude Code loads it when a task matches its description.

How do I install Chat History Import in Codex?

Run `npx skills add dashhuang/openclaw-chat-history-import --skill chat-history-import -a codex`. Or copy the skill folder (the dashhuang/openclaw-chat-history-import repository) into .agents/skills/chat-history-import in your project. Codex loads it when a task matches its description.

Can I use Chat History Import in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add dashhuang/openclaw-chat-history-import --skill chat-history-import -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/chat-history-import, .gemini/skills/chat-history-import, .github/skills/chat-history-import and .opencode/skills/chat-history-import in your project.

What does Chat History Import need to run?

Going by SKILL.md and its folder, Chat History Import needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Chat History Import access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Chat History Import safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Chat History Import use?

Chat History Import is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Chat History Import use?

About 3.8k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.8k tokens, read only when the agent opens those files.

What are the alternatives to Chat History Import?

Skills that share tags, products or a category with Chat History Import: Project Manager (pwrdrvr/openclaw-codex-app-server, 265 stars), Release (pwrdrvr/openclaw-codex-app-server, 265 stars), Test Ocas Openclaw (pwrdrvr/openclaw-codex-app-server, 265 stars) and Claude To Codex Migration (grandamenium/cortextos, 101 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Chat History Import?

dashhuang (a GitHub user) maintains it in dashhuang/openclaw-chat-history-import, which has 144 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on April 10, 2026.

Source: dashhuang/openclaw-chat-history-import on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.