The exponential increase in the number and types of mobile devices, along with their ever-growing sets of capabilities, have enabled the development of new architectures that aim to harness such heterogeneity. Transient clouds are examples of mobile clouds, which are created on-the-fly by the devices present in an environment to share their physical resources (e.g. CPU, memory and network) and would disappear as the nodes leave the network. They enable a device to go beyond its own physical limitations through utilising the capabilities offered by nearby devices over an ad hoc network. This idea exploits the device-to-device (D2D) communications paradigm, which allows two nearby devices to communicate with each other in the licenced cellular bandwidth without a base station involved. In this paper, we present a transient context-aware cloud (TCAC) paradigm based on the assumption that the nodes of the network care more about providing/learning higher level functionalities rather than lower level capabilities in D2D scenario. The proposed architecture, realised by using a WiFi Direct, can be portable through any paradigm, which exploits the D2D communications, so opening the doors to forthcoming 5G scenarios. We present a prototype implementation of our architecture over Android smartphones connected via WiFi Direct along with the performance metrics (power/energy consumption and accuracy) to show the benefits of TCAC. A theoretical and analytical model for the energy consumption related to a device within the TCAC is provided as well. Copyright © 2015 John Wiley & Sons, Ltd.