cx-config — Workflow Configuration Management
Overview
View and modify core configurations of the CX Workflow, including developer ID, GitHub sync mode, feature toggles, etc. All configurations are stored in
${GIT_ROOT}/.claude/cx/config.json
.
Execution Flow
Step 1: Locate Configuration File
bash
GIT_ROOT=$(git rev-parse --show-toplevel)
CONFIG_FILE="${GIT_ROOT}/.claude/cx/config.json"
if [ ! -f "$CONFIG_FILE" ]; then
echo "❌ Workflow not initialized"
echo "Please run first: /cx-init"
exit 1
fi
Step 2: Read Current Configuration
json
{
"version": "2.0",
"developer_id": "cx",
"github_sync": "collab",
"current_feature": "cx-payment",
"agent_teams": false,
"background_agents": false,
"code_review": true,
"auto_format": {
"enabled": true,
"formatter": "auto"
},
"hooks": {
"session_start": true,
"pre_compact": true,
"prompt_refresh_interval": 5,
"stop_verify": true,
"post_edit_format": true,
"notification": true,
"permission_auto_approve": true
}
}
Step 3: Display Current Configuration
⚙️ CX Workflow — Current Configuration
📋 Basic Configurations
├─ developer_id: cx
├─ github_sync: collab
└─ current_feature: cx-payment
🤖 AI Features
├─ agent_teams: false
├─ background_agents: false
└─ code_review: true
🎨 Code Processing
├─ auto_format.enabled: true
└─ auto_format.formatter: auto
🔧 Hooks Toggles
├─ session_start: true
├─ pre_compact: true
├─ prompt_refresh_interval: 5
├─ stop_verify: true
├─ post_edit_format: true
├─ notification: true
└─ permission_auto_approve: true
Modify config: /cx-config <field> <value>
Or: /cx-config (enter interactive menu)
Step 4: Interactive Modification Menu
Use AskUserQuestion to display the menu for users to select the configuration to modify:
Select the configuration item to modify:
【Basic Configurations】
1. developer_id (Current: cx)
2. github_sync (Current: collab)
3. current_feature (Current: cx-payment)
【AI Features】
4. agent_teams (Current: false)
5. background_agents (Current: false)
6. code_review (Current: true)
【Code Processing】
7. auto_format.enabled (Current: true)
8. auto_format.formatter (Current: auto)
【Hooks Toggles】
9. session_start (Current: true)
10. pre_compact (Current: true)
11. prompt_refresh_interval (Current: 5)
12. stop_verify (Current: true)
13. post_edit_format (Current: true)
14. notification (Current: true)
15. permission_auto_approve (Current: true)
0. Return
Select (enter number or directly input field name):
Configuration Item Details
1. developer_id
Type: String
Default Value: Set during first /cx-init
Description: Developer identifier, used for:
- Naming prefix for feature directories
- Prefix for Git commit author
- Identity identifier in logs and notifications
Modification Example:
Current: developer_id = "cx"
Modified to: "alice"
Feature directory: features/alice-payment/ (instead of cx-payment/)
2. github_sync
Type: Enum
Optional Values:
|
|
|
Default Value:
Mode Comparison
| Mode | Document Issue | Task Issue | PR | Applicable Scenario |
|---|
| ❌ | ❌ | ❌ | Solo projects, internal testing |
| ❌ | ❌ | ❌ | Solo review, documentation |
| ✅ (PRD/Design) | ❌ | ✅ (Summary) | Recommended for 2-5 person teams |
| ✅ (All) | ✅ (All) | ✅ | Large teams, strict processes |
Modification Example:
Current: github_sync = "collab"
Modified to: "off"
Effect: cx-summary will no longer create GitHub Issues, only generate local summary.md
Modification Process (AskUserQuestion):
Current GitHub sync mode: collab
Select new mode:
① off — Local-only, no GitHub Issues/PRs created
② local — Create summary Issue upon completion
③ collab — Create Issues for PRD/Design Docs, Issue+PR for summary (Recommended)
④ full — Create Issues for all documents
Select (1-4):
3. current_feature
Type: String
Default Value: Empty string
Description: Slug of the currently active feature. Manually set for:
- Viewing progress of this feature via /cx-status
- Default execution of tasks for this feature via /cx-exec
- Automatic loading of this feature's context during session SessionStart hook
Modification Example:
Current: current_feature = "cx-payment"
Modified to: "cx-refund"
Effect: Next /cx-exec will execute tasks related to cx-refund
/cx-status will display progress of cx-refund
4. agent_teams
Type: Boolean
Default Value:
Description: Whether to enable Agent Teams mode (front-end and back-end contract collaboration)
Enable Conditions:
- Claude Code must support the Agent Teams feature (currently experimental)
- The project has clear front-end and back-end division of labor
- Need to lock front-end and back-end alignment via API contracts
Effects After Enabling:
When cx-plan executes:
└─ Automatically identify front-end/back-end task groups
When cx-exec executes:
├─ Launch frontend-agent (handles front-end tasks)
├─ Launch backend-agent (handles back-end tasks)
└─ SubagentStop hook verifies contract consistency between both parties
Modification Example:
Current: agent_teams = false
Modified to: true
Note: After enabling, Claude Code must support Agent Teams. It is recommended to consult the documentation
5. background_agents
Type: Boolean
Default Value:
Description: Whether to allow background agents to run
Effects After Enabling:
After cx-summary is generated:
├─ Local summary is completed immediately (user can continue operations)
└─ GitHub sync (Issue/PR creation) runs in the background
Behavior When Disabled (Default):
After cx-summary is generated:
├─ Execute local summary
├─ Block and wait for GitHub sync
└─ Return after completion
6. code_review
Type: Boolean
Default Value:
Description: Whether to intelligently ask for code review after all tasks of cx-exec are completed
When Enabled (true):
After all tasks are completed, prompt the user:
"All tasks are completed. Would you like to perform a code review?"
User options:
① Full review (logic bugs + security + quality + cleanup)
② Quick check (only logic bugs)
③ Skip
When Disabled (false):
Directly enter cx-summary after task completion
Skip the code review process
Modification Example:
Current: code_review = true
Modified to: false
Effect: No more code review prompts in subsequent executions
7. auto_format.enabled
Type: Boolean
Default Value:
Description: Whether the PostToolUse hook automatically formats written files
When Enabled (true):
After Edit/Write tool execution, automatically run:
├─ JavaScript/TypeScript → prettier
├─ Python → black
├─ Go → gofmt
├─ Rust → rustfmt
└─ Others → Detect according to formatter
When Disabled (false):
Files are not automatically formatted, need to run format command manually
8. auto_format.formatter
Type: Enum
Optional Values:
|
|
|
|
Default Value:
Description: Selection of automatic formatting tool
| Value | Description |
|---|
| Auto-detect, select according to file type |
| Force use of prettier (JS/TS/JSON) |
| Force use of black (Python) |
| Force use of gofmt (Go) |
| Force use of rustfmt (Rust) |
Modification Example:
Current: auto_format.formatter = "auto"
Modified to: "prettier"
Effect: All formatable files are processed with prettier
9. hooks.session_start
Type: Boolean
Default Value:
Description: Whether the SessionStart hook is enabled
When Enabled (true):
Automatically execute at the start of each session:
├─ Read status.json
├─ Detect interrupted tasks
├─ Load context summary
└─ Prompt user for available operations
When Disabled (false):
Session does not automatically load context
Need to manually query progress via /cx-status
10. hooks.pre_compact
Type: Boolean
Default Value:
Description: Whether the PreCompact hook is enabled
When Enabled (true):
Automatically execute before compaction:
└─ Generate context-snapshot.md
├─ Current task number
├─ Contract summary
└─ Progress information
Use snapshot to quickly restore context when recovering after compaction
11. hooks.prompt_refresh_interval
Type: Integer
Default Value:
Description: How many rounds the UserPromptSubmit hook injects target refresh
Value Meaning:
- — Disable target refresh
- — Inject once every N rounds: "Current task: #{n}, Remaining: X"
Modification Example:
Current: prompt_refresh_interval = 5
Modified to: 3
Effect: Automatically inject progress reminder every 3 rounds of dialogue
12. hooks.stop_verify
Type: Boolean
Default Value:
Description: Whether the Stop hook is enabled
When Enabled (true):
Automatically check when user wants to leave:
├─ Read status.json
├─ Detect if there are in_progress but unfinished tasks
└─ If yes, remind user to confirm
When Disabled (false):
User can leave directly without reminders
13. hooks.post_edit_format
Type: Boolean
Default Value:
Description: Whether automatic formatting of the PostToolUse hook is enabled
When Enabled (true):
Automatically execute after each Edit/Write:
└─ Call auto_format.formatter to format files
When Disabled (false):
No automatic formatting
Used in combination with auto_format.enabled
14. hooks.notification
Type: Boolean
Default Value:
Description: Whether to enable desktop notifications
When Enabled (true):
Send desktop notifications for the following events:
├─ All tasks of cx-exec are completed
├─ cx-fix completes repair
└─ cx-summary completes aggregation
Notification Methods (Auto-detect):
- macOS:
- Linux:
- Windows: PowerShell MessageBox
When Disabled (false):
No desktop notifications are sent
15. hooks.permission_auto_approve
Type: Boolean
Default Value:
Description: Whether to automatically approve security operations
When Enabled (true):
PermissionRequest hook automatically approves the following commands:
├─ git add/commit/push/checkout/branch
├─ gh issue/pr/project
└─ npm test / pytest / cargo test / go test
When Disabled (false):
All commands require manual confirmation from the user
Modification Methods
Method 1: Interactive Menu (Recommended)
/cx-config
→ Display current configuration
→ Prompt to select the item to modify
→ Provide input/selection interface according to field type
Method 2: Direct Command
/cx-config developer_id alice
/cx-config github_sync off
/cx-config code_review false
/cx-config hooks.notification true
Parameter Validation:
- Must be a valid configuration field
- Value must match the field type
- Enum fields only accept allowed values
Method 3: Manual Editing
bash
vim ${GIT_ROOT}/.claude/cx/config.json
Note: Ensure JSON format is correct after manual editing.
Effects After Configuration Modification
Configurations Taking Effect Immediately
- developer_id: Used when creating features next time
- current_feature: Takes effect immediately in next /cx-exec
- code_review: Takes effect immediately after next cx-exec completion
- auto_format.enabled/formatter: Takes effect immediately after next Write/Edit
- hooks.prompt_refresh_interval: Takes effect immediately in next UserPromptSubmit
Configurations Requiring Rerunning Commands
- github_sync: Takes effect in next /cx-summary
- agent_teams: Need to re-run /cx-plan to apply new task grouping
- background_agents: Takes effect in next /cx-summary
Hooks Toggles
- Take effect immediately in the next trigger of the corresponding hook after modification
- Disabling a hook will not retroactively clean up (e.g., after session_start=false
already loaded context remains valid)
Full Configuration Backup and Recovery
Backup Current Configuration
bash
cp ${GIT_ROOT}/.claude/cx/config.json \
${GIT_ROOT}/.claude/cx/config.json.backup
Restore from Backup
bash
cp ${GIT_ROOT}/.claude/cx/config.json.backup \
${GIT_ROOT}/.claude/cx/config.json
Configuration Validation
Automatic checks during configuration modification:
| Field | Valid Values | Description |
|---|
| Non-empty string | Maximum 32 characters, only alphanumeric and underscores |
| off/local/collab/full | Must be allowed values |
| String | Can be empty |
| true/false | Boolean value |
| true/false | Boolean value |
| true/false | Boolean value |
| true/false | Boolean value |
| auto/prettier/... | Must be allowed values |
| Boolean/Integer | According to field type |
Common Modification Scenarios
Scenario 1: Switch from Solo Mode to Team Collaboration
Current Configuration:
github_sync: off
code_review: false
Modified to:
github_sync: collab
code_review: true
Result: Subsequent development will create GitHub Issues for review, supporting team collaboration
Scenario 2: Disable Automatic Formatting
Modification:
auto_format.enabled: false
Result: Written code will not be automatically formatted
Scenario 3: Disable Desktop Notifications
Modification:
hooks.notification: false
Result: No more notifications sent upon task completion
Scenario 4: Accelerate Large-Scale Development
Modification:
agent_teams: true (Enable parallel front-end and back-end development)
background_agents: true (Background GitHub sync)
hooks.prompt_refresh_interval: 10 (Reduce refresh frequency)
Result: Multi-agent parallel development, reducing manual waiting time
Troubleshooting
| Problem | Solution |
|---|
| No effect after modification | Check if commands need to be rerun or session needs to be restarted |
| config.json format error | Validate with : |
| Cannot write to config | Check file permissions: |
| GitHub sync not working | Ensure is not and there is a valid GitHub token |