Add ctx key to AST record.