SpineCodex

by GhabiXVerified

An enhanced Codex CLI for complex, long-running software engineering tasks—resolving 89% more tasks than Codex at 27% lower cost, with up to 10× the effective context length.

121
Stars
12
Forks
Rust
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/GhabiX/SpineCodex

Getting Started

Guides for using skills like SpineCodex.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

SpineCodex tree mark SpineCodex

Life begins with division and differentiation. An agent owns its own morphogenesis.

npm version Apache-2.0 license

Based on OpenAI Codex. Maintained by Jiahong Xiang and Kunqiu Chen.

English · 简体中文

Why SpineCodex

SpineCodex is an enhanced, independently maintained version of the OpenAI Codex CLI for complex, long-running software engineering tasks. It inherits your existing Codex configuration and works out of the box. Compared with Codex, it resolves 89% more tasks at 27% lower total cost on SWE-Milestone and extends the effective working context by up to 10×. It also improves the average score by 10.8 points on ProgramBench and the mean score by 9.2 points on FrontierSWE.

Linear contextSpineCodex
Run out of context?256K → 2.5M Effective Working Context
SpineJIT compiles completed branches into semantic Node Memory, extending effective working context beyond the native window.
Drift after repeated compaction?Minimum Effective Context. Maximum Focus.
Through the SpineTree, the agent manages tasks and context as one unified system, staying focused on the minimum context required by the current task.
Lose patience and focus on long tasks?Recursive Subagent Scaling on Demand.
SpineJIT lets the agent recursively unfold into specialized subagents on demand, bringing divide-and-conquer structure and greater reasoning depth to complex problems.

Get started

Just install and run—SpineCodex automatically inherits your existing Codex configuration and works out of the box.

npm install -g @spinejit/spine-codex@latest
spine-codex

Features

FeaturePurpose
Spine Spawn (spine_spawn)Enabled by default. At any node, concurrently spawn multiple differentiated branch agents that inherit its history, recursively collaborate, and converge through cache-friendly context reuse.
Memory Projection (spinetree_memory_projection)Project compiled Node Memory into inspectable Markdown under .codex/spinetree/YYYY/MM/DD/<session-id>/.

Spine Spawn is enabled by default. Run /experimental to enable Memory Projection, then save and start a new conversation. Set spine_spawn.max_concurrent_threads_per_session in ~/.codex/config.toml to configure the total per-session thread limit, including the root thread.

SpineCodex context tree growing through recursive agent spawning
Click to view the full animation.

Long-horizon performance

Across three long-horizon coding benchmarks, SpineCodex delivers stronger outcomes: 1.89× resolved tasks at 27% lower total cost on SWE-Milestone, +10.80pp average score on ProgramBench, and +9.2pp mean score on FrontierSWE.

SWE-Milestone (ICML 2026)

Long-horizon software development · 80 milestones · GPT-5.6 · sol high

SystemResolvedTotal cost
BaseCodex9$764.18
SpineCodex17$556.46

1.89× resolved tasks at 27% lower total cost.

ProgramBench

Whole-repo program reconstruction · Random sample: 50 of 200 tasks · GPT-5.6 · Sol high · conservative cost estimate

SystemAvg. scoreTasks scoring >95%Cost
BaseCodex62.55%2/50$188.12
SpineCodex73.35%7/50$475.10

+10.80pp average score and 3.5× high-scoring tasks.

FrontierSWE

Ultra-long-horizon coding · 9-task evaluation · GPT-5.6 · high · estimated API cost per trial

SystemMean scoreBest scoreCost
BaseCodex33.537.9$20.16
SpineCodex42.746.8$37.29

+9.2pp mean score and +8.9pp best score.

How SpineJIT works

Agent Morphogenesis: Each task shapes its own context and execution through just-in-time context-tree compilation and recursive subagent scaling.

TL;DR: SpineJIT replaces the live suffix of a context with shorter memory, while keeping the prefix unchanged so it can continue to hit the prompt cache.

To control this suffix replacement precisely, SpineJIT is implemented as a just-in-time compilation and context-mapping pipeline:

$$ \text{context messages} \rightarrow \text{Spine tokens} \rightarrow \text{SpineTree (ParseStack)} \rightarrow \text{new context} $$

The pipeline has two main stages.

1. JIT-compile context into a SpineTree

SpineJIT treats a context $C$---a message list, or simply a sentence whose characters are messages---as a stream to compile.

At each sampling boundary, it turns newly appended messages and control events into Spine tokens and updates a live LR(0) ParseStack:

SpineJIT uses four token kinds:

$$ \Sigma_{\mathrm{Spine}} = {\mathrm{Message},\ \mathrm{Open},\ \mathrm{Close},\ \mathrm{SpineSpawnNode}} $$

Message represents a raw context item. Open, Close, and SpineSpawnNode are special tokens emitted by SpineJIT at the corresponding sampling boundaries.

$$ \begin{aligned} \mathrm{SpineTree} &\to \mathrm{Nodes}\ \mathrm{End} \ \mathrm{Nodes} &\to \mathrm{Node} \mid \mathrm{Nodes}\ \mathrm{Node} \ \mathrm{Node} &\to \mathrm{Message} \mid \mathrm{SpineTreeNode} \ \mathrm{SpineTreeNode} &\to \mathrm{Open}\ \mathrm{Nodes}\ \mathrm{Close} \mid \mathrm{SpineSpawnNode} \end{aligned} $$

End is only the logical end of a session; a live session never emits it. Therefore, the ParseStack is the live SpineTree, and the reduction Open Nodes Close -> SpineTreeNode turns a closed subtree into one node.

In short, SpineJIT uses LR(0) JIT compilation to map context $C$ to a Spine Tree $PS$:

$$ PS = \mathrm{compile}(C) $$

2. Map the SpineTree into a new context

The structured SpineTree can now be mapped into a shorter context while preserving its stable prefix. For ParseStack $PS$, define:

$$ C' = f(PS) = \prod_{i=0}^{n} h(PS[i]) $$

$$ h(X) = \begin{cases} \prod_{x \in X} h(x), & X = \mathrm{Nodes} \ \mathrm{raw}(X), & X = \mathrm{Message} \ \mathrm{memory}(X), & X = \mathrm{SpineTreeNode} \ \mathrm{spine\_node\_desc}(X), & X = \mathrm{Open} \end{cases} $$

Here, $\prod$ means ordered concatenation.

The mapping is deliberately small:

  • Message keeps its original content through $\mathrm{raw}(X)$.
  • A closed SpineTreeNode is replaced by its shorter $\mathrm{memory}(X)$.
  • An unmatched Open is represented by a concise $\mathrm{spine\_node\_desc}(X)$, helping the LLM delimit the currently live Spine node.

As parsing progresses, completed work in the context suffix is reduced into a SpineTreeNode and then projected as memory. Earlier context remains unchanged:

$$ \mathrm{prefix} \cdot \mathrm{suffix} \longrightarrow \mathrm{prefix} \cdot \mathrm{memory} $$

This is the central idea of SpineJIT: compress the context where work has finished, without invalidating the reusable prefix.

3. How SpineJIT inserts Spine control tokens

The LLM decides when to open or close a SpineTreeNode from the current context. The guiding objective is to maximize the average relevance of the remaining context to the current task.

Here, a sampling means one complete processing cycle for a model response: the response itself together with any tool calls it produces.

SpineJIT exposes Spine tools to let the LLM express these decisions. After a successful tool call in a sampling step, SpineJIT inserts the corresponding control token at a precise boundary:

Tool callInserted tokenPosition
spine.openOpenPre-sampling
spine.closeClosePre-sampling
spine.nextClose OpenPre-sampling
spine.spawnSpineSpawnNodesPost-sampling

These tokens connect the model's task-boundary decisions to the LR(0) parser, which continuously updates the ParseStack and therefore the context seen by the next sampling step.

Citation

A technical report on SpineJIT will be released soon.

If you use SpineCodex in your research, please cite this repository:

@software{xiang2026spinecodex,
  title = {Agent Morphogenesis: Just-in-Time Context Tree Compilation for Cost-Efficient Recursive Subagent Scaling},
  author = {Jiahong Xiang and Kunqiu Chen and Yuqun Zhang},
  year = {2026},
  url = {https://github.com/GhabiX/SpineCodex}
}

Project

SpineCodex is an independently maintained fork based on and derived from OpenAI Codex. It is not the official OpenAI Codex CLI or the official @openai/codex npm package.

SpineCodex is licensed under the Apache-2.0 License. OpenAI Codex and other derived components retain their attribution in NOTICE.

Frequently Asked Questions

What is SpineCodex?

SpineCodex is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by GhabiX. An enhanced Codex CLI for complex, long-running software engineering tasks—resolving 89% more tasks than Codex at 27% lower cost, with up to 10× the effective context length. It has 121 GitHub stars.

Is SpineCodex safe to use?

Yes. SpineCodex passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install SpineCodex?

Clone the repository with "git clone https://github.com/GhabiX/SpineCodex" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is SpineCodex written in?

SpineCodex is primarily written in Rust. It is open-source under GhabiX on GitHub, so you can review or fork the full source.

Are there alternatives to SpineCodex?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh SpineCodex against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details
SpineCodex — AI Skill for Claude Code | SkillTip