Skip to content
trycogPublic

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

0 watching

Forks

Repository files navigation

COG

Memory, code intelligence, and debugging for AI agents.

Benchmarks · Install · Setup · How It Works · Memory · Code Intelligence · Debug · Extensions · Diagnostics


Why Cog?

AI coding can feel fast but it's still limited by suboptimal methods and tooling. Your agent doesn't remember the architectural decisions from last week. It can't look up where a function is defined without grepping through your entire codebase. When something breaks it can't set a breakpoint, inspect a variable, or step through the code. It's stuck adding print statements and guessing.

We built Cog to fix that. It's a single native binary that runs as an MCP server and gives your agent three capabilities it doesn't have on its own:

  1. Persistent memory that carries across sessions. Your agent learns your architecture, remembers past bugs, and builds knowledge that compounds over time. Memory can run locally (SQLite) or hosted on trycog.ai for team sharing.
  2. Structured code intelligence that returns definitions, references, and symbols in one tool call instead of 15 rounds of grep and file reads.
  3. An interactive debugger your agent drives directly. Breakpoints, variable inspection, stepping through code. No more print statement debugging.

Benchmarks

Memory Recall Benchmark (hosted)

We benchmarked Cog's hosted memory recall against Sonnet 4.5 doing active code exploration across 114 questions about a production codebase. The code exploration baseline used no prior model knowledge and answered every question through real-time file reads, grep, and glob. Cog answered from a knowledge graph built by an exhaustive bootstrap prompt before the benchmark started. These benchmarks use the hosted brain on trycog.ai.

Metric Cog Code Exploration Delta
Accuracy 86.0% 89.5% -3.9%
Adequate answers (>=50%) 93.9% 89.9% +4.4%
Duration 24m 39s 61m 39s -60%
Total tokens 548.4K 46.6M -98.8%
Tokens per question 4.6K 391.2K -98.8%

Cog answers nearly as many questions correctly while using 98.8% fewer tokens and finishing in less than half the time. The adequate answer rate is actually higher because memory recall surfaces connected context that code exploration misses.

Code Intelligence Benchmark

We benchmarked Cog's code intelligence against standard agent tools (grep, glob, read) on the React codebase:

Task Cog Without Cog Speedup Token Savings
Find createElement definition 3.7s, 1 call, 1.4K tokens 34.1s, 15 calls, 78.4K tokens 9.2x faster 98%
Find useState references 9.3s, 2 calls, 2.5K tokens 27.4s, 15 calls, 24.1K tokens 2.9x faster 90%
List ReactFiberWorkLoop symbols 10.8s, 1 call, 4.0K tokens 35.7s, 13 calls, 25.2K tokens 3.3x faster 84%
Find Component class 14.3s, 5 calls, 7.4K tokens 28.9s, 15 calls, 28.1K tokens 2.0x faster 74%

On average, 2.8x faster with 89% fewer tokens.

Install

Linux:

curl -fsSL https://trycog.ai/cli/install | bash

macOS:

brew install trycog/tap/cog
Build from source

Requires Zig 0.15.2+.

git clone https://github.com/trycog/cog-cli.git
cd cog-cli
zig build
# Binary at zig-out/bin/cog

Setup

cog init

That's it. The interactive setup walks you through everything:

  1. Memory backend: local (SQLite) or hosted (trycog.ai)
  2. Agent selection: pick which AI coding agents you use
  3. Tool permissions: optionally auto-allow all Cog tools so your agent doesn't prompt you on every call

For each agent you select, cog init writes the system prompt, configures the MCP server connection, deploys specialized sub-agents or the closest host-native specialist surface, installs runtime policy assets where the host supports them, and, where available, auto-allows Cog tool permissions. Specialist capabilities drive both asset installation and prompt generation: Cog renders each prompt only after installation and mandates a specialist only when every selected host that reads that prompt successfully received it. It also writes .cog/client-context.json plus a local .cog/.gitignore for generated Cog artifacts, so the local MCP runtime can identify the installed host integrations and compile richer hosted-memory context without changing your repo-root ignore rules. Agent menus start alphabetically and then adapt over time based on your global selection history in ~/.config/cog/agent-selection-counts.json.

Skills

npx skills add trycog/cog-cli installs the public setup-cog skill from the skills.sh directory — it walks any supported agent through installing the binary, running cog init, and verifying with cog doctor. The project-local skills that cog init generates (cog-explore, cog-remember, and the specialist skills) follow the Agent Skills specification, carry a cog-version stamp so cog doctor can report asset drift, and are marked internal so they stay out of public skill directories. The Cog workflow guidance survives context compaction on hosts that expose a compaction hook — Claude Code (PreCompact), OpenCode (experimental.session.compacting), and Pi (session_compact); other hosts re-establish it from the always-installed prompt on the next session. Generated skills are ordinary project files — commit them so teammates and CI agents get identical guidance, or ignore them and let cog init regenerate per checkout.

Supported agents

Agent MCP Config Specialist Surface Tool Permissions Cog-First Override Context Packaging Memory Write Enrichment
Amp .amp/settings.json .agents/skills/ Auto-allow Medium runtime plugins + sub-agent permissions Yes Runtime reminders
Claude Code .mcp.json .claude/agents/ Auto-allow Hard sub-agent allowlist + hooks + project MCP approval Yes Hook/config reminders
Cursor .cursor/mcp.json .agents/skills/ Soft AGENTS.md + shared skills Yes Prompt guidance
Gemini CLI .gemini/settings.json .gemini/agents/ Auto-allow Medium hooks + sub-agent tool scoping Yes Hook/config reminders
GitHub Copilot .vscode/mcp.json .agents/skills/ Soft shared skills directory Yes Prompt guidance
Goose Global config .goose/skills/ Soft skill guidance Yes Prompt guidance
OpenAI Codex CLI .codex/config.toml .agents/skills/ Soft shared skills directory Yes Prompt guidance
OpenCode opencode.json .opencode/agents/ Auto-allow Medium runtime plugins + sub-agent permissions Yes Runtime reminders
Pi .pi/mcp.json .pi/skills/ Medium extension hooks + skills Yes Runtime reminders
Roo Code .roo/mcp.json .roomodes custom modes Medium native mode groups Yes Prompt guidance
Windsurf Global config .windsurf/skills/ Soft skills + rules Yes Prompt guidance

The support matrix above is rendered from the agent registry inside cog-cli and validated by the test suite, so any drift between the registry and this table fails the build. All eleven hosts receive the identical Cog-first code-exploration policy with the same narrow raw-text fallback exceptions (index unavailable, index incomplete for the target code, or raw string literals, log messages, and other non-symbol text); the policy text is embedded once and rendered into every host prompt and specialist surface.

Every registered host can receive the closest native equivalent of all five Cog specialists: cog-code-query, cog-debug, cog-mem, cog-mem-validate, and cog-observe. Memory and memory-validation assets are installed only when memory is configured; the experimental observe asset is installed only when observe is explicitly enabled. If the user skips a specialist file, prompt generation treats that specialist as unavailable, while write or configuration failures abort setup instead of leaving a partial mandatory configuration. For shared prompt targets such as AGENTS.md, Cog uses the intersection of successful installations across all selected readers, so one host never inherits a mandate it cannot fulfill.

Stronger enforcement depends on what each host can express:

  • Claude Code, Gemini CLI, and OpenCode receive dedicated agent files; tool isolation ranges from hard allowlists to advisory host configuration.
  • Cursor, GitHub Copilot, Codex, and Amp consume the shared .agents/skills/ directory — one spec-compliant skill per specialist serves all four. Skills provide workflow guidance but cannot hard-deny tools per specialist.
  • Windsurf, Goose, and Pi receive native skill files in their own skill directories. These are portable delegation surfaces, not guaranteed hard isolation; Amp and Pi add broader runtime policy assets where their extension systems allow it.
  • OpenAI Codex CLI stores each Cog specialist additively in its shared .codex/config.toml as an [agents.<name>] section. Cog refreshes its own sections while preserving unrelated TOML, but the host surface provides guidance rather than a per-file sandbox.
  • Roo Code stores each specialist as a custom mode in .roomodes. Native mode groups provide the closest tool scoping Roo supports, but they do not offer the same isolation guarantees as a dedicated subprocess.

