AGENT0S
HomeLibraryAgentic
FeedbackLearn AI
LIVE
Agent0s · AI Intelligence Library
Share FeedbackUpdated daily · 7am PST
Library/plugin
pluginintermediateGeneral AI

Dual-Graph: Compounding Context Engine for Claude Code & Codex CLI

Dual-Graph is a command-line tool that makes AI coding assistants like Claude Code and Codex CLI significantly cheaper and faster. It intelligently scans a software project to understand how the code is connected, then automatically provides the most relevant files to the AI for any given task, reducing wasted effort and cost.

AI SETUP PROMPT

Paste into Claude Code or Codex CLI — it will scan your project and set everything up

# Install & Configure: Dual-Graph: Compounding Context Engine for Claude Code & Codex CLI

## What This Is
Dual-Graph is a command-line tool that makes AI coding assistants like Claude Code and Codex CLI significantly cheaper and faster. It intelligently scans a software project to understand how the code is connected, then automatically provides the most relevant files to the AI for any given task, reducing wasted effort and cost.

Source: https://github.com/kunal12203/Codex-CLI-Compact

## Before You Start

Scan my workspace and analyze:
- The project language, framework, and directory structure
- Existing agent configuration (check for .claude/, .codex/, CLAUDE.md, settings.json, commands/, skills/ directories)
- Whether this repository or a similar tool is already cloned or installed

Then ask me before proceeding:
1. Do I need to configure any service credentials for this plugin (database, API keys, etc.)?
2. Should this be project-scoped or global?

## Fetch the Source

Clone or inspect the repository to understand what needs to be installed:
```bash
gh repo clone kunal12203/Codex-CLI-Compact
```
Review the README, directory structure, and any install instructions before proceeding.

## What to Implement

This is an **Agent Plugin** — typically an MCP server or capability bundle.

- Install any required npm/pip packages from the source repository
- Register the MCP server in `.claude/settings.json` under the `mcpServers` key with the correct command and args
- Configure any required environment variables or credentials
- Verify the server starts correctly by checking its expected output

## Additional Context

- Execute the appropriate installation script for the user's OS to install the Dual-Graph CLI. For macOS/Linux, run `curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash`. For Windows PowerShell, run `irm https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.ps1 | iex`.
- Initialize Dual-Graph on the user's current project by running `dgc .` (for Claude Code) or `dg .` (for Codex CLI) in the project's root directory. This will create a local semantic graph of the codebase.
- For all subsequent tasks in this project, initiate the session through the Dual-Graph wrapper. Instead of calling the agent directly, execute `dgc "[user's task description]"` or `dg "[user's task description]"` to leverage the pre-loaded context.

## Reference Implementation

```
curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash
source ~/.zshrc   # or ~/.bashrc / ~/.profile
```

## Guidelines

- Adapt everything to my existing project — do not assume a specific stack or directory layout
- Review any fetched code for safety before installing or executing it
- After setup, run a quick verification and show me a summary of exactly what was installed, where, and how to use it
2,916 charactersCompatible with Claude Code & Codex CLI
MANUAL SETUP STEPS
  1. 01Execute the appropriate installation script for the user's OS to install the Dual-Graph CLI. For macOS/Linux, run `curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash`. For Windows PowerShell, run `irm https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.ps1 | iex`.
  2. 02Initialize Dual-Graph on the user's current project by running `dgc .` (for Claude Code) or `dg .` (for Codex CLI) in the project's root directory. This will create a local semantic graph of the codebase.
  3. 03For all subsequent tasks in this project, initiate the session through the Dual-Graph wrapper. Instead of calling the agent directly, execute `dgc "[user's task description]"` or `dg "[user's task description]"` to leverage the pre-loaded context.

CODE INTELLIGENCE

bash
curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash
source ~/.zshrc   # or ~/.bashrc / ~/.profile

FIELD OPERATIONS

Legacy Codebase Refactoring Assistant

Use Dual-Graph to map a large, unfamiliar monolithic codebase. Then, instruct an AI agent to identify modules suitable for extraction into microservices, generate API contracts for them, and refactor the code, leveraging the pre-loaded context for higher accuracy and speed.

Automated Code Review & Security Scanner

Create a CI/CD workflow where on every pull request, Dual-Graph scans the changed files and their dependencies. The workflow then prompts an AI agent with this context to perform a code review, check for common bugs, and identify potential security vulnerabilities, making the process faster and more affordable than full-repo analysis.

STRATEGIC APPLICATIONS

  • →Accelerate new developer onboarding by using Dual-Graph to map complex projects. New hires can use their AI agent to ask specific questions about the codebase (e.g., 'Trace the user authentication flow'), and the tool provides the AI with the correct files to give accurate answers instantly, reducing time-to-productivity.
  • →Reduce AI development expenditure across the engineering team. By implementing Dual-Graph, companies can cut the token costs of using cloud-based AI coding assistants by 30-45%, leading to significant savings on monthly AI provider bills and allowing for more extensive AI adoption within the same budget.

TAGS

#context-management#cost-saving#performance#code-graph#cli-tool#typescript#python
Source: GITHUB · Quality score: 9/10
VIEW SOURCE