Skip to content

Commit 3901f02

Browse files
committed
fix the code
1 parent 23487ec commit 3901f02

5 files changed

Lines changed: 18 additions & 7 deletions

File tree

__pycache__/utils.cpython-313.pyc

-27.7 KB
Binary file not shown.

script2_model_b_init.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ def main():
113113
session_a_id = session_a_dir.name
114114

115115
print(f"📁 Found Model A session: {session_a_id}")
116+
117+
transcript_file = session_a_dir / "claude_transcript.log"
118+
119+
if not transcript_file.exists():
120+
raise Exception(f"Claude transcript file not found: {transcript_file}.")
116121

117122
# Load session metadata
118123
session_a_metadata = load_session_metadata(str(session_a_dir))
@@ -240,14 +245,14 @@ def main():
240245
print("3. Use the SAME task prompt as Model A")
241246
print("4. Enter the prompt directly in Claude Code")
242247
print("5. Complete the task with Model B")
243-
print("6. Exit Claude Code when done")
244-
print("7. Run script3_model_b_capture.py when ready")
248+
print(f"6. Export the transcript to: {session_b_dir}/claude_transcript.log")
249+
print("7. Exit Claude Code when done")
250+
print("8. Run script3_model_b_capture.py when ready")
245251
print("=" * 50)
246252

247253
print(f"\n✅ Script 2 completed successfully!")
248254
print(f"📁 Model A session: {session_a_dir}")
249255
print(f"📁 Model B session: {session_b_dir}")
250-
print(f"\n🔄 Repository reset complete - ready for Model B!")
251256

252257
return 0
253258

script3_model_b_capture.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ def main():
145145

146146
print(f"📁 Found Model A session: {session_a_id}")
147147
print(f"📁 Found Model B session: {session_b_id}")
148+
149+
transcript_file = session_b_dir / "claude_transcript.log"
150+
151+
if not transcript_file.exists():
152+
raise Exception(f"Claude transcript file not found: {transcript_file}.")
148153

149154
# Load Model B session metadata
150155
session_b_metadata = load_session_metadata(str(session_b_dir))

set_api_key.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ EOF
1212
# Write anthropic_key.sh with your API key (replace with your real key)
1313
cat > .claude/anthropic_key.sh <<'EOF'
1414
#!/bin/sh
15-
echo "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"
15+
echo "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"
1616
EOF
1717

1818
# Make the key script executable

utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ def initialize_claude_code(model_id: str, session_id: str) -> bool:
359359
if session_dirs:
360360
# Use the most recent session directory
361361
session_dir = max(session_dirs, key=lambda d: d.stat().st_mtime)
362-
transcript_file = session_dir / "claude_transcript.txt"
362+
transcript_file = session_dir / "claude_transcript.log"
363363
else:
364364
# Fallback to current directory
365-
transcript_file = Path("claude_transcript.txt")
365+
transcript_file = Path("claude_transcript.log")
366366

367367
# Launch Claude Code and capture output
368368
try:
@@ -382,11 +382,12 @@ def initialize_claude_code(model_id: str, session_id: str) -> bool:
382382

383383
# Use script command to capture terminal session including user input
384384
claude_cmd = ["claude", "--model", model_id]
385+
script_cmd = ["script", "-q", str(transcript_file)] + claude_cmd
385386

386387
# Try with script command first (captures full terminal session)
387388
try:
388389
result = subprocess.run(
389-
claude_cmd,
390+
script_cmd,
390391
cwd=os.getcwd(),
391392
env=env
392393
)

0 commit comments

Comments
 (0)