CHRONOS-AGENT
CHRONOS-AGENT is a local-first, single-binary Rust MCP server that gives coding agents a fast code knowledge graph for exploring, auditing, editing, and safely refactoring multi-language codebases without an LSP daemon.
Analyze & index code:
chronos_analyze_fileparses 7 language families (TS/JS, Python, Rust, Go, C/C++, Java) into a KuzuDB 5D code graph with symbols, call edges, test edges, HTTP routes, and complexity metrics.Explore in one call:
chronos_explorereturns BM25/regex matches,Class/*wildcard outlines, signature-only views, batch queries, inline blast radius, and sandboxed read-only Rhai scripts (~15ms, 3–4x fewer round-trips than grep+read).Search & query the graph:
chronos_search_graph(BM25, regex, degree/loop-depth filters) and read-only Cypher viachronos_query_graphoverCALLS,CONTAINS,TESTS,IMPORTS,CO_CHANGES_WITH.Read context safely:
chronos_get_snippetreturns verbatim source with callers, callees, covering tests, PageRank, and AST metrics.Assess change impact:
chronos_blast_radiusyields risk zones (SAFE→CRITICAL), PageRank centrality, Git co-change partners, confidence intervals, and verification surfaces.Understand architecture & hotspots:
chronos_get_architecture(community clusters, entry points, hubs) andchronos_query_hotspots(bottlenecks, hot paths, O(N²) loops, complexity).Edit code surgically:
chronos_edit_symbolperforms AST-boundedreplace_body/insert_before/insert_afteron a fresh disk parse with trivia dedup, BOM/CRLF preservation, dry-run, and a 2-stage syntax + signature/contract gate.Refactor across files:
chronos_refactor_symbolsupportspreview_usages, edge-verifiedrename, and hardenedsafe_deletewithverified_editsvscandidate_sites, ambiguity guards, optional hybrid LSP disambiguation (use_lsp), and atomic multi-file rollback.Verify with tests:
chronos_mutation_gateruns graph-selected covering tests against generated mutants (80% dev / 90% strict thresholds).Monitor contracts & telemetry:
chronos_contract_statusdrains signature-violation alerts;chronos_hydrate_telemetryimports.cpuprofile, Speedscope/py-spy, folded flamegraphs, or OTLP JSON.Bootstrap agent context:
chronos_generate_agents_mdsynthesizesAGENTS.md,CLAUDE.md,GEMINI.md, skills, rules, and MCP/hook configs for Codex, Antigravity, Claude, Cursor, Windsurf, Copilot, Cline, and OpenCode.Safety posture: workspace path jailing, strict
--readonlymode hiding write tools, zero-I/O Rhai sandbox, transactional atomic writes, and no outbound telemetry or code uploads.
Mines Git history to derive git temporal co-change coupling between files and symbols (CO_CHANGES_WITH edges in the 5D code graph), which feeds blast-radius analysis and surfaces files that historically change together with a modified function.
Scaffolds GitHub Copilot context for a workspace — generating AGENTS.md-style repository context files, native MCP client configuration, and Copilot-specific rules/skills synthesized from the indexed code graph so Copilot gets symbol, architecture, and risk context.
Targets Google Antigravity / Gemini tooling by generating GEMINI.md context files and the corresponding MCP config and agent skills derived from the indexed code graph.
Targets the OpenAI Codex CLI ecosystem — synthesizes AGENTS.md context rules and native Codex MCP config/skills from the 5D code graph so Codex agents can query symbols, blast radius, and architecture in a single call.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CHRONOS-AGENT safely rename parse_config to load_config and show blast radius"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
30-Second Quickstart
Zero-install via npx (requires Node.js 18+; auto-fetches your OS release binary):
npx -y @ptai-eng/chronos-mcp --workspace .Or install prebuilt binaries (chronos CLI + chronos-mcp server) without Node.js, C++, or Rust:
Windows (PowerShell):
irm https://raw.githubusercontent.com/ptai-eng/chronos-agent/main/scripts/install.ps1 | iexmacOS (Apple Silicon) & Linux (x64):
curl -fsSL https://raw.githubusercontent.com/ptai-eng/chronos-agent/main/scripts/install.sh | sh(Other options: Homebrew via brew install ptai-eng/tap/chronos / packaging/homebrew/chronos.rb, cargo-binstall via cargo binstall --git https://github.com/ptai-eng/chronos-agent chronos-cli chronos-mcp, or OCI container docker run -i --rm -v "${PWD}:/workspace" ghcr.io/ptai-eng/chronos-agent:1.8.1 via the Official MCP Registry.)
Bootstrap configs for Codex, Antigravity, Claude Code, Cursor, OpenCode, Windsurf, Copilot, and Cline in any workspace:
cd your-project
chronos init --client all --with-hooksOr drop @ptai-eng/chronos-mcp (or chronos-mcp) directly into any MCP client config:
{
"mcpServers": {
"chronos-agent": {
"command": "npx",
"args": ["-y", "@ptai-eng/chronos-mcp", "--workspace", "."]
}
}
}Related MCP server: Cordyceps Search
Table of Contents
Why CHRONOS vs. Serena & Built-in Grep
Coding agents normally inspect repositories with sequential grep + line-range reads and apply raw string diffs without knowing who calls a function or whether foo also appears as an unrelated local variable.
Aspect | Built-in Agent Grep / Line Edits | Daemon LSP MCPs (e.g. Serena) | CHRONOS-AGENT v1.8.1 |
Runtime Model | Text regex per turn | Background language server daemon per language | Single Rust binary ( |
Symbol Editing Safety | Trusts stale line numbers / diff hunks | LSP offsets + text rewrite | Fresh Tree-sitter re-parse on every write + 2-Stage Gate ( |
Multi-File Rename | Global text search/replace risks corrupting locals & comments | Compiler/LSP reference list | AST identifier classification separating |
Impact & Test Awareness | None | Caller references when server is warm | KuzuDB graph + Git co-change coupling + Reverse-BFS entrypoints ( |
Hybrid Disambiguation ( | Zero semantic guarantees | Full compiler type resolution when LSP compiles cleanly | Default zero-daemon ( |
What's New in v1.8.1 & v1.8.0
v1.8.1 Highlights
Opt-In Hybrid
LspSemanticAdapter&chronos lsp-hydrate: Resolvesrust-analyzer,typescript-language-server(.cmdwrapper on Windows),pyright,gopls,clangd, andjdtlsoverContent-Lengthstdio JSON-RPC with60s/15stimeouts, UTF-16 byte mapping,use_lsppromotion ofobj.method()candidate_sites, and deterministic AST fallback (coverage.completeness = "partial").Polyglot
safe_deleteInterface & Override Guards: Blocks unsafe deletions across TypeScript (implements/override), Java (@Override/implements), and Go (structural cross-fileinterfacesatisfaction), in addition to Rust trait impls.MCP Spec & Token Optimization: Suppresses illegal responses to JSON-RPC notifications, decodes
file://Windows/POSIXrootUris, negotiates MCPprotocolVersionup to2025-11-25, emitsToolAnnotations(readOnlyHint,destructiveHint), and compactschronos_explorepayloads (-69% to -72% estimated tokens and 3x–4x fewer round-trips vs. grep+read inbenchmarks/).Release Parity & Homebrew Formula: Added
scripts/check_version_sync.pyCI guard andpackaging/homebrew/chronos.rb.
v1.8.0 Core Release
v1.8.0 turns CHRONOS-AGENT into a gated read + edit + refactor + script workspace engine across 7 language families (.ts/.tsx/.js/.jsx, .py, .rs, .go, .c/.cpp, .java):
Subsystem | v1.8.0 Upgrade |
1. Fresh-Parse AST Editing ( | Reads current bytes from disk and parses a fresh Tree-sitter CST before every edit ( |
2. Edge-Verified Refactoring ( | Classifies AST identifiers while skipping comments and string literals, protects module-path prefixes ( |
3. Progressive | Supports |
4. Sandboxed | Embeds |
5. | Transactional multi-file writes roll back all prior modified files on disk error; |
v1.7.0: Consolidated
WorkspaceSession, canonicalToolRegistry/McpToolRegistry(zero schema drift), Schema v2GraphRepository,_meta.contract_alertsmiddleware, 24kmax_answer_charsUTF-8 budgeting, and upgraded embedded KuzuDB to single-file0.11.3(cxx-build = 1.0.138) fixing Linux GCC 15 CI aborts.v1.6.0: Added
chronos_explore, Reverse-BFSverification_surfaces, line-anchoredstructured_findings, 4-Angle Review Audit (Reuse,Efficiency,Simplification,Altitude),<20mslifecycle hooks (chronos hook), and the 20-file multi-agent scaffolder.v1.5.0: Added
chronos init,chronos agents-md,chronos schemaexporter (OpenAI, Anthropic, Gemini, Codex TOML, MCP), andSECURITY.md.v1.4.0: Added KuzuDB
xxHash64incremental sync, cross-boundary HTTP route stitching (/{*}), GitCO_CHANGES_WITHco-change mining, single-compileCHRONOS_MUTANT_IDSuper-Mutant evaluation, and offline telemetry hydration (.cpuprofile, Speedscope, Folded Flamegraph, OTLP JSON).v1.3.0 & v1.2.0: Polyglot 7-language Tree-sitter parser, interprocedural
transitive_loop_depth/ $O(N^2)$ loop scan detection, read-only OpenCypher (chronos_query_graph), BM25 search, Label Propagation clustering, PageRankconfidence_interval, andchronos diff --ci.
Core Architecture
Component | Responsibility | Crate Path |
Knowledge Graph & Query |
|
|
Fresh AST Editor & Refactor | Tree-sitter 7-language parsers, |
|
Sandboxed Rhai Script Engine |
|
|
Contract Broker & Blast Radius | 300ms debounced watcher, signature fingerprinting, PageRank impact scoring, confidence intervals, 4-angle audit, surface tracer |
|
Super-Mutant & Telemetry | Graph-selected sandbox mutation runner ( |
|
Capability Matrix
14 Canonical MCP Tools
chronos-mcp speaks MCP (2025-11-25 / 2024-11-05) over stdio JSON-RPC 2.0, exposes 14 canonical tools (plus compatibility aliases chronos_replace_symbol_body, chronos_rename_symbol, chronos_safe_delete), enforces --readonly guards, injects _meta.contract_alerts, and caps oversized replies cleanly via max_answer_chars:
# | Tool Name | Mode | Category | Description |
1 |
| Read | Ingestion & Audit | Parse source file (7 language families), sync KuzuDB delta, and run 4-Angle Review Audit. |
2 |
| Read | Telemetry | Rank runtime bottlenecks, PageRank hubs, and nested loop hotspots. |
3 |
| Read | Impact & Findings | Compute PageRank blast-radius, |
4 |
| Read | Verification | Execute graph-selected covering tests against Super-Mutant builds. |
5 |
| Read | Contracts | Drain queued Semantic Contract Broker alerts from the Pre-Tool Execution Gate. |
6 |
| Read | Cypher | Run read-only OpenCypher queries over KuzuDB ( |
7 |
| Read | Discovery | Search symbols with BM25 identifier tokenization ( |
8 |
| Read | Context | Read verbatim |
9 |
| Read | Topology | Index workspace incrementally, mine Git co-changes, and extract Label Propagation clusters + hotspots. |
10 |
| Read | Telemetry | Hydrate runtime metrics from |
11 |
| Read/Preview | Multi-Agent | Synthesize |
12 |
| Read | 1-Call Context | 1-call context engine supporting |
13 |
| Write | AST Editing | Fresh-parse |
14 |
| Write / Preview | Refactoring | Edge-verified |
Supported AI Clients (chronos init --client all --with-hooks)
Client / IDE | Generated Files |
OpenAI Codex CLI | |
Google Antigravity ( |
|
Anthropic Claude Code |
|
OpenCode, Cursor, Windsurf, Copilot, Cline |
|
Export AI SDK schemas directly for custom agent harnesses:
chronos schema --format responses > openai.json # OpenAI Responses API (14 tools, strict: true)
chronos schema --format anthropic > claude.json # Anthropic Messages API (14 tools, input_schema)
chronos schema --format gemini > gemini.json # Google Gemini / Vertex AI (14 tools, functionDeclarations)VS Code Extension
Install "CHRONOS Agent" from the Visual Studio Marketplace (chronos-vscode/):
Incremental Watcher: Re-indexes modified source files on save across all 7 language families and syncs
KuzuDB.Blast-Radius & Uncertainty HUD: Surfaces composite impact scores, confidence intervals, PageRank hubs, Git co-change partners, and surviving mutants inside VS Code.
CLI Command Suite & Build from Source
Common CLI Commands
# 1. Surgical AST Symbol Edit (with 2-stage syntax & blast-radius gate)
chronos edit charge --file src/billing.rs --op replace_body --code "pub fn charge(a: i32) -> i32 { a * 2 }" --dry-run
# 2. Edge-Verified Multi-File Rename & Hardened Safe Delete
chronos rename compute_tax calculate_vat --file src/billing.rs --dry-run
chronos delete legacy_helper --file src/cleanup.rs
# 3. Embedded Rhai 5D Scripting (One-Shot Eval & Interactive REPL)
chronos eval "hotspots(5)" --readonly --json
chronos repl
# 4. 1-Call Context Explore (Wildcards, Signature Outline & Blast-Radius)
chronos explore "OrderService/*" --no-body --depth 2 --blast-radius
# 5. Full Audit, Architecture, Search, Cypher & Git Diff Gate
chronos audit src/services/orderService.ts
chronos hydrate profile.cpuprofile --json
chronos arch chronos-core/src
chronos query "MATCH (n:ChronosNode) WHERE n.transitive_loop_depth >= 2 RETURN n.name, n.transitive_loop_depth LIMIT 10"
chronos diff --staged --json --ci
# 6. Opt-In Hybrid LSP Reference Hydration (v1.8.1)
chronos lsp-hydrate src/billing.rs --symbol compute_tax --jsonBuild from Source
# Prerequisites: Rust 1.85+, CMake, C++ compiler (for embedded KuzuDB 0.11.3)
git clone https://github.com/ptai-eng/chronos-agent.git
cd chronos-agent
cargo build --release -j 4
cargo test --workspace -j 4Security & Local-First Guarantees
CHRONOS-AGENT runs locally inside your workspace with no outbound telemetry or cloud code uploads:
Workspace Path Jailing: Every read, index, edit, and refactor call canonicalizes paths via
WorkspaceSession::validate_workspace_pathand rejects paths escapingworkspace_root.Strict
--readonlyMode: Passing--readonlytochronos-mcphides mutating tools (chronos_edit_symbol,chronos_refactor_symbol) fromtools/listand blocks disk writes while preserving read-only previews (preview_usages,dry_run).Isolated Rhai Sandbox:
ScriptEngineinitializesEngine::new_raw()with zero filesystem, network, process, or env APIs and aborts runaway scripts at50_000operations. MCPchronos_explore.scriptruns underScriptProfile::ReadOnly, which never registers write bindings.Transactional Integrity & Read-Only Cypher: Disk writes use
AtomicFileWriter(BOM/CRLF preservation + multi-file rollback), OpenCypher queries passvalidate_readonly_cypher, and extracted snippets carry_meta.provenance.untrusted_content.Opt-In Profiling & Sandbox Testing: Linux eBPF tracepoints, Chrome DevTools WebSocket attachment, and isolated test subprocesses only run when explicitly invoked via profiling or mutation commands. Full threat model details live in
SECURITY.md.
License
Distributed under the MIT License. See LICENSE for details.
Available Tools
14 toolschronos_analyze_fileAIdempotent
Parse a source file (.ts, .tsx, .js, .py, .rs, .go, .c, .cpp, .java) with CHRONOS's polyglot AST engine and insert all symbols, call edges, cross-language HTTP routes, test edges, and loop/complexity metrics into the 5D Code Graph.
Inputs: file_path (required), max_answer_chars.
chronos_blast_radiusARead-onlyIdempotent
Analyze the blast-radius (change impact) of modifying a specific function or symbol. Returns a risk zone (SAFE/MEDIUM/HIGH/CRITICAL), PageRank centrality, Git temporal co-change partners, confidence interval, coverage completeness, and residual unknowns.
Inputs: symbol_name (required), detail, file_path, max_answer_chars, +1 more.
chronos_contract_statusBRead-only
Drain the Semantic Contract Broker's Pre-Tool Execution Gate. Returns any pending contract violation alerts detected since the last call.
Inputs: watch_dir, max_answer_chars.
chronos_edit_symbolADestructive
Perform surgical AST-bounded edits (replace_body, insert_before, insert_after) against a fresh disk parse with leading trivia deduplication, indentation/CRLF/BOM preservation, and a 2-stage Tree-sitter syntax + contract blast-radius gate (blocked_requires_force on breaking signature changes with callers unless force=true).
Inputs: file (required), symbol (required), new_code (required), operation (required), +3 more.
chronos_exploreARead-onlyIdempotent
1-Call Subagent Context Engine (<15ms). Answers code exploration questions in a single call by returning the top BM25/regex matching symbols, wildcard Class/* outlines, signature-only views (include_body=false), inline blast-radius, read-only Rhai 5D scripts, caller/callee chains, verification surfaces, and 4-angle review diagnostics.
Inputs: depth, query, script, queries, +6 more.
chronos_generate_agents_mdBIdempotent
Synthesize live, data-driven context rules, skills, and MCP configs from the 5D Code Graph (AGENTS.md, CLAUDE.md, GEMINI.md, .agents/skills/chronos-agent/SKILL.md, .cursor/rules/chronos-5d.mdc) for OpenAI Codex CLI, Google Antigravity, Claude Code, OpenCode, Cursor, Windsurf, Copilot, and Cline.
Inputs: target, auto_index, with_hooks, output_path, +4 more.
chronos_get_architectureARead-onlyIdempotent
Get a high-level architecture overview: community clusters (Label Propagation + Cohesion score), language breakdown, entry points, top PageRank hubs, and hidden O(N^2) algorithmic hotspots.
Inputs: path, auto_index, max_answer_chars.
chronos_get_snippetARead-onlyIdempotent
Read the verbatim source code (start_line..=end_line) of a function/class from disk along with its callers, callees, covering tests, PageRank, and AST complexity metrics.
Inputs: symbol_name (required), file_path, max_answer_chars.
chronos_hydrate_telemetryAIdempotent
Hydrate the 4th Dimension (runtime telemetry) of the ChronosGraph from an offline profiler artifact (V8 .cpuprofile JSON, Speedscope/py-spy JSON, Folded Stack Flamegraph text, or OpenTelemetry OTLP trace JSON).
Inputs: profile_path, profile_content, max_answer_chars.
chronos_mutation_gateAIdempotent
Run targeted mutation testing on a specific file using CHRONOS's Mutation Arena. Generates mutants, selects covering tests via the 5D Code Graph, runs them in parallel sandboxes, and returns the mutation score.
Inputs: file_path (required), strict, test_command, max_answer_chars.
chronos_query_graphARead-onlyIdempotent
Execute a Read-Only Cypher query directly against the embedded KuzuDB 5D Code Graph. Every ChronosNode has properties: id, name, qualified_name, kind, file, start_line, end_line, start_byte, end_byte, cognitive_load, cyclomatic, fan_in, fan_out, param_count, sloc, loop_count, loop_depth, transitive_loop_depth, linear_scan_in_loop, alloc_in_loop, is_recursive, is_hydrated, exec_time_p50, exec_time_p99, invocation_count, cpu_percent, is_hot_path, is_bottleneck. Relationship tables: CALLS, CONTAINS, TESTS, IMPORTS, CO_CHANGES_WITH.
Inputs: query (required), max_rows, max_answer_chars.
chronos_query_hotspotsARead-onlyIdempotent
Query the 5D Code Graph for the top N performance bottlenecks and hot-path functions (using live telemetry or PageRank + O(N^2) loop fallback).
Inputs: top_n, filter, max_answer_chars.
chronos_refactor_symbolADestructive
Perform graph-edge-verified multi-file refactoring (preview_usages, rename, safe_delete). Separates verified CALLS/TESTS/import edits from ambiguous member-access/shadowed candidate sites, enforces multi-file syntax validation + atomic rollback, and guards public/entrypoint/interface-impl deletions.
Inputs: action (required), symbol (required), file, force, +4 more.
chronos_search_graphCRead-onlyIdempotent
Search the 5D Code Graph using BM25 ranked identifier tokenization (splits camelCase/snake_case), regex pattern matching, degree filtering, and nested-loop complexity filtering.
Inputs: kind, limit, query, offset, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Several tools occupy overlapping territory: chronos_explore is explicitly a one-call superset that folds in BM25 search, inline blast-radius, signatures and caller/callee chains, which directly competes with chronos_search_graph, chronos_get_snippet and chronos_blast_radius. chronos_query_graph vs chronos_search_graph and chronos_query_hotspots are reasonably separable (Cypher vs BM25 vs hot-path ranking), and edit_symbol vs refactor_symbol split by operation type, but an agent must reason carefully about explore-versus-parts before choosing.
A uniform chronos_ prefix and snake_case are used throughout, and most names are verb_noun (query_graph, search_graph, get_snippet, analyze_file, hydrate_telemetry, edit_symbol, refactor_symbol, generate_agents_md). Minor deviations exist: chronos_blast_radius, chronos_contract_status and chronos_mutation_gate are noun phrases and chronos_explore is a bare verb, but the intent is still readable.
14 tools is a reasonable scope for a multi-phase code-graph engine (ingest, query, impact, test, edit, generate). Each tool maps to a recognizable phase, though the presence of chronos_explore as a single-call aggregator makes a few of the lower-level query tools feel partly redundant.
The surface covers ingestion (analyze_file, hydrate_telemetry), querying/inspection (graph, search, hotspots, architecture, snippet), impact and safety (blast_radius, contract_status, mutation_gate), and mutation (edit_symbol, refactor_symbol), plus artifact generation. Gaps are minor but real: no directory/repo-level bulk indexing (analyze_file is per-file), no way to list what has been indexed, and no graph-statistics or schema-discovery tool beyond knowing Cypher up front.
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Stateless TS/JS compiler facts for agents: references, imports, impact. No repo index or OAuth.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceProvides efficient code navigation and graph-based analysis for AI agents, enabling symbol resolution, callers, implementations, and type schemas with minimal token usage.-
- FlicenseNot gradedqualityBmaintenanceEnables developer agents to perform semantic codebase search, dependency and impact analysis, cross-file refactoring, and full-stack API tracing through a unified query DSL over a high-performance graph engine.-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents and terminal users to query codebases for callers, impact, tests, dependencies, and refactor previews using static AST analysis, with every match accounted for and uncertain relationships clearly marked.1,016 npm2MIT
- AlicenseAqualityCmaintenanceEnables AI coding agents to index a workspace into AST symbol graphs and retrieve exact function or class slices, trace callers and blast radius, and apply syntax-safe symbol patches without dumping whole files into context.71MIT