Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计异常

chat-history聊天记录

Agent Skill

chat-history 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

915

周安装

37

GitHub Stars

40

下载量

287
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:chat-history(聊天记录)
来源仓库:https://github.com/tyrchen/claude-skills
仓库路径:skills/chat-history
安装命令:
npx skills add https://github.com/tyrchen/claude-skills --skill chat-history
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/tyrchen/claude-skills --skill chat-history

简介

用于提取 Claude Code 会话历史并归档为按日期组织的 Markdown 文件。

  • 适合记录对话内容、创建指令日志或导出用户输入,便于未来参考和分析。
  • 支持从 ~/.claude/projects/ 下的 .jsonl 文件中提取消息,按项目路径编码组织。
  • 使用时需注意数据位置和格式,避免误操作原始会话文件。
  • chat-history 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Chat History Extractor

Extract user inputs from Claude Code session history (~/.claude/projects/) and organize them into a project's .chats directory with daily markdown files.

When to Use This Skill

Use this skill when the user wants to:

  • Extract session history from Claude Code sessions
  • Document conversations for future reference
  • Create instruction logs organized by date
  • Export user inputs from .jsonl session files
  • Maintain a changelog of Claude interactions

How It Works

Claude Code stores session data in ~/.claude/projects/{project-path-encoded}/ as .jsonl files. Each file contains messages with:

  • type: "user" - User messages
  • userType: "external" - External user (not system/agent)
  • message.content - The actual message content

This skill extracts meaningful user instructions (filtering out system commands, tool results, and session continuations) and organizes them by date into .chats/{YYYYMMDD}.md files.

Instructions

Step 1: Identify the Project Session Directory

The session directory is derived from the current working directory path:

  • Replace / with - in the path
  • Prefix with -
  • Location: ~/.claude/projects/{encoded-path}/
# Example: /Users/tchen/projects/tubi/titc
# Becomes: -Users-tchen-projects-tubi-titc
# Full path: ~/.claude/projects/-Users-tchen-projects-tubi-titc/

Step 2: Find Session Files by Date

List session files and filter by modification date:

# List all main session files (excluding agent-* files) for a specific date
ls -la ~/.claude/projects/{project-dir}/*.jsonl | grep "Dec 25" | grep -v agent-

Step 3: Extract User Inputs

Extract user messages from jsonl files using jq:

cat {session-file}.jsonl | jq -r '
  select(.type == "user" and .userType == "external" and (.isMeta | not)) |
  .message.content |
  if type == "string" then . else empty end
' | grep -v "^Caveat:" \
  | grep -v "^<command" \
  | grep -v "^<local-command" \
  | grep -v "^This session is being continued" \
  | grep -v "^<user-prompt-submit-hook>" \
  | grep -v "^Analysis:" \
  | grep -v "^$"

Step 4: Create/Update.chats Files

Create markdown files in .chats/ directory with format:

# Instructions

## {task title}

{user instruction}

## {another task title}

{another user instruction}

Step 5: Commit Changes

After creating/updating chat files, commit with:

git add .chats/*.md
git commit -m "docs(chats): add session history for {date range}"

File Format

Each .chats/{YYYYMMDD}.md file should:

  • Start with # Instructions header
  • Use ## for each major task/instruction
  • Include the actual user input text
  • Group related instructions under the same heading
  • Preserve code blocks and formatting

Example Output

.chats/20251225.md:

# Instructions

## implement feature X

based on @specs/feature-x.md implement all phases entirely

commit the code and test

## fix bug Y

investigate why component Z is not working

use sub agents to analyze the issue in parallel

Filtering Rules

Include:

  • Direct user instructions and requests
  • Questions about the codebase
  • Task specifications and requirements

Exclude:

  • System commands (<command-name>, <local-command-stdout>)
  • Session continuation messages
  • Tool results and agent responses
  • Hook notifications (<user-prompt-submit-hook>)
  • Empty lines and caveat messages

Workflow Summary

  1. Get current working directory
  2. Compute encoded project path
  3. Find session directory: ~/.claude/projects/{encoded-path}/
  4. List sessions grouped by date
  5. For each date with sessions:

- Extract user inputs from all sessions - Create .chats/{YYYYMMDD}.md - Organize inputs with descriptive headers

  1. Create .chats/ directory if it doesn't exist
  2. Optionally commit the changes

Helper Script

You can use this bash snippet to quickly find the project session directory:

# Get encoded project path
PROJECT_PATH=$(pwd | sed 's|/|-|g' | sed 's|^|/|' | sed 's|^/|-|')
SESSION_DIR="$HOME/.claude/projects/$PROJECT_PATH"

# Check if exists
if [ -d "$SESSION_DIR" ]; then
    echo "Session directory: $SESSION_DIR"
    echo "Sessions by date:"
    ls -la "$SESSION_DIR"/*.jsonl 2>/dev/null | grep -v agent- | awk '{print $6, $7}' | sort -u
else
    echo "No session directory found for this project"
fi

Notes

  • Session files named agent-*.jsonl are sub-agent sessions and typically don't contain direct user input
  • Main session files have UUID-style names (e.g., 01e78099-de0e-4424-845c-518638c8241e.jsonl)
  • The .message.content field can be either a string (user text) or an array (tool results)
  • Always verify the extracted content makes sense before committing

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

25.47%
按下载量换算73

Antigravity

24.21%
按下载量换算69

Gemini CLI

16.27%
按下载量换算47

OpenCode

14.1%
按下载量换算40

windsurf

7.93%
按下载量换算23

Codex

3.86%
按下载量换算11

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

未通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills