Save, search, and continue Claude Code conversations as local markdown files.
13 slash commands for managing conversation history in Claude Code. Every message is crash-proof saved to a markdown file, organized by project, readable offline in any editor.
Requirements: Node.js 22+, Claude Code CLI.
npm install -g @kosoukhov/cht-cli
cht setupcht setup registers 13 slash commands and 4 auto-save hooks in your Claude Code configuration. Run it once after installation, and again after updates.
Verify the installation:
cht doctor/cht-new myproject "Auth refactor" # create a chat
... # work as usual — messages auto-saved
/cht-end # stop recording
On next Claude Code launch:
/cht-continue myproject # resume the chat
| Command | Arguments | Description |
|---|---|---|
/cht-new |
[project] [title] |
Create a new chat and enable auto-save |
/cht-end |
-- | Stop recording messages |
/cht-continue |
[project] |
Resume a previous chat (loads history + enables recording) |
/cht-include |
[project] |
Load a chat as context (without recording) |
| Command | Arguments | Description |
|---|---|---|
/cht-list |
[project] [--recent N] [--tag TAG] [--archived] |
List chats with filtering |
/cht-search |
<query> [project] [--all] |
Search by title and content |
| Command | Arguments | Description |
|---|---|---|
/cht-rename |
[project] |
Rename a chat |
/cht-tag |
<add|remove> <tag> |
Add/remove a tag |
/cht-archive |
[project] |
Move to archive |
/cht-restore |
[project] |
Restore from archive |
/cht-delete |
[project] |
Delete permanently |
/cht-status |
-- | Show current chat stats (size, messages, chain info) |
/cht-rollover |
-- | Start a new file for the current chat, linking old and new |
These are terminal commands (not Claude Code slash commands):
| Command | Description |
|---|---|
cht setup |
Copy skills to ~/.claude/skills/ and register hooks in ~/.claude/settings.json |
cht doctor |
Validate installation: skills present, hooks registered, CLI on PATH, storage accessible |
cht migrate |
Remove old .claude/commands/cht/ format if present |
/cht-new # general / (untitled)
/cht-new work # project=work, untitled
/cht-new work "Payment bug" # project=work, with title
After creation, all messages are automatically saved to the file.
Recording stops on /cht-end or when you exit Claude Code.
/cht-continue work
Shows the 10 most recent chats in the project; you pick one. Claude loads the full history, gives a brief summary, and enables recording.
/cht-include work
Loads the chat contents for reference, but does not switch the active session. Useful when you need to recall a previous discussion without interrupting current recording.
/cht-search "authorization" # in the general project
/cht-search "authorization" work # in the work project
/cht-search "authorization" --all # across all projects
/cht-tag add bugfix
/cht-tag add review
/cht-tag remove bugfix
Works with the active chat. If there is no active chat, you will be prompted to select one.
Filter by tags:
/cht-list --tag bugfix
/cht-list work --tag review
/cht-archive work # move an old chat to the archive
/cht-restore work # bring it back
/cht-list --archived # view archived chats
/cht-rename work # rename a chat
/cht-delete work # delete permanently (irreversible)
A project is simply a way to group chats. The default project is general.
You do not need to create projects in advance -- they appear when you create the first chat.
/cht-new general "Notes"
/cht-new work "Sprint 14"
/cht-new personal "Ideas"
Chats are saved in chats/ as markdown files with YAML frontmatter:
chats/
general/
2026-03-30-notes.md
work/
2026-03-30-sprint-14.md
Each file is plain markdown that can be read, edited, and committed to git.
The storage directory is resolved in this priority order:
CHAT_STORAGE_DIRenvironment variable (explicit override)CLAUDE_PROJECT_DIR/chats(set automatically by Claude Code hooks)./chatsin the current working directory (default)
To use a custom storage location:
export CHAT_STORAGE_DIR="$HOME/my-chats"Run cht doctor to see which storage path is currently active.
If you used the old /cht:command syntax (colon-separated):
npm install -g @kosoukhov/cht-cli # install latest
cht setup # register new skills and hooks
cht migrate # remove old .claude/commands/cht/ format
cht doctor # verify everything is greenKey changes:
- Command syntax:
/cht:newis now/cht-new(colon replaced with hyphen) - Skills location: moved from
.claude/commands/cht/to~/.claude/skills/cht-*/ - Installation: one-time
cht setuprequired afternpm install