chat-logger

chat-logger is a skill for Claude Code, Codex from besoeasy/open-skills. It costs 52 tokens per session (2,482 once invoked), scanned A, original, MIT.

A chat-history system that stores incoming and outgoing messages in a SQLite database, a small database kept in a local file.

In plain words
What is it for?
Use it to build chat history, search earlier messages, review conversations, track interactions, or debug chat flows.
Why use it?
It makes conversations searchable and reviewable for auditing, analytics, and debugging instead of leaving them as unstructured chat logs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to build chat history, search earlier messages, review conversations, track interactions, or debug chat flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/besoeasy/open-skills/chat-logger
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add besoeasy/open-skills --skill chat-logger
Clone the repo
git clone --depth 1 https://github.com/besoeasy/open-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chat-logger

README.md
[![agentmods](https://agentmods.dev/badge/skills/besoeasy/open-skills/chat-logger/github.svg)](https://agentmods.dev/skills/besoeasy/open-skills/chat-logger)
Your own site
<a href="https://agentmods.dev/skills/besoeasy/open-skills/chat-logger"><img src="https://agentmods.dev/badge/skills/besoeasy/open-skills/chat-logger/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chat-logger

Your own site · 80×15
<a href="https://agentmods.dev/skills/besoeasy/open-skills/chat-logger"><img src="https://agentmods.dev/badge/skills/besoeasy/open-skills/chat-logger.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,482 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Data Exfiltration · line 298
    Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.
    Fix: Remove any code that sends prompts, responses, or session data externally. Preserve user privacy; never exfiltrate conversation content.
  • medium Rogue Agent · line 28
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.02482
Opus 5 $0.00026 $0.01241
Sonnet 5 $0.00010 $0.00496
Haiku 4.5 $0.00005 $0.00248

Measured 11d ago against content hash d1d0d02aa48a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

chat-logger scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/chat-logger/SKILL.md · 371 lines

How it starts

The opening of the file, as written. The whole thing — 371 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Chat Logger

Log all incoming and outgoing chat messages to a SQLite database for searchable history, analytics, and auditing. Works with any chat system or agent framework.

When to use

  • Building a searchable chat history system
  • Auditing and reviewing past conversations
  • Creating analytics on chat interactions
  • Debugging chat flows and responses
  • User asks to track or search conversation history

Required tools / APIs

  • Python standard library (sqlite3, datetime, json)
  • Any programming language with SQLite support

No external APIs or services required.

Database Schema

CREATE TABLE IF NOT EXISTS messages (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  timestamp TEXT NOT NULL,
  session_id TEXT,
  sender TEXT NOT NULL,           -- 'user', 'assistant', or identifier
  content TEXT,
  metadata TEXT,                  -- JSON: channel, tools_used, etc.
  created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_timestamp ON messages(timestamp);
CREATE INDEX idx_session ON messages(session_id);
CREATE INDEX idx_sender ON messages(sender);

-- Automatic purge: delete records older than 1 year
DELETE FROM messages WHERE created_at < datetime('now', '-1 year');

Fields:

  • id - Auto-incrementing primary key
  • timestamp - ISO 8601 timestamp of the message
  • session_id - Optional session/conversation identifier
  • sender - Message sender ('user', 'assistant', or custom ID)
  • content - Message text content
  • metadata - JSON field for additional data (channel, tools, context)
  • created_at - Database insertion timestamp

Basic Implementation

Python

Initialize database:

import sqlite3
from datetime import datetime
from pathlib import Path
import json

# Configure database path
DB_PATH = Path.home() / ".chat_logs" / "messages.db"

def init_db():
    """Initialize database and create tables."""
    DB_PATH.parent.mkdir(parents=True, exist_ok=True)
    conn = sqlite3.connect(str(DB_PATH))
    conn.execute("""
        CREATE TABLE IF NOT EXISTS messages (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            timestamp TEXT NOT NULL,
            session_id TEXT,
            sender TEXT NOT NULL,
            content TEXT,
            metadata TEXT,
            created_at DATETIME DEFAULT CURRENT_TIMESTAMP
        )
    """)
    conn.execute("CREATE INDEX IF NOT EXISTS idx_timestamp ON messages(timestamp)")
    conn.execute("CREATE INDEX IF NOT EXISTS idx_session ON messages(session_id)")
    conn.execute("CREATE INDEX IF NOT EXISTS idx_sender ON messages(sender)")
    conn.commit()
    conn.close()

def purge_old_messages():
    """Delete messages older than 1 year to keep the database size sane."""
    conn = sqlite3.connect(str(DB_PATH))
    conn.execute("DELETE FROM messages WHERE created_at < datetime('now', '-1 year')")
    conn.commit()
    conn.close()

# Initialize on import and purge old records
init_db()
purge_old_messages()

Read the full file on GitHub · 371 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 371 lines · 52 tokens per session scan A d1d0d02aa48a

Subscribe to this mod's changes

chat-logger is a skill published in the GitHub repository besoeasy/open-skills (132 stars, last pushed 6d ago), licensed MIT. It adds 52 tokens to every session and 2,482 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

build-with-tinybase

Scaffold, extend, and verify reactive local-first JavaScript or TypeScript applications with TinyBase. Use when choosing TinyBase for in-memory tabular or key-value state, generating an app with create-tinybase, adding schemas or UI bindings, configuring browser or database persistence, configuring MergeableStore…

tinyplex/tinybase · 76 tokens

ax-agent-memory-skills

This skill helps an LLM generate correct AxAgent memory retrieval, context-map, and dynamic skill-loading code using @ax-llm/ax. Use when the user asks about contextMap, AxAgentContextMap, onMemoriesSearch, memoriesCatalog, recall(...), inputs.memories, onLoadedMemories, onUsedMemories, onSkillsSearch, skillsCatalog…

ax-llm/ax · 128 tokens

ax-cpp-agent-memory-skills

Use when writing C++ code with axllm for agent memory, recall callbacks, dynamic skill discovery, loaded-skill state, and used-skill tracking.

ax-llm/ax · 42 tokens

ax-go-agent-memory-skills

Use when writing Go code with github.com/ax-llm/ax/packages/go for agent memory, recall callbacks, dynamic skill discovery, loaded-skill state, and used-skill tracking.

ax-llm/ax · 48 tokens

obsidian-bases

Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries. Use when working with .base files, creating database-like views of notes, or when the user mentions Bases, table views, card views, filters, or formulas in Obsidian.

kepano/obsidian-skills · 63 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens