chron
v0.1.70Timestamped audit log for every AI conversation — stored locally in SQLite, owned by you.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
init_session
Initialize or resume an audit session. Returns session_id, message_count, first_message_at, and recent messages in a single call — use this instead of calling start_session + get_session_history separately.
| Parameter | Type | Description |
|---|---|---|
title * | string | Descriptive session title, e.g. "Contract review — 2026-05-08" |
ai_tool | string | AI tool name: "claude", "cursor", "windsurf", etc. |
attach | boolean | Set true when Chron is being started partway through a conversation that has already begun. Marks the session as partial evidence valid from the attach point forward. Do not estimate how many earlier… |
external_ref | string | External ticket/PR reference, e.g. "jira:ENG-123" or "github:org/repo#456" |
limit | integer | Number of recent messages to return (default: 10) |
metadata | object | Evidence provenance. `partial` is derived by Chron and cannot be set by the caller. |
parent_session_id | string | Parent session ID if this is a subagent session spawned by another session |
resume_latest | boolean | When true, resumes the most recently active session instead of matching by title. Use this to survive context compaction without breaking the audit chain. |
start_session
Create a new audit session or resume an existing one by title. Call this at the start of every conversation.
| Parameter | Type | Description |
|---|---|---|
title * | string | Descriptive session title, e.g. "Contract review — 2026-05-08" |
ai_tool | string | AI tool name: "claude", "cursor", "windsurf", etc. |
external_ref | string | External ticket/PR reference, e.g. "jira:ENG-123" |
parent_session_id | string | Parent session ID if this is a subagent session |
log_message
Record a single message (user or assistant) with the current local datetime and timezone offset. Call before responding for user messages, and before sending for assistant messages.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full message text |
role * | string | |
session_id * | string | Session ID returned by start_session |
log_tool_call
Record an AI tool invocation as a first-class audit event (event_type=tool_call). Call immediately before executing a tool. Returns tool_call_id to pass to log_tool_result.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Session ID |
tool_input * | object | Tool input parameters as an object |
tool_name * | string | Name of the tool being called (e.g. "Edit", "Bash", "WebFetch") |
tool_call_id | string | Optional ID to link this call to its result. Generated automatically if omitted. |
log_tool_result
Record the result of a tool call as a first-class audit event (event_type=tool_result). Call immediately after receiving tool output. Links back to log_tool_call via tool_call_id.
| Parameter | Type | Description |
|---|---|---|
output * | string | Tool output (stdout, file content, API response, etc.) |
session_id * | string | Session ID |
tool_call_id * | string | tool_call_id returned by log_tool_call |
exit_code | integer | Exit code for shell tools (0 = success) |
log_code_change
Record a file edit as a first-class audit event (event_type=code_change). Call after every Edit or Write tool call with the unified diff. Diff content is included in the hash chain.
| Parameter | Type | Description |
|---|---|---|
diff * | string | Unified diff string (before/after) |
file_path * | string | Path of the file that was changed |
operation * | string | Type of file operation |
session_id * | string | Session ID |
log_exchange
Record a user+assistant exchange from historical or batch imports only. Do NOT use for live conversations — both timestamps are captured at the same instant with no real gap. For live sessions always call log_message twice: once for the user message, once for the assistant response.
| Parameter | Type | Description |
|---|---|---|
assistant_content * | string | The exact assistant response |
session_id * | string | Session ID returned by start_session |
user_content * | string | The exact user message |
list_sessions
List all audit sessions ordered by most recently active. Returns id, title, ai_tool, message_count, created_at, updated_at.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Return only the most recent N sessions |
get_session_history
Retrieve the full timestamped audit log for a session, oldest first.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
limit | integer | Return only the most recent N messages |
verify_session
Verify the tamper-evident hash chain for a session. Returns valid=true if no rows were edited after logging, or the first broken link if tampering is detected.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Session ID to verify |
scan_prompt
Scan a prompt for secrets and sensitive data before sending to any AI. Returns detected secrets, a redacted version with tokens, and a token_map to restore the real values after the AI responds.
| Parameter | Type | Description |
|---|---|---|
content * | string | The prompt text to scan |
delete_session
Permanently delete a session and all its messages. Cascades to secrets_detected. Returns deleted=true or deleted=false if not found.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Session ID to delete |
search_sessions
Full-text search across all logged AI conversations. Returns matching sessions with excerpts. Uses SQLite FTS5 with porter stemming — supports phrases ("exact match"), boolean (term1 OR term2), and prefix (migrat*).
| Parameter | Type | Description |
|---|---|---|
query * | string | FTS5 search query, e.g. "database migration" or "auth bug" or "deploy OR release" |
limit | integer | Max sessions to return (default: 10) |
summarize_session
Return a structured summary of a session: timeline with latencies, mutations detected, secrets touched, and possible prod-account references. Useful for compliance review and change-control evidence.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | Full session ID or unique prefix |
rehydrate_response
Restore real secret values into an AI response that contains $CHRON_* tokens. Pass the token_map returned by scan_prompt.
| Parameter | Type | Description |
|---|---|---|
text * | string | AI response text containing $CHRON_* tokens |
token_map * | object | token_map from scan_prompt output |