Hosted memory writes now pass through a client-side context compiler in cog-cli. When the remote brain supports enriched write APIs, Cog attaches trusted local provenance such as workspace, repo identity, MCP session, host integration, recent code/debug evidence, and write-reason hints before sending the write upstream. Legacy hosted servers still receive the original tool calls unchanged.

For hosts with runtime support, cog init also installs repo-local enforcement assets:

  • Claude Code: .claude/hooks/cog-pretooluse.sh, .claude/hooks/cog-stop-memory.sh
  • Gemini CLI: .gemini/hooks/cog-before-tool.sh
  • Amp: .amp/plugins/cog.ts (experimental)
  • OpenCode: .opencode/plugins/*
  • Pi: .pi/extensions/cog.ts

Host capability notes

Capability What it means
Policy enforcement How strongly the host can steer or block non-Cog workflows
Context packaging Whether hosted memory writes get client-generated provenance from cog-cli
Memory write enrichment Whether the host also gets prompt, hook, or plugin guidance to encourage rationale-rich architectural memory
Host class Policy enforcement Context packaging Memory write enrichment
Claude Code Hard sub-agent scoping + advisory hook Yes, via cog-cli hosted write envelopes Hook advisories + scoped memory specialist
Gemini CLI Medium hook/config scoping Yes, via cog-cli hosted write envelopes Hook advisories + scoped memory specialist
OpenCode Medium runtime plugin enforcement Yes, via cog-cli hosted write envelopes Runtime plugin reminders + memory specialist
Amp Medium permissions + experimental plugin Yes, via cog-cli hosted write envelopes Plugin advisories + memory skill
Pi Medium extension hook enforcement Yes, via cog-cli hosted write envelopes Extension advisories + memory skill
Cursor / Copilot / Codex / Roo Prompt or host-native guidance only Yes, via cog-cli hosted write envelopes Prompt-level rationale and memory-quality guidance
Goose / Windsurf Portable or host-native skills + prompt guidance Yes, via cog-cli hosted write envelopes Prompt-level rationale and memory-quality guidance

How It Works

Cog runs as an MCP server over stdio. Your AI agent connects to it and discovers tools at runtime. You don't type Cog commands yourself. Your agent calls them through MCP.

The stdio transport accepts newline-delimited JSON objects with a maximum inbound frame size of 4 MiB (4,194,304 bytes). Cog rejects oversized frames as JSON-RPC invalid requests before dispatch and then resynchronizes at the next newline.

Your Agent  <->  MCP (stdio)  <->  cog mcp
                                     |-- Memory (local SQLite or trycog.ai)
                                     |-- Code Intelligence (local SCIP index)
                                     |-- Debug (in-process sessions and drivers)

Tool families your agent discovers:

  • mem_* for memory operations (when configured). Local brains expose Cog's local memory catalog; hosted brains expose only the capabilities discovered from that remote brain.
  • code_query and code_explore for code intelligence.
  • debug_* for the debugger (36 tools across core, extended, and specialist tiers; individual drivers may report unsupported operations).
  • observe_* for the experimental observation subsystem only when explicitly enabled. Observe is off by default; set observe.enabled to true in .cog/settings.json or set COG_OBSERVE_ENABLED=1 to opt in.

Specialists

For every registered host, cog init deploys the closest supported delegation surface—sub-agent, skill, project rule, shared config section, or custom mode:

  • cog-code-query — code exploration via the SCIP index. Finds definitions, references, and symbols in a single call.
  • cog-debug — autonomous hypothesis-driven debugging. Sets breakpoints, inspects variables, steps through code, and reports findings.
  • cog-mem — memory lifecycle management. Handles recall, consolidation, and maintenance of your agent's knowledge graph.
  • cog-mem-validate — post-task memory validation. Consolidates short-term memories, reinforces validated knowledge, and flushes incorrect entries.
  • cog-observe — optional access to persisted observation sessions, backend status, and causal analysis. It is omitted unless observe is explicitly enabled; unsupported capture backends report their limitation instead of claiming an active capture.

These specialists keep the primary agent's context clean by offloading specialized work. Host capability levels determine the installed asset format and whether guidance is advisory, config-scoped, or runtime-enforced.


Memory

Your agent gets a persistent knowledge graph. It learns concepts, links them with typed relationships, and recalls them using spreading activation. Queries return not just direct matches but connected concepts across the graph.

Memory runs locally (SQLite at .cog/brain.db) or hosted on trycog.ai. Local memory works out of the box with no account required. Hosted memory enables team sharing and cross-project knowledge.

How it works

  • An engram is a concept with a term, definition, and creation date
  • A synapse is a typed relationship between engrams (requires, enables, leads_to, and others)
  • Short-term memories decay in 24 hours unless reinforced to long-term
  • Spreading activation means recall traverses the graph, surfacing related knowledge you didn't explicitly search for

How agents use it

The system prompt we inject into your agent instructs it to follow a lifecycle:

  1. Recall before exploring code. Query memory for relevant context first.
  2. Work and record. Learn new concepts as they come up during the session.
  3. Consolidate. After completing work, reinforce validated memories and flush incorrect ones.

The result is an agent that gets better over time. It stops rediscovering the same solutions and starts building on what it already knows.

Cog also hardens memory reads and writes: local memory rejects obvious prompt-injection phrases and secret-like tokens during learn/update operations, and recall output wraps stored definitions in <stored-knowledge> tags so agents can treat recalled text as data instead of fresh instructions.

For hosted brains, Cog now prefers enriched memory writes that include provenance and session context. That metadata is compiled locally by cog-cli; canonical assertion semantics, rationale history, and retrieval behavior still live on the hosted brain.

Bootstrap

Seed your brain with knowledge from an existing codebase. Runs in two phases: first extracts concepts from each source file, then creates cross-file associations using SCIP-derived symbol relationships. Requires an existing SCIP index (cog code:index).

cog mem:bootstrap                        # Bootstrap with defaults
cog mem:bootstrap --concurrency 4        # 4 parallel agent invocations
cog mem:bootstrap --clean                # Reset checkpoint, start fresh
cog mem:bootstrap --timeout 15           # 15 minutes per file (default: 10)
cog mem:bootstrap --debug                # Show agent stderr output

On first run, cog mem:bootstrap presents an interactive agent selector — pick whichever AI coding agent CLI you have installed (Amp, Claude Code, Gemini CLI, Goose, OpenAI Codex CLI, OpenCode, or a custom command). The list starts alphabetically and then adapts based on your global selection history in ~/.config/cog/agent-selection-counts.json. Progress is checkpointed to .cog/bootstrap-checkpoint.json so interrupted runs resume where they left off.

Model override. By default, bootstrap uses whichever model the selected agent is configured to use. To override this, set memory.bootstrap.model in .cog/settings.json:

{
  "memory": {
    "brain": "https://trycog.ai/you/brain",
    "bootstrap": {
      "model": "claude-sonnet-4-20250514"
    }
  }
}

This passes --model to the agent CLI, useful for choosing a faster or cheaper model for bulk extraction.

MCP tools

Your agent interacts with memory through mem_* MCP tools, not CLI commands. Hosted capabilities are discovered dynamically from the remote brain; local brains expose the built-in local catalog. The hosted service may expose capabilities such as:

Read: recall, get, connections, trace, bulk_recall, list_short_term, stale, stats, orphans, connectivity, list_terms

Write: learn, associate, bulk_learn, bulk_associate, update, unlink, refactor, deprecate, reinforce, flush, verify, meld

Manual setup

If you'd rather not use cog init, you can set things up by hand.

1. Place a .cog/settings.json in your project (or any parent directory up to $HOME):

For local memory:

{
  "memory": {
    "brain": "file:.cog/brain.db"
  }
}

For hosted memory:

{
  "memory": {
    "brain": "https://trycog.ai/username/brain"
  }
}

Cog sends COG_API_KEY only to the exact official https://trycog.ai:443 origin or to an exact non-official HTTPS origin already present in the global ~/.config/cog/approved-origins.json store. Authenticated request callsites enforce this check before network I/O; unapproved self-hosted destinations fail with error.CredentialDestinationNotApproved. Repository settings can select a self-hosted brain, but cannot authorize credential forwarding.

When you select a self-hosted memory origin during interactive cog init, Cog shows the exact canonical HTTPS origin and asks for approval before it reads COG_API_KEY or makes an authenticated request. A confirmation is persisted through the same global approved-origin policy and store used by cog doctor. Non-interactive setup cannot create an approval and fails closed.

You can also approve a self-hosted destination explicitly before setup:

cog doctor --approve-host https://memory.example:8443

Both approval paths take one exact HTTPS origin (scheme, host, and optional port — no path, query, fragment, or userinfo), canonicalize it, require an interactive terminal, and ask you to confirm before anything is written. Approvals are stored only in the global store, at mode 0600 under a directory restricted to 0700. Nothing in a repository — .cog/settings.json, a project .env, or a process-supplied HOME — can add an approval or move the store: the store location is resolved from the account database entry for the user Cog runs as, and every component of that path is opened without following symlinks. If the trusted home cannot be resolved, approval reads and writes fail closed.

On Windows, global approved-origin reads and writes return error.UnsupportedPlatform because Zig 0.15 does not expose reparse-point-resistant file access needed for credential authorization state. URL parsing remains available; non-official credential destinations therefore fail closed.

2. For hosted memory, set your API key:

export COG_API_KEY=your-key-here

Or put it in a .env file in your project root.


Code Intelligence

SCIP-based code indexing powered by tree-sitter. Instead of your agent grepping through files across multiple rounds, it gets structured answers in a single tool call.

This runs entirely locally. No account required.

Language support

Language Delivery Notes
Go Built-in Tree-sitter indexing in Cog; optional built-in SCIP/dlv integration when installed
JavaScript Built-in Includes .js, .jsx, .mjs, .cjs
TypeScript Built-in Includes .ts, .mts
TSX Built-in JSX/TSX support
Python Built-in Includes .py, .pyi
Java Built-in Tree-sitter indexing plus optional SCIP indexing when installed
Rust Built-in Tree-sitter indexing plus optional rust-analyzer scip when installed
C Built-in Includes .c, .h
C++ Built-in Includes .cpp, .cc, .cxx, .hpp, .hxx, .hh
Markdown Built-in Includes .md, .markdown
MDX Built-in .mdx
YAML Built-in Includes .yaml, .yml
TOML Built-in .toml
JSON Built-in .json
JSONC Built-in .jsonc via the built-in JSON grammar
reStructuredText Built-in .rst
AsciiDoc Built-in Includes .adoc, .asciidoc
Bash Built-in Includes .sh, .bash, .bats; DAP debugging via bashdb
Zig External extension Supported via cog-zig
Ruby External extension Supported via cog-ruby
Swift External extension Supported via cog-swift
Nix External extension Supported via cog-nix
Elixir External extension Supported via cog-elixir

Built-in coverage comes from the bundled grammars and extension definitions in src/extensions.zig. Additional repo-supported languages are available through installable extensions in the Extensions section.

Tools

Tool Description
code_explore Find symbols by name, return readable definition bodies, file outlines, references, and optional architecture summaries in one response. Primary tool for code exploration.
code_query Low-level index query with modes for find, refs, symbols, imports, contains, calls, callers, and overview, all returned as concise plain text.

cog init now installs stronger Cog-first guidance for supported agents, including an OpenCode override plugin and tighter sub-agent instructions so repository understanding defaults to indexed code exploration instead of ad hoc file search.

Pattern matching

The name parameter supports flexible matching:

  • Glob patterns: *init*, get*, Handle?
  • Alternation: banner|header|splash to search multiple names at once
  • Combined: *init*|setup|*boot*

Indexing

cog code:index              # Index everything
cog code:index "**/*.ts"    # Specific pattern

Results go into .cog/index.scip. A built-in file watcher automatically keeps the index up to date as files are created, modified, deleted, or renamed — only watching files that match the glob patterns configured in .cog/settings.json under code.index. No manual re-indexing needed after the initial build.

Staying in sync

The watcher only sees changes while cog mcp is running, so every index write also records a provenance manifest (.cog/index-manifest.json): the size, mtime, and content hash of each indexed file, the configured pattern set, and the git HEAD it was built at. A reconcile pass compares that manifest against the working tree and repairs exactly what drifted — modified and new files are reindexed, deleted files are dropped, and the pass escalates to a full rebuild when most of the tree changed or no manifest exists. When nothing drifted, the pass is a stat scan that never opens the index, and stat-level churn with identical bytes (switching a branch away and back) refreshes the manifest instead of reindexing anything. Because the pattern set is recorded, reconciliation also works for projects indexed with explicit cog code:index patterns and no code.index settings entry.

Reconciliation runs automatically:

  • at MCP startup, covering everything that changed while no server was running (the first startup after upgrading Cog performs one full rebuild to establish the manifest);
  • when the git sentinel (.git/HEAD, the active ref, and .git/index mtimes) reports a checkout, pull, merge, or rebase — linked worktrees included;
  • when watcher event queues overflow under mass changes;
  • periodically, when file watching is unavailable on the host.

For large projects (10k+ indexed files) in a git checkout, reconciliation asks git for the changed-path set — a diff against the recorded HEAD plus status with untracked files — instead of walking the whole tree. Files git ignores are invisible to that shortcut and external roots live outside the repository, so either condition falls back to the full stat walk, as does any git failure.

While any reindex is in flight — a reconcile worker or a watcher batch — code_query and code_explore results begin with an explicit staleness warning so agents verify critical answers with direct file reads instead of trusting a converging index. cog doctor reports drift counts, and cog code:sync runs the same reconcile on demand — useful in scripts and git hooks.

On Windows, automatic synchronization (file watching, startup reconcile, and the git sentinel) is unavailable; keep the index current with cog code:sync or cog code:index.

Scan, bootstrap, reconciliation, and watcher paths share the same symlink-aware boundary policy. Symlinks that resolve inside the project are followed while preserving their logical alias; targets outside the project are excluded unless their root is explicitly listed under code.external_roots. Project-scan recommendations for external roots require interactive approval before cog init persists them.

CLI compatibility

cog code:index remains the CLI entry point for building .cog/index.scip. Code queries and indexed file operations are MCP capabilities rather than code:* CLI commands.


Debug

An interactive debugger your agent controls through MCP. 36 tools covering breakpoints, stepping, variable inspection, stack traces, expression evaluation, memory reads, disassembly, and more.

MCP debug sessions and drivers run inside the cog mcp process. A separate optional daemon remains available only for the debug:serve, debug:status, debug:kill, and dashboard CLI utilities; it is not auto-started by MCP tool calls. The removed debug:send compatibility command is not part of the current CLI.

Key capabilities

  • Launch or attach to processes with line, function, exception, and conditional breakpoints; data watchpoints are exposed only when the selected driver and platform implement them
  • Text-first debug results — most debug_* tools now return readable summaries instead of JSON blobs embedded in MCP text output
  • Step-over-inspect — step repeatedly while evaluating expressions in a single call, reducing round trips
  • Module launch mode — debug by module name (e.g. python -m pytest) in addition to script path
  • Synchronous or async — timeout_ms controls whether the agent blocks for results or polls asynchronously
  • Low-level access — memory reads, disassembly, register inspection, core dump loading

The native DWARF engine supports live process control on macOS and Linux; other platforms return error.UnsupportedPlatform. Reverse execution is not implemented for the native engine, and individual low-level operations can remain unavailable for a given operating system, architecture, or DAP driver.

CLI utilities

Command Description
debug:status Check daemon health and active sessions
debug:dashboard Live session monitoring TUI
debug:kill Stop the daemon
debug:sign macOS code-signing for debug entitlements

Dashboard bindings are q or Ctrl+C to quit, Tab to cycle panes, j/Down and k/Up to scroll, and [/] to select the previous or next session.

On macOS, cog init handles the code-signing for you.


Extensions

You can add code intelligence and debugging support for any language through extensions.

cog ext:install https://github.com/trycog/cog-zig.git --trust-build
cog ext:install https://github.com/trycog/cog-zig --version=0.75.0 --trust-build
cog ext:update --trust-build
cog ext:update cog-zig --trust-build

Extensions install from staged GitHub release tarballs into ~/.config/cog/extensions/ and override built-in indexers for shared file types. By default, Cog installs the latest stable release tag; --version selects an exact released version; cog ext:update upgrades either all installed extensions or one named extension. Cog verifies GitHub's sha256: release-asset digest before extraction and transactionally promotes the staged extension. Downloaded manifest build commands are blocked unless that invocation includes --trust-build; build trust is separate from checksum verification and never bypasses it.

Available extensions

Extension Language Code Intelligence Debugging
cog-elixir Elixir Yes DAP (ElixirLS)
cog-nix Nix Yes
cog-ruby Ruby Yes DAP (rdbg)
cog-swift Swift Yes DAP (lldb)
cog-zig Zig Yes DWARF (native)

See Writing a Language Extension to build your own.


Diagnostics

Update checks

Cog checks GitHub for new releases at most once per 24 hours from a background worker and mentions an available update at most once per version per week — in MCP sessions (a one-line note the agent relays before asking you to update), in cog doctor, and at the end of cog init. cog doctor also reports when installed agent assets were generated by an older binary (run cog init to refresh); nothing is ever updated or regenerated automatically. Set COG_UPDATE_CHECK=0 to disable update checks entirely; the poll is an unauthenticated GET of the public releases feed and carries no credentials or telemetry.

cog doctor

Validates your Cog installation: config resolution, memory backend connectivity, code index health, installed extensions, and agent integration files. Reports pass/warn/fail per check with a summary line. Exits 1 on any failure — useful in CI or after setup changes.

Debug logging

cog code:index --debug

--debug is accepted by every command and writes a detailed log of configuration resolution, file operations, subprocess invocations, and network calls. When a command fails with an unexpected error, Cog prints the error name and points you here. Persist it with {"debug": true} in .cog/settings.json instead of passing the flag each time.


Development

The release workflow grants repository contents write access plus GitHub id-token: write, attestations: write, and artifact-metadata: write only to the release job that creates draft assets and build provenance. Validation, CI, and build jobs retain read-only repository permissions.

zig build test                     # Run tests
zig build test-indexing-integration  # Run real code:index integration coverage
zig build bench-indexing           # Run deterministic offline indexing benchmark
zig build test-indexing-benchmark  # Run benchmark plus SCIP malformed-input fuzz smoke
zig build run                      # Build and run
zig build run -- mcp               # Start MCP server

Index benchmark timings are informational. Its regression gate asserts fixed document, symbol, occurrence, and byte counts plus SHA-256 equality across full indexing, reindexing, and two independent fresh runs.


Built with Zig

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages