db-maintenance

db-maintenance is a skill for Claude Code, Codex from tigu77/tiguclaw. It costs 0 tokens per session (2,404 once invoked), scanned A, original, Apache-2.0.

A maintenance guide for a SQLite database that stores memories, sessions, and conversation records in one file. SQLite is a database system that can keep data in a single file.

In plain words
What is it for?
Use it to back up the database, measure stored conversations and search indexes, estimate growth, and plan archiving.
Why use it?
It provides a way to measure database size and growth while keeping backups and archiving in the right order.

Skill for Claude CodeCodex

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

Good fit Use it to back up the database, measure stored conversations and search indexes, estimate growth, and plan archiving.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tigu77/tiguclaw/db-maintenance
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 tigu77/tiguclaw --skill db-maintenance
Clone the repo
git clone --depth 1 https://github.com/tigu77/tiguclaw

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 db-maintenance

README.md
[![agentmods](https://agentmods.dev/badge/skills/tigu77/tiguclaw/db-maintenance/github.svg)](https://agentmods.dev/skills/tigu77/tiguclaw/db-maintenance)
Your own site
<a href="https://agentmods.dev/skills/tigu77/tiguclaw/db-maintenance"><img src="https://agentmods.dev/badge/skills/tigu77/tiguclaw/db-maintenance/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 db-maintenance

Your own site · 80×15
<a href="https://agentmods.dev/skills/tigu77/tiguclaw/db-maintenance"><img src="https://agentmods.dev/badge/skills/tigu77/tiguclaw/db-maintenance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,404 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 pass 7 Sept 2026
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.00000 $0.02404
Opus 5 $0.00000 $0.01202
Sonnet 5 $0.00000 $0.00481
Haiku 4.5 $0.00000 $0.00240

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

Security

Grade A, and why

db-maintenance 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 4d 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/db-maintenance/SKILL.md · 121 lines

How it starts

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

DB 유지보수

<home>/data/tiguclaw.db 한 파일에 기억·세션·대화 기록이 전부 있다. 그래서 이 문서의 순서는 백업 → 용량 → 아카이브다. 크기는 나중에 문제가 되지만 백업은 처음부터 문제다.

0. 먼저 잰다 — 숫자를 여기서 읽지 말고 지금 재라

★이 문서에 "현재 몇 MB · 몇 년 뒤 1GB" 같은 기준선을 적어두지 않는다. 그런 값은 적는 순간부터 늙고, 다음 사람이 그걸 사실로 믿는다(실제로 이 문서가 두 번 틀린 수치를 들고 있었다 — 한 번은 증가율을, 한 번은 그 근거를). 재는 법만 둔다.

DB="<home>/data/tiguclaw.db"
sqlite3 "$DB" "
WITH sz AS (SELECT
    (SELECT SUM(pgsize) FROM dbstat WHERE name='transcripts') t,
    (SELECT SUM(pgsize) FROM dbstat WHERE name LIKE 'transcripts_fts%') f,
    (SELECT page_count*page_size FROM pragma_page_count(), pragma_page_size()) total),
 grow AS (SELECT sum(length(content))*1.0 c, (max(ts)-min(ts))/86400000.0 days
    FROM transcripts WHERE ts > (strftime('%s','now')-30*86400)*1000)
SELECT
 '현재 '||round(total/1048576.0)||'MB (대화 '||round(t/1048576.0)||' + 색인 '||round(f/1048576.0)||' = '||round(100.0*(t+f)/total)||'%)',
 '월 증가 ~'||round((c/nullif(days,0))*30*(1.0+f*1.0/nullif(t,0))/1048576.0)||'MB',
 '1GB 까지 '||round((1073741824.0-total)/nullif((c/nullif(days,0))*30*(1.0+f*1.0/nullif(t,0)),0)/12.0,1)||'년'
FROM sz, grow;"

증가는 대화 원문만 세면 틀린다 — 검색 색인이 원문에 비례해 따라 붙는다(그 비율도 위 쿼리가 현재 값으로 잰다). 원문만 세서 증가율을 절반으로 잡은 적이 있다.

판정: transcripts(대화 원문) + transcripts_fts(그 색인)가 대부분이면 정상이다 — 둘 다 설계상 무한 증가고 대화가 쌓이는 만큼 는다. events 는 상한이 있어 안 는다. 1GB 까지 몇 년이 남았는지가 구조를 바꿀 때인지 아닌지의 눈금이고, SQLite 는 수 GB 도 잘 다루므로 수백 MB 에서 손대는 건 이르다.

1. 백업 — 이미 자동으로 돈다

먼저 이것부터 알아라: 백업은 v0.27.0 부터 자동이다. 스케줄이 아니라 데몬 유지보수 루프(코어 자기보전 루프(core/self-maintenance) → store/backup.ts)에서 하루 한 벌씩 VACUUM INTO 로 뜨고 7벌만 남긴다. 스케줄 목록에는 안 보인다 — 없다고 "백업 체계가 없다"고 결론내지 마라(실제로 그렇게 오판한 적이 있다. 그리고 중복 스케줄을 제안할 뻔했다).

상태 확인은 두 가지로:

/status                     → "백업: 3시간 전 · 7벌 (940MB)" 한 줄
ls -lt <home>/data/backup/  → 실제 파일

성공은 일부러 조용하다(매일 알림은 배경 소음이 된다). 실패와 첫 벌만 알린다. 끄려면 settings.jsonbackup.enabled: false — 기본은 켜짐이다.

손으로 한 벌 더 뜨려면:

mkdir -p "<home>/data/backup"
sqlite3 "$DB" "VACUUM INTO '<home>/data/backup/tiguclaw-$(date +%F).db'"

Read the full file on GitHub · 121 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. 4d ago Changed · +1 lines d5a6105f9794
  2. 9d ago First seen · 120 lines · 0 tokens per session scan A 7b753467f1e8

Subscribe to this mod's changes

db-maintenance is a skill published in the GitHub repository tigu77/tiguclaw (6 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,404 tokens. 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-31.