t3-code
Installation
SKILL.md
t3-code 本机知识
T3 Code 的本地状态在 ~/.t3/ 下。会话、命令、消息等运行数据落 SQLite,复盘/排查时直接查库,比翻日志高效。
状态数据库
- 当前库:
~/.t3/userdata/statev2.sqlite;state.sqlite是旧库。 - v2 投影表(
orchestration_v2_projection_*)2025-10-03 起为权威数据;v1 的projection_*表已停写,只在看更早历史时查。 - 关键表:
orchestration_v2_projection_threads:线程。列含thread_id、project_id、title、default_provider、runtime_mode、created_at、updated_at、archived_at。orchestration_v2_projection_turn_items:线程内事件流,分析主力表。列含thread_id、run_id、ordinal、type、status、updated_at、payload_json。orchestration_v2_projection_subagents/runs/run_attempts/provider_sessions:委派与运行明细。scheduled_tasks、projection_thread_pull_requests:定时任务、线程关联的 PR。
turn_items.type常见值:assistant_message、command_execution、reasoning、dynamic_tool(MCP 调用)、user_message、file_change、file_search、subagent、error。payload_json按 type 不同:command_execution含input/output/exitCode/startedAt/completedAt;assistant_message/reasoning含正文文本。- 留存限制:约 87% 的
command_execution只在output里存「Exited with code N」一行,exitCode字段经常缺省,完整 stdout/stderr 不落库——判成败主要靠 output 文本里的退出码。 - 委派任务的子代理是独立线程(命名形如
thread:delegated-task:*),查子代理活动按thread_id过滤即可。 - Windows 上没有 sqlite3 CLI,用 Python 自带的 sqlite3 模块查库;查询稍长就写临时 .py 文件再跑,cmd 里内联
python -c的引号容易翻车(exec 是 cmd,&&连接而不是;)。