@cianfrani/devlog

中文文档
2.2.0发布于 2026/11/01MITES Module构建来源已验证

Archive AI assistant conversations (Claude Code, opencode, pi)

原始使用文档
文档目录12 节
  1. Install
  2. Commands
  3. Options
  4. MCP server
  5. How it works
  6. Where redaction applies
  7. Session sources
  8. pi extension records
  9. File layout
  10. Configuration
  11. Requirements
  12. Contributing

Devlog

Devlog copies all your coding dingus transcripts to a Third Location so you have access to them after their default retention period deletes them.

Supports Claude Code, Opencode, and pi.

Install

npm install -g @cianfrani/devlog
devlog init

devlog init asks where to store your archive (default: ~/devlog) and which agents to configure the MCP server for.

Commands

devlog                  # copy sessions, then index them for search
devlog archive          # only copy sessions to your archive
devlog index            # only index archived sessions into SQLite
devlog mcp              # start the MCP server (stdio)
devlog init             # first-time setup

Each stage skips sessions that haven't changed since the last run. Use archive or index when you only need one stage.

Options

--verbose    show per-project and per-session details
--debug      extra noisy diagnostics
--rebuild    with devlog or index, wipe the database and re-index everything

MCP server

After running devlog init, you can search your session history from inside your coding agent.

Tools: search, list_sessions, get_session, schema, query

If you don't want to use an MCP, write a skill that describes where the sqlite or sessions are stored.

search past sessions for "auth middleware"
list sessions for project "quoting-ui"
get session <session_id>

Raw SQL works too:

SELECT project, COUNT(*) as n FROM sessions GROUP BY project ORDER BY n DESC

How it works

Archive reads each agent's local session data and writes it to ~/devlog/ as normalized JSONL. Claude Code and pi store sessions as files, so devlog copies those directly. Opencode stores sessions in a SQLite database now, so devlog extracts and converts them.

Index parses the archived JSONL into a SQLite database with full-text search (FTS5, porter stemming). Before content is written to SQLite, devlog does a best-effort scrub of common credential patterns plus exact matches for sensitive environment variable values such as OPENAI_API_KEY and GITHUB_TOKEN. The MCP server reads from that database.

Where redaction applies

Redaction runs only on content written to the SQLite index, which is the surface your coding agent queries through the MCP server. Archived JSONL files in ~/devlog/ are copied byte-for-byte from the source session files — they are never rewritten or scrubbed. This is deliberate:

  • The archive is meant to be a faithful backup of what the agent actually saw. Rewriting it would make it impossible to diff against the source or recover the original context.
  • The index is the queryable surface. Scrubbing there is where it prevents secrets from leaking into search results or MCP responses.

If you need the archive itself to be clean, scrub it out-of-band (e.g., wipe a session file, then devlog index --rebuild). The scrubber is intentionally narrow: it helps avoid casually surfacing secrets, but it is not a full PII/privacy sanitizer.

Session sources

AgentSourceFormat
Claude Code~/.claude/projects/JSONL
opencode~/.local/share/opencode/opencode.dbSQLite
pi~/.pi/agent/sessions/JSONL

pi extension records

pi writes generic extension records (custom and custom_message) alongside its conversational messages. Devlog indexes these from their public envelope only — it never interprets any third-party extension's private payload schema. A custom entry's data is serialized as opaque JSON inside a <pi:custom> block, so nested values stay searchable but are displayed verbatim rather than reformatted. Raw archived JSONL files are never rewritten by indexing; upgrading across an index-version bump rebuilds the local SQLite cache on the next devlog index, making previously dropped extension state searchable again.

File layout

Follows the XDG Base Directory spec:

WhatPathXDG directory
Config~/.config/devlog/config.jsonXDG_CONFIG_HOME
Archive~/devlog/ (configurable)user-chosen
Index DB~/.local/state/devlog/index.db (configurable)XDG_STATE_HOME

Rebuild the index from the archive at any time with devlog index --rebuild.

Configuration

~/.config/devlog/config.json (created by devlog init):

{
  "archiveDir": "/Users/you/devlog",
  "dbPath": "/Users/you/devlog/index.db",
  "excludeProjects": ["fidelio", "scratch"]
}
KeyDefaultWhat it does
archiveDir~/.config/devlogWhere raw JSONL session copies are written.
dbPath~/.local/state/devlog/index.dbWhere the SQLite index lives. Both devlog index and devlog mcp read this key.
excludeProjects[]Fuzzy, case-insensitive substring matches against project slugs/paths. Full slug not required.

excludeProjects examples:

  • "fidelio" matches -Users-you-src-tries-2026-02-17-fidelio
  • "scratch" matches /Users/you/Code/scratchpad

Requirements

  • Bun — the CLI runs on the Bun runtime.

Contributing

Working from a checkout: bun install && bun run build:cli, then invoke ./dist/cli.js directly.

版本与发布记录

@cianfrani/devlog 共发布 26 个版本,首次发布于 2026/04/30;过去 12 个月发布了 26 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.2.0latest2026/11/012 天前
2.1.22026/10/1321 天前
2.1.12026/10/0925 天前
2.1.02026/09/301 个月前
2.0.02026/09/141 个月前
1.9.22026/08/262 个月前

关于 @cianfrani/devlog 的常见问题

@cianfrani/devlog 是什么?

存档AI助手对话(Claude Code, opencode, pi)

如何安装 @cianfrani/devlog?

在项目目录运行 npm install @cianfrani/devlog,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 devlog,可以用 npx devlog 直接运行。

@cianfrani/devlog 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/cianfrani__devlog 是否存在。

@cianfrani/devlog 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cianfrani/devlog 可以商用吗?

@cianfrani/devlog 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cianfrani/devlog 还在维护吗?

最新版本 2.2.0 发布于 2026/11/01(2 天前);至今共发布 26 个版本,其中过去 12 个月发布了 26 个;首次发布于 2026/04/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。