Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); Refactor: Change loop directory from .humanize-loop.local to .humanize/rlcr by SihaoLiu · Pull Request #9 · PolyArch/humanize · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,7 +8,7 @@
"name": "humanize",
"source": "./",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3"
"version": "1.1.4"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
{
"name": "humanize",
"description": "Humanize - An iterative development plugin that uses Codex to review Claude's work. Creates a feedback loop where Claude implements plans and Codex independently reviews progress, ensuring quality through continuous refinement.",
"version": "1.1.3",
"version": "1.1.4",
"author": {
"name": "humania-org"
},
Expand Down
3 changes: 1 addition & 2 deletions .claude/CLAUDE.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,5 @@ This is a Claude Code plugin that provides iterative development with Codex revi

# Humanize Project Rules
- Everything about this project, including but not limited to implementations, comments, tests and documentations should be in English. No Emoji or CJK char is allowed.
- **MANDATORY**: Every commit MUST include a version bump in `.claude-plugin/plugin.json` and `README.md` (the "Current Version" line). This applies to ALL commits without exception - bug fixes, features, documentation changes, etc. Increment the patch version (e.g., 1.0.0 -> 1.0.1) for each commit.
- Every `git push` or `git commit` MUST confirm with user first, MUST NOT commit or push to remote without check with user.
- If under `main` branch, every commit MUST include a version bump in `.claude-plugin/plugin.json`, `.claude-plugin/marketplace.json` and `README.md` (the "Current Version" line). If not under `main` branch, please make sure that the current branch's `version` in those three files has a incremental update compared to that of `main` branch. The `version` must be identical in those three files.
- Version number must be in format of `X.Y.Z` where X/Y/Z is numeric number. Version MUST NOT include anything other than `X.Y.Z`. For example, a good version is `9.732.42`; Bad version examples (MUST NOT USE): `3.22.7-alpha` (extra "-alpha" string), `9.77.2 (2026-01-07)` (useless date/timestamp).
4 changes: 2 additions & 2 deletions .gitignore
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# Scratchpad
temp

# Humanize loop state directory (used by start-rlcr-loop)
.humanize-loop.local/
# Humanize state directories (used by start-rlcr-loop)
.humanize*

# Python cache
__pycache__/
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
# Humanize

**Current Version: 1.1.3**
**Current Version: 1.1.4**

> Derived from the [GAAC (GitHub-as-a-Context)](https://github.com/SihaoLiu/gaac) project.

Expand DownExpand Up@@ -72,17 +72,17 @@ Your plan file should contain:

### Step 3: Monitor Progress

All iteration artifacts are saved in `.humanize-loop.local/<timestamp>/`:
All iteration artifacts are saved in `.humanize/rlcr/<timestamp>/`:

```bash
# View current round
cat .humanize-loop.local/*/state.md
cat .humanize/rlcr/*/state.md

# View Claude's latest summary
cat .humanize-loop.local/*/round-*-summary.md | tail -50
cat .humanize/rlcr/*/round-*-summary.md | tail -50

# View Codex's review feedback
cat .humanize-loop.local/*/round-*-review-result.md | tail -50
cat .humanize/rlcr/*/round-*-review-result.md | tail -50
```

**Real-time Monitoring Dashboard** (Recommended):
Expand DownExpand Up@@ -113,7 +113,7 @@ This provides a real-time dashboard showing:

**The loop is fully interruptible** - you can exit Claude Code at any time and resume later:

- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize-loop.local/`)
- **Loop state**: Controlled solely by the presence of `state.md` in the current loop directory (newest timestamp in `.humanize/rlcr/`)
- **Resume**: Simply restart Claude Code in the same directory - the loop continues automatically
- **Cancel**: Rename `state.md` to `cancel-state.md` to stop the loop permanently

Expand All@@ -122,7 +122,7 @@ This provides a real-time dashboard showing:
/humanize:cancel-rlcr-loop

# Or manually rename state file (find newest loop directory first)
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ | sort -r | head -1)
mv "${LOOP_DIR}state.md" "${LOOP_DIR}cancel-state.md"
```

Expand DownExpand Up@@ -241,7 +241,7 @@ humanize/

## State Directory Structure

When loop is active, creates: `.humanize-loop.local/<TIMESTAMP>/`
When loop is active, creates: `.humanize/rlcr/<TIMESTAMP>/`

**Files Created**:
- `state.md` - Current round, config (YAML frontmatter). Presence indicates active loop.
Expand Down
4 changes: 2 additions & 2 deletions commands/cancel-rlcr-loop.md
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
---
description: "Cancel active RLCR loop"
allowed-tools: ["Bash(ls -1d .humanize-loop.local/*/)", "Bash(mv .humanize-loop.local/*/state.md .humanize-loop.local/*/cancel-state.md)", "Bash(cat .humanize-loop.local/*/state.md)", "Read"]
allowed-tools: ["Bash(ls -1d .humanize/rlcr/*/)", "Bash(mv .humanize/rlcr/*/state.md .humanize/rlcr/*/cancel-state.md)", "Bash(cat .humanize/rlcr/*/state.md)", "Read"]
hide-from-slash-command-tool: "true"
---

Expand All@@ -11,7 +11,7 @@ To cancel the active loop:
1. Find the current loop directory (newest timestamp):

```bash
LOOP_DIR=$(ls -1d .humanize-loop.local/*/ 2>/dev/null | sort -r | head -1)
LOOP_DIR=$(ls -1d .humanize/rlcr/*/ 2>/dev/null | sort -r | head -1)
echo "Loop dir: ${LOOP_DIR:-NONE}"
```

Expand Down
4 changes: 2 additions & 2 deletions hooks/lib/loop-common.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,10 +146,10 @@ is_state_file_path() {
echo "$path_lower" | grep -qE 'state\.md$'
}

# Check if a path is inside .humanize-loop.local directory
# Check if a path is inside .humanize/rlcr directory
is_in_humanize_loop_dir() {
local path="$1"
echo "$path" | grep -q '\.humanize-loop\.local/'
echo "$path" | grep -q '\.humanize/rlcr/'
}

# Check if a shell command attempts to modify a file matching the given pattern
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-bash-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -34,7 +34,7 @@ COMMAND_LOWER=$(to_lower "$COMMAND")
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow all commands
Expand DownExpand Up@@ -80,7 +80,7 @@ fi
# Plan backup is read-only - protects plan integrity during loop
# Use command_modifies_file helper for consistent pattern matching

if command_modifies_file "$COMMAND_LOWER" "\.humanize-loop\.local(/[^/]+)?/plan\.md"; then
if command_modifies_file "$COMMAND_LOWER" "\.humanize/rlcr(/[^/]+)?/plan\.md"; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand Down
14 changes: 7 additions & 7 deletions hooks/loop-codex-stop-hook.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,7 +5,7 @@
# Intercepts Claude's exit attempts and uses Codex to review work.
# If Codex doesn't confirm completion, blocks exit and feeds review back.
#
# State directory: .humanize-loop.local/<timestamp>/
# State directory: .humanize/rlcr/<timestamp>/
# State file: state.md (current_round, max_iterations, codex config)
# Summary file: round-N-summary.md (Claude's work summary)
# Review prompt: round-N-review-prompt.md (prompt sent to Codex)
Expand DownExpand Up@@ -41,7 +41,7 @@ HOOK_INPUT=$(cat)
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"

# Source shared loop functions and template loader
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
Expand DownExpand Up@@ -354,17 +354,17 @@ if command -v git &>/dev/null && git rev-parse --git-dir &>/dev/null 2>&1; then
# Check for special cases in untracked files
UNTRACKED=$(echo "$GIT_STATUS" | grep '^??' || true)

# Check if .humanize-loop.local is untracked
if echo "$UNTRACKED" | grep -q '\.humanize-loop\.local'; then
# Check if .humanize* directories are untracked (includes .humanize/ and any legacy .humanize-* dirs)
if echo "$UNTRACKED" | grep -q '\.humanize'; then
HUMANIZE_LOCAL_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-humanize-local.md" 2>/dev/null)
if [[ -z "$HUMANIZE_LOCAL_NOTE" ]]; then
HUMANIZE_LOCAL_NOTE="Note: .humanize-loop.local/ is intentionally untracked."
HUMANIZE_LOCAL_NOTE="Note: .humanize* directories are intentionally untracked."
fi
SPECIAL_NOTES="$SPECIAL_NOTES$HUMANIZE_LOCAL_NOTE"
fi

# Check for other untracked files (potential artifacts)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize-loop\.local' || true)
OTHER_UNTRACKED=$(echo "$UNTRACKED" | grep -v '\.humanize' || true)
if [[ -n "$OTHER_UNTRACKED" ]]; then
UNTRACKED_NOTE=$(load_template "$TEMPLATE_DIR" "block/git-not-clean-untracked.md" 2>/dev/null)
if [[ -z "$UNTRACKED_NOTE" ]]; then
Expand DownExpand Up@@ -855,7 +855,7 @@ if [[ "$LAST_LINE_TRIMMED" == "STOP" ]]; then
echo "Codex detected development stagnation during Full Alignment Check (Round $CURRENT_ROUND)." >&2
echo "The loop has been stopped to prevent further unproductive iterations." >&2
echo "" >&2
echo "Review the historical round files in .humanize-loop.local/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Review the historical round files in .humanize/rlcr/$(basename "$LOOP_DIR")/ to understand what went wrong." >&2
echo "Consider:" >&2
echo " - Revisiting the original plan for clarity" >&2
echo " - Breaking down the task into smaller pieces" >&2
Expand Down
10 changes: 5 additions & 5 deletions hooks/loop-edit-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -44,7 +44,7 @@ if is_round_file_type "$FILE_PATH_LOWER" "prompt"; then
fi

# ========================================
# Check if File is in .humanize-loop.local
# Check if File is in .humanize/rlcr
# ========================================

if ! is_in_humanize_loop_dir "$FILE_PATH"; then
Expand All@@ -56,7 +56,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -80,7 +80,7 @@ fi

FILENAME=$(basename "$FILE_PATH")
if [[ "$FILENAME" == "plan.md" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Editing plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -104,9 +104,9 @@ fi

if is_round_file_type "$FILE_PATH_LOWER" "summary"; then
# Extract filename from path (portable - works in bash and zsh)
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi

if [[ -n "$CLAUDE_FILENAME" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion hooks/loop-plan-file-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,7 @@ source "$SCRIPT_DIR/lib/loop-common.sh"
INPUT=$(cat)

# Find active loop using shared function
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

# If no active loop, allow exit
Expand Down
4 changes: 2 additions & 2 deletions hooks/loop-read-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,7 +4,7 @@
#
# Blocks Claude from reading:
# - Wrong round's prompt/summary files (outdated information)
# - Round files from wrong locations (not in .humanize-loop.local/)
# - Round files from wrong locations (not in .humanize/rlcr/)
# - Round files from old session directories
# - Todos files (should use native TodoWrite instead)
#
Expand DownExpand Up@@ -54,7 +54,7 @@ IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || ec
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand Down
18 changes: 9 additions & 9 deletions hooks/loop-write-validator.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,7 +6,7 @@
# - Todos files (should use native TodoWrite instead)
# - Prompt files (read-only, generated by Codex)
# - Wrong round number summary files
# - Summary files outside .humanize-loop.local/
# - Summary files outside .humanize/rlcr/
# - Goal tracker after Round 0
#

Expand DownExpand Up@@ -51,13 +51,13 @@ fi
IS_SUMMARY_FILE=$(is_round_file_type "$FILE_PATH_LOWER" "summary" && echo "true" || echo "false")
IN_HUMANIZE_LOOP_DIR=$(is_in_humanize_loop_dir "$FILE_PATH" && echo "true" || echo "false")

# If not a summary file and not in .humanize-loop.local, allow normally
# If not a summary file and not in .humanize/rlcr, allow normally
if [[ "$IS_SUMMARY_FILE" == "false" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
exit 0
fi

# For state.md, goal-tracker.md, and plan.md in .humanize-loop.local, we need further validation
# For other files in .humanize-loop.local that aren't summaries, allow them
# For state.md, goal-tracker.md, and plan.md in .humanize/rlcr, we need further validation
# For other files in .humanize/rlcr that aren't summaries, allow them
FILENAME=$(basename "$FILE_PATH")
IS_PLAN_BACKUP=$([[ "$FILENAME" == "plan.md" ]] && echo "true" || echo "false")
if [[ "$IN_HUMANIZE_LOOP_DIR" == "true" ]] && [[ "$IS_SUMMARY_FILE" == "false" ]]; then
Expand All@@ -71,7 +71,7 @@ fi
# ========================================

PROJECT_ROOT="${CLAUDE_PROJECT_DIR:-$(pwd)}"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize-loop.local"
LOOP_BASE_DIR="$PROJECT_ROOT/.humanize/rlcr"
ACTIVE_LOOP_DIR=$(find_active_loop "$LOOP_BASE_DIR")

if [[ -z "$ACTIVE_LOOP_DIR" ]]; then
Expand All@@ -94,7 +94,7 @@ fi
# ========================================

if [[ "$IS_PLAN_BACKUP" == "true" ]]; then
if [[ "$FILE_PATH" == *"/.humanize-loop.local/"* ]]; then
if [[ "$FILE_PATH" == *"/.humanize/rlcr/"* ]]; then
FALLBACK="Writing to plan.md backup is not allowed during RLCR loop."
REASON=$(load_and_render_safe "$TEMPLATE_DIR" "block/plan-backup-protected.md" "$FALLBACK")
echo "$REASON" >&2
Expand All@@ -113,7 +113,7 @@ if is_goal_tracker_path "$FILE_PATH_LOWER" && [[ "$CURRENT_ROUND" -gt 0 ]]; then
fi

# ========================================
# Block Summary Files Outside .humanize-loop.local
# Block Summary Files Outside .humanize/rlcr
# ========================================

if [[ "$IS_SUMMARY_FILE" == "true" ]] && [[ "$IN_HUMANIZE_LOOP_DIR" == "false" ]]; then
Expand All@@ -130,9 +130,9 @@ fi
# Extract Path Components (portable - works in bash and zsh)
# ========================================

CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/[^/]*/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/[^/]*/\(.*\)$|\1|p')
if [[ -z "$CLAUDE_FILENAME" ]]; then
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize-loop\.local/\(.*\)$|\1|p')
CLAUDE_FILENAME=$(echo "$FILE_PATH" | sed -n 's|.*\.humanize/rlcr/\(.*\)$|\1|p')
fi
if [[ -z "$CLAUDE_FILENAME" ]]; then
exit 0
Expand Down
6 changes: 3 additions & 3 deletions prompt-template/block/git-not-clean-humanize-local.md
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@

**Special Case - .humanize-loop.local detected**:
The `.humanize-loop.local/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
**Special Case - .humanize directory detected**:
The `.humanize/` directory is created by humanize:start-rlcr-loop and should NOT be committed.
Please add it to .gitignore:
```bash
echo '.humanize*local*' >> .gitignore
echo '.humanize*' >> .gitignore
git add .gitignore
```
8 changes: 4 additions & 4 deletions prompt-template/codex/full-alignment-review.md
Original file line numberDiff line numberDiff line change
Expand Up@@ -60,16 +60,16 @@ Critical blockers: [list if any]

To implement the original plan at @{{PLAN_FILE}}, we have completed **{{COMPLETED_ITERATIONS}} iterations** (Round 0 to Round {{CURRENT_ROUND}}).

The project's `.humanize-loop.local/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
The project's `.humanize/rlcr/{{LOOP_TIMESTAMP}}/` directory contains the history of each round's iteration:
- Round input prompts: `round-N-prompt.md`
- Round output summaries: `round-N-summary.md`
- Round review prompts: `round-N-review-prompt.md`
- Round review results: `round-N-review-result.md`

**How to Access Historical Files**: Read the historical review results and summaries using file paths like:
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize-loop.local/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-review-result.md` (previous round)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_PREV_ROUND}}-review-result.md` (2 rounds ago)
- `@.humanize/rlcr/{{LOOP_TIMESTAMP}}/round-{{PREV_ROUND}}-summary.md` (previous summary)

**Your Task**: Review the historical review results, especially the **last 5 rounds** of development progress and review outcomes, to determine if the development has stalled.

Expand Down
10 changes: 5 additions & 5 deletions scripts/humanize.sh
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,17 +3,17 @@
# Part of rc.d configuration
# Compatible with both bash and zsh

# Monitor the latest Codex run log from .humanize-loop.local
# Monitor the latest Codex run log from .humanize/rlcr
# Automatically switches to newer logs when they appear
# Features a fixed status bar at the top showing session info
_humanize_monitor_codex() {
local loop_dir=".humanize-loop.local"
local loop_dir=".humanize/rlcr"
local current_file=""
local current_session_dir=""
local check_interval=2 # seconds between checking for new files
local status_bar_height=10 # number of lines for status bar (goal tracker + git status)

# Check if .humanize-loop.local exists
# Check if .humanize/rlcr exists
if [[ ! -d "$loop_dir" ]]; then
echo "Error: $loop_dir directory not found in current directory"
echo "Are you in a project with an active humanize loop?"
Expand DownExpand Up@@ -54,7 +54,7 @@ _humanize_monitor_codex() {
local sanitized_project=$(echo "$project_root" | sed 's/[^a-zA-Z0-9._-]/-/g' | sed 's/--*/-/g')
local project_cache_dir="$cache_base/$sanitized_project"

# First, find valid session timestamps from local .humanize-loop.local
# First, find valid session timestamps from local .humanize/rlcr
for session_dir in "$loop_dir"/*; do
# Skip if glob didn't match anything
[[ ! -e "$session_dir" ]] && continue
Expand DownExpand Up@@ -532,7 +532,7 @@ humanize() {
*)
echo "Usage: humanize monitor rlcr-loop"
echo ""
echo "Monitor the latest RLCR loop log from .humanize-loop.local"
echo "Monitor the latest RLCR loop log from .humanize/rlcr"
echo "Features:"
echo " - Fixed status bar showing session info, round progress, model config"
echo " - Goal tracker summary: Ultimate Goal, AC progress, task status"
Expand Down
Loading