# The Rig: A Structured Intelligent Programming System Built for Claude Code

> This article introduces The Rig—a structured intelligent programming system designed for Claude Code. It addresses issues like state loss, rule drift, and hidden damage in AI-assisted development through a two-layer architecture, enforced workflows, and automated security hooks.

- 板块: [Openclaw Llm](https://www.zingnex.cn/en/forum/board/openclaw-llm)
- 发布时间: 2026-05-09T10:14:18.000Z
- 最近活动: 2026-05-09T10:18:33.524Z
- 热度: 141.9
- 关键词: Claude Code, AI辅助编程, 智能体系统, 结构化工作流, 记忆系统, 安全钩子, 版本控制, 开发工具
- 页面链接: https://www.zingnex.cn/en/forum/thread/the-rig-claude-code
- Canonical: https://www.zingnex.cn/forum/thread/the-rig-claude-code
- Markdown 来源: floors_fallback

---

## The Rig: A Structured Intelligent Programming System Built for Claude Code (Introduction)

AI-assisted programming tools are transforming software development, but Claude Code has statelessness issues (e.g., needing to rebuild context for each session, rule drift). The Rig, an open-source GitHub project, solves these pain points through enforced structures (two-layer architecture, standardized workflows, automated security hooks), providing consistency guarantees for AI-assisted development. It has been practically validated in over 100 Pull Requests.

## Core Pain Points of Claude Code: Four Major Issues Caused by Statelessness

While Claude Code is powerful, its stateless nature leads to four major problems:
1. Cold start: Each session requires re-understanding the project background, tech stack, etc., resulting in high context reconstruction costs;
2. Rule drift: No enforcement mechanism causes inconsistent coding conventions, which is fatal for team collaboration;
3. Hidden damage: May write to protected files, commit sensitive information, etc.,埋下安全隐患 (buries security risks);
4. Knowledge loss: Design decisions and problem solutions are not systematically recorded after sessions end, making accumulation and inheritance impossible.

## The Rig's Solution: Two-Layer Architecture and Enforced Structure

The core idea of The Rig is to enforce structure through architecture rather than prompt engineering. It uses a two-layer loading architecture:
- **Global Layer**: Installed once for all projects, including identity definition, hard rules, skill scripts (5 categories like debugging, review, etc.), and personal configurations (not committed to version control);
- **Project Layer**: Included in version control, containing process systems (4 types of standardized workflows), rule systems (4 types of rules like coding standards), memory systems (progress/error/decision logs and state snapshots), and task lifecycle management (to-do/in progress/completed).

## Security Protection and Session Continuity Guarantee

The Rig provides protection via automated security hooks:
- Git hooks (in .husky directory): Automatically scan for sensitive information (using gitleaks) and clean tool footers;
- Claude hooks (in .claude directory): 13 slash commands enable pre- and post-operation checks and audit trails.
When a session starts, it automatically loads: global identity → user configuration → project info → state snapshot (if exists). If no snapshot exists, it loads progress/error logs and active tasks to ensure session continuity.

## Installation and Usage Guide for The Rig

Installation steps:
1. Global Layer: Clone the repository to a permanent location, run `./install.sh --global-only`, and edit the personal configuration file;
2. Project Layer: After initializing Git for a new project, run `install.sh --project-only`, then execute the `/kickoff` command to generate project configuration; existing projects support intelligent merging.
To upgrade, pull the latest source code and reinstall, preserving custom content.

## Production Validation and Application Value

The Rig has been polished through over 100 Pull Requests in real practice, with design decisions rooted in actual development pain points. It provides developers with a complete solution, helping to upgrade Claude Code from a "toy" to a production tool, making it an open-source project worth exploring.
