import pathlib,json,datetime,hashlib,sys
root=pathlib.Path(sys.argv[1]); p=root/'claude/projects/synthetic'; p.mkdir(parents=True,exist_ok=True)
(root/'codex').mkdir(exist_ok=True)
now=datetime.datetime.now(datetime.timezone.utc).replace(microsecond=0)
for f in range(2700):
    rows=[]
    for j in range(1000):
        n=f*1000+j
        identity=hashlib.sha256(str(n).encode()).hexdigest()
        # Distinct ids give roughly 370 MB of serialized cache for 2.7M records.
        record={'type':'assistant','timestamp':(now-datetime.timedelta(days=n%29,seconds=n%86400)).isoformat(),'sessionId':f'session-{f:04}', 'requestId':'req_'+identity[:36], 'costUSD':0.001,'message':{'id':'msg_'+identity[28:64],'model':'synthetic-usage','usage':{'input_tokens':100,'output_tokens':50,'cache_read_input_tokens':20,'cache_creation_input_tokens':10}}}
        rows.append(json.dumps(record,separators=(',',':'))+'\n')
    (p/f'transcript-{f:04}.jsonl').write_text(''.join(rows))
    if f%500==0: print(f'{f} files',flush=True)
print('2700 files / 2700000 unique synthetic assistant records',flush=True)
