feature: agent integration contract — reusable detection, settings patching, and revert
@esnible is already working on this.
Since Sep 10, 2026.
- Dominant language
- Go
- Stars
- 13
- Forks
- 40
- Avg merge
- 12h 17m
- Merged PRs (30d)
- 156
Description
Feature Description
The Claude Code integration is bespoke. cmd_claudecode.go is 728 lines of hardcoded
specifics: settingsRel = ".claude/settings.json", stateRel = ".cortex/claude-code-state.json",
managedKeys / bundleKeys naming the env vars it injects into that file's env block,
readState / writeState for revert bookkeeping, and a claude-code enable | disable | status
subcommand trio.
Adding OpenCode, Codex and Bob that way means writing that file three more times. Generalize
it first so each new agent is a small descriptor.
Proposed Solution
- An agent descriptor: name, how to detect it, where its settings live, how to patch and
un-patch them, which wire format it speaks, which tool inventory it ships - Shared enable / disable / status flow — ask before editing any agent's settings, support revert
- Per-agent state bookkeeping kept outside files the agent owns, as today
- Claude Code reimplemented on the contract with no behaviour change
- Adding an agent requires no changes outside its descriptor
- Documented so someone can add an agent without reading the proxy
Note: toolscan/known.go hardcodes Claude Code built-in tool names (knownTools plus an
implies map), so tool pruning is Claude-Code-specific too. The descriptor must carry a
per-agent tool inventory, or pruning silently does nothing for every other agent.
Additional Context
Part of the Cortex v0.9.0 release. On the critical path — blocks OpenCode, Codex and Bob support.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.