Skip to content

Conversation

@scottsen
Copy link
Collaborator

Add the Progressive Reveal CLI tool from gist to tools/progressive-reveal-cli/. This tool allows incremental exploration of files at 4 progressive levels:

  • Level 0: Metadata (size, type, hash, line count)
  • Level 1: Structure (keys, imports, classes, functions, headings)
  • Level 2: Preview (condensed content view)
  • Level 3: Full content (paginated)

Features:

  • Smart file type detection for YAML, JSON, Markdown, Python
  • Regex-based grep filtering with context support
  • Type-aware analysis for different file formats
  • Safe handling of large and binary files

Also add claude.md documentation to guide Claude Code usage with:

  • Progressive Reveal CLI installation and usage instructions
  • Common workflows for exploring configs, code, and docs
  • Tips for working with the GenesisGraph codebase
  • Repository structure overview

This tool is particularly useful for Claude Code to efficiently explore and understand large files without needing to read entire contents.

Add the Progressive Reveal CLI tool from gist to tools/progressive-reveal-cli/.
This tool allows incremental exploration of files at 4 progressive levels:
- Level 0: Metadata (size, type, hash, line count)
- Level 1: Structure (keys, imports, classes, functions, headings)
- Level 2: Preview (condensed content view)
- Level 3: Full content (paginated)

Features:
- Smart file type detection for YAML, JSON, Markdown, Python
- Regex-based grep filtering with context support
- Type-aware analysis for different file formats
- Safe handling of large and binary files

Also add claude.md documentation to guide Claude Code usage with:
- Progressive Reveal CLI installation and usage instructions
- Common workflows for exploring configs, code, and docs
- Tips for working with the GenesisGraph codebase
- Repository structure overview

This tool is particularly useful for Claude Code to efficiently explore
and understand large files without needing to read entire contents.
@scottsen scottsen merged commit e90a290 into main Nov 21, 2025
1 of 11 checks passed
)

# Print output
for line in output:

Check failure

Code scanning / CodeQL

Potentially uninitialized local variable Error

Local variable 'output' may be used before it is initialized.

Copilot Autofix

AI 2 months ago

To fix the problem, ensure that the local variable output is always initialized, regardless of the value that args.level may have. The best way is to add an else branch after the four-level branches that handles all unexpected cases, initializing output to an empty list (or an appropriate value) and potentially printing an error and exiting, or at least preventing it from being uninitialized. Only minimal changes are needed: add a final else: bloc after lines 180-181 that initializes output. No new imports or complex logic is required.

Suggested changeset 1
tools/progressive-reveal-cli/reveal/cli.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/cli.py b/tools/progressive-reveal-cli/reveal/cli.py
--- a/tools/progressive-reveal-cli/reveal/cli.py
+++ b/tools/progressive-reveal-cli/reveal/cli.py
@@ -178,11 +178,14 @@
                 case_sensitive=args.grep_case_sensitive,
                 context=args.context
             )
+        else:
+            print(f"Error: Unknown level {args.level}", file=sys.stderr)
+            output = []
+            sys.exit(1)
 
         # Print output
         for line in output:
             print(line)
-
     except FileNotFoundError as e:
         print(f"Error: {e}", file=sys.stderr)
         sys.exit(1)
EOF
@@ -178,11 +178,14 @@
case_sensitive=args.grep_case_sensitive,
context=args.context
)
else:
print(f"Error: Unknown level {args.level}", file=sys.stderr)
output = []
sys.exit(1)

# Print output
for line in output:
print(line)

except FileNotFoundError as e:
print(f"Error: {e}", file=sys.stderr)
sys.exit(1)
Copilot is powered by AI and may make mistakes. Always verify output.
# Frontmatter detection
if i == 1 and stripped == '---':
in_frontmatter = True
frontmatter_start = True

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable frontmatter_start is not used.

Copilot Autofix

AI 2 months ago

The best way to fix this problem is to remove the assignment to frontmatter_start on line 79, as setting this variable is unnecessary and its value is never used in the method. Since the right-hand side (True) produces no side effects, the whole line can be safely deleted. No other code needs to be changed, and no additional imports or definitions are required.


Suggested changeset 1
tools/progressive-reveal-cli/reveal/analyzers/markdown_analyzer.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/analyzers/markdown_analyzer.py b/tools/progressive-reveal-cli/reveal/analyzers/markdown_analyzer.py
--- a/tools/progressive-reveal-cli/reveal/analyzers/markdown_analyzer.py
+++ b/tools/progressive-reveal-cli/reveal/analyzers/markdown_analyzer.py
@@ -65,7 +65,6 @@
         """Generate Markdown preview."""
         preview = []
         in_frontmatter = False
-        frontmatter_start = False
         first_heading_found = False
         lines_after_heading = 0
         in_code_block = False
@@ -76,7 +75,6 @@
             # Frontmatter detection
             if i == 1 and stripped == '---':
                 in_frontmatter = True
-                frontmatter_start = True
                 preview.append((i, line))
                 continue
 
EOF
@@ -65,7 +65,6 @@
"""Generate Markdown preview."""
preview = []
in_frontmatter = False
frontmatter_start = False
first_heading_found = False
lines_after_heading = 0
in_code_block = False
@@ -76,7 +75,6 @@
# Frontmatter detection
if i == 1 and stripped == '---':
in_frontmatter = True
frontmatter_start = True
preview.append((i, line))
continue

Copilot is powered by AI and may make mistakes. Always verify output.

# Module docstring
if self.tree and isinstance(self.tree.body[0], ast.Expr) and isinstance(self.tree.body[0].value, ast.Constant):
docstring_node = self.tree.body[0]

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable docstring_node is not used.

Copilot Autofix

AI 2 months ago

To fix this issue, the unused variable assignment on line 71 should be removed. This means deleting the line docstring_node = self.tree.body[0]. Since the variable is neither read nor required for side effects, its removal will not alter the code’s behavior. The rest of the code in the block remains unaffected. No additional imports or changes are necessary.

Suggested changeset 1
tools/progressive-reveal-cli/reveal/analyzers/python_analyzer.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/analyzers/python_analyzer.py b/tools/progressive-reveal-cli/reveal/analyzers/python_analyzer.py
--- a/tools/progressive-reveal-cli/reveal/analyzers/python_analyzer.py
+++ b/tools/progressive-reveal-cli/reveal/analyzers/python_analyzer.py
@@ -68,8 +68,8 @@
 
         # Module docstring
         if self.tree and isinstance(self.tree.body[0], ast.Expr) and isinstance(self.tree.body[0].value, ast.Constant):
-            docstring_node = self.tree.body[0]
             # Find docstring in lines
+            # Find docstring in lines
             for i, line in enumerate(self.lines[:20], 1):
                 if '"""' in line or "'''" in line:
                     preview.append((i, line))
EOF
@@ -68,8 +68,8 @@

# Module docstring
if self.tree and isinstance(self.tree.body[0], ast.Expr) and isinstance(self.tree.body[0].value, ast.Constant):
docstring_node = self.tree.body[0]
# Find docstring in lines
# Find docstring in lines
for i, line in enumerate(self.lines[:20], 1):
if '"""' in line or "'''" in line:
preview.append((i, line))
Copilot is powered by AI and may make mistakes. Always verify output.
import sys
import argparse
from pathlib import Path
from typing import List, Optional, Dict, Any

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Dict' is not used.
Import of 'Any' is not used.

Copilot Autofix

AI 2 months ago

To fix this issue, we should remove the unused imports Dict and Any from the statement from typing import List, Optional, Dict, Any on line 6, while keeping the necessary imports List and Optional. This will reduce unnecessary dependencies and clarify the code by only importing symbols that are actually used. The change should be made directly in the import statement on line 6 of tools/progressive-reveal-cli/reveal/cli.py. No other changes, such as additional imports or code edits, are needed.


Suggested changeset 1
tools/progressive-reveal-cli/reveal/cli.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/cli.py b/tools/progressive-reveal-cli/reveal/cli.py
--- a/tools/progressive-reveal-cli/reveal/cli.py
+++ b/tools/progressive-reveal-cli/reveal/cli.py
@@ -3,7 +3,7 @@
 import sys
 import argparse
 from pathlib import Path
-from typing import List, Optional, Dict, Any
+from typing import List, Optional
 
 from .core import FileSummary, create_file_summary
 from .analyzers import YAMLAnalyzer, JSONAnalyzer, MarkdownAnalyzer, PythonAnalyzer, TextAnalyzer
EOF
@@ -3,7 +3,7 @@
import sys
import argparse
from pathlib import Path
from typing import List, Optional, Dict, Any
from typing import List, Optional

from .core import FileSummary, create_file_summary
from .analyzers import YAMLAnalyzer, JSONAnalyzer, MarkdownAnalyzer, PythonAnalyzer, TextAnalyzer
Copilot is powered by AI and may make mistakes. Always verify output.
"""Core data models and utilities for Progressive Reveal CLI."""

import hashlib
import os

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'os' is not used.

Copilot Autofix

AI 2 months ago

To fix this, simply remove the import os statement from line 4 of tools/progressive-reveal-cli/reveal/core.py. This will eliminate the unnecessary dependency, improve readability, and adhere to good coding practices. Ensure that only this line is removed and no functionality elsewhere is affected.

Suggested changeset 1
tools/progressive-reveal-cli/reveal/core.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/core.py b/tools/progressive-reveal-cli/reveal/core.py
--- a/tools/progressive-reveal-cli/reveal/core.py
+++ b/tools/progressive-reveal-cli/reveal/core.py
@@ -1,7 +1,6 @@
 """Core data models and utilities for Progressive Reveal CLI."""
 
 import hashlib
-import os
 from dataclasses import dataclass, field
 from datetime import datetime
 from pathlib import Path
EOF
@@ -1,7 +1,6 @@
"""Core data models and utilities for Progressive Reveal CLI."""

import hashlib
import os
from dataclasses import dataclass, field
from datetime import datetime
from pathlib import Path
Copilot is powered by AI and may make mistakes. Always verify output.
"""Grep filtering utilities."""

import re
from typing import List, Optional

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'Optional' is not used.

Copilot Autofix

AI 2 months ago

The best way to fix the problem is to remove the unused Optional import from the import statement on line 4, leaving only List imported from typing. This ensures the code does not create unnecessary dependencies and improves readability. The change should be made directly on the import line at the top of tools/progressive-reveal-cli/reveal/grep_filter.py, removing Optional but retaining List as it is used in type hints. No further changes or additions are required.


Suggested changeset 1
tools/progressive-reveal-cli/reveal/grep_filter.py

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/tools/progressive-reveal-cli/reveal/grep_filter.py b/tools/progressive-reveal-cli/reveal/grep_filter.py
--- a/tools/progressive-reveal-cli/reveal/grep_filter.py
+++ b/tools/progressive-reveal-cli/reveal/grep_filter.py
@@ -1,7 +1,7 @@
 """Grep filtering utilities."""
 
 import re
-from typing import List, Optional
+from typing import List
 
 
 def apply_grep_filter(
EOF
@@ -1,7 +1,7 @@
"""Grep filtering utilities."""

import re
from typing import List, Optional
from typing import List


def apply_grep_filter(
Copilot is powered by AI and may make mistakes. Always verify output.
@scottsen scottsen deleted the claude/add-useful-tool-01NuT5mgJAbAjAdbbAdNyh6W branch November 21, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants