chron

v0.1.70
io.github.SirinivasK/chron Checked 32 minutes ago Published 6 days ago

Timestamped 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.

ParameterTypeDescription
title *stringDescriptive session title, e.g. "Contract review — 2026-05-08"
ai_toolstringAI tool name: "claude", "cursor", "windsurf", etc.
attachbooleanSet 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_refstringExternal ticket/PR reference, e.g. "jira:ENG-123" or "github:org/repo#456"
limitintegerNumber of recent messages to return (default: 10)
metadataobjectEvidence provenance. `partial` is derived by Chron and cannot be set by the caller.
parent_session_idstringParent session ID if this is a subagent session spawned by another session
resume_latestbooleanWhen 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.

ParameterTypeDescription
title *stringDescriptive session title, e.g. "Contract review — 2026-05-08"
ai_toolstringAI tool name: "claude", "cursor", "windsurf", etc.
external_refstringExternal ticket/PR reference, e.g. "jira:ENG-123"
parent_session_idstringParent 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.

ParameterTypeDescription
content *stringFull message text
role *string
session_id *stringSession 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.

ParameterTypeDescription
session_id *stringSession ID
tool_input *objectTool input parameters as an object
tool_name *stringName of the tool being called (e.g. "Edit", "Bash", "WebFetch")
tool_call_idstringOptional 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.

ParameterTypeDescription
output *stringTool output (stdout, file content, API response, etc.)
session_id *stringSession ID
tool_call_id *stringtool_call_id returned by log_tool_call
exit_codeintegerExit 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.

ParameterTypeDescription
diff *stringUnified diff string (before/after)
file_path *stringPath of the file that was changed
operation *stringType of file operation
session_id *stringSession 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.

ParameterTypeDescription
assistant_content *stringThe exact assistant response
session_id *stringSession ID returned by start_session
user_content *stringThe 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.

ParameterTypeDescription
limitintegerReturn only the most recent N sessions

get_session_history

Retrieve the full timestamped audit log for a session, oldest first.

ParameterTypeDescription
session_id *string
limitintegerReturn 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.

ParameterTypeDescription
session_id *stringSession 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.

ParameterTypeDescription
content *stringThe 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.

ParameterTypeDescription
session_id *stringSession 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*).

ParameterTypeDescription
query *stringFTS5 search query, e.g. "database migration" or "auth bug" or "deploy OR release"
limitintegerMax 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.

ParameterTypeDescription
session_id *stringFull 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.

ParameterTypeDescription
text *stringAI response text containing $CHRON_* tokens
token_map *objecttoken_map from scan_prompt